Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Re: accessing EJB from perl

by ignatz (Vicar)
on Oct 21, 2002 at 13:07 UTC ( #206832=note: print w/replies, xml ) Need Help??

in reply to Re: accessing EJB from perl
in thread accessing EJB from perl

Why? Why try to breed these two beasts? What advantage do you have to writing tests in Perl for an Enterprise Java application? You'd spend more time testing your tests because of each languages different natures. I could see, yes, maybe using Perl to test one's servlets using HTTP (In the past I've actually used silktest for that purpose), but only for such public requests and I'd still want to test my internals using Java.

Test in the language that you code in. Know how to test in every language you code in. If you don't know how to test it, don't code in it.

Just because you can do something, doesn't mean that you should. Yes, I can fly, but I'm still going to pick an airplane over jumping off of a building for that purpose. (Insert I don't know, maybe that ain't such a bad idea in your case joke here)


Replies are listed 'Best First'.
Re: Re: Re: accessing EJB from perl
by SarahM (Monk) on Oct 21, 2002 at 13:26 UTC
    The advantage you get from breeding these two beasts is using the strengths of each language to offset the weakness of the other. Currently I do most of my coding with perl, C# and C++, occasionally I use Java as well. The language I choose to use depends on which language is best suited for the object I wish to create. I have projects that are tens of thousands of lines long that have some objects written in perl, others in C#, and yet others in C++. But they are all part of the same program, and each language uses the objects from the other languages. Often times Iíll choose perl to test each of the objects. That is because perl is the best at writing quick test programs. I know how to test in each language, but choose perl to save time during the testing phase. Once you have an object, it doesnít matter what language you choose to test the object with. You will get the same result whether you use perl, C#, C++, or Java. An object has interfaces, and all you need to do when testing is make sure each interface does its job. Any language that can use that objectís interface can test that. Of course this assumes you know how to call one languageís object from another language, but that isnít too difficult to learn.

    It all comes down to TIMTOWTDI. You may not feel comfortable using perl to interact with another language, but that doesnít mean other people are the same way.

      You'll have to excuse me if I don't buy it. Using a weak typed language to test a strong typed one? Combine that with Enterprise Java's lock the door and throw away the key vs. Perl's Dude, come on in and Party! method of security sounds to me like a recipe for some very weak tests.
        How the language it typed doesn't matter! You are testing the object. That means you check that the proper values are returned when a sequence of interfaces are called. Or you make sure that the objects writes to the database, or whatever else you have your object doing. What you aren't doing is mixing random bits of Java and perl. As long as you use object, and access the objects through the interfaces, it doesn't matter what language the object or testing program is in.

        Look at how well OLE works with perl. A COM/DCOM object is strong typed, but perl is able to call it without problems. There are many production perl scripts that use OLE because it works well. After showing other developers who write COM/DCOM objects how to test them with perl, most of them choose to use perl for their testing (it save a lot of time). Most of these people had fears about testing their COM/DCOM object with perl, but after see how it works and playing with it, those fears have subsided.

        I know some people don't like the idea of using several languages at the same time, but there are huge time and maintainability savings to be had when using the right language for the job. I'm personally looking forward to Parrot for it's ability to run Java, .Net, and perl on the same VM, and make it much easier to use objects from other languages.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://206832]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2023-03-30 04:16 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (73 votes). Check out past polls.