The Source for Java Technology Collaboration
User: Password:
Register | Login help    

Search

Online Books:
java.net on MarkMail:


Connecting Disparate Dots

Posted by editor on December 9, 2004 at 7:30 AM PST

Get your EJB's testable

Connecting disparate API's can be tricky, strange, but ultimately quite appealing. I once had to expose Jini services in a servlet. This was a little odd because Jini sees the network as very dynamic, with services appearing, disappearing, changing states, etc., all the time. Basic servlets, on the other hand, give the client a "snapshot" of data at some point in time. Moreover, Jini participants are typically "thick" applications that participate in the federation in real-time, while web clients are fairly dumb and only occasionally connected. Given the clash of these two, I think we did pretty well by using the servlet at the Jini client and then having the web client get snapshots of that data. But still, dissimilar API's can be tricky to bridge.

Olexiy Prohorenko deals with a variant of this challenge in the feature article Testing Your Enterprise JavaBeans with Cactus. The challenge here is in connecting JUnit, which typically makes fairly straightforward method calls on test-case classes, with EJB's, which make all sorts of assumptions about the environment they run in. Olexiy hypothetically completes some part of a bean and wonders: "How will I test it? Do I test business logic by calling EJB methods, like a normal Java class? No, never! Do I need to create an additional EJB client and use that? Probably. But what if I will need to share my test reports with other developers? That could definitely waste my time, and instead of developing just the EJB itself, I will have to develop a useless client, which will be only be needed during development." The solution is to use Cactus, which provides servlets for running tests in an application server, and returning results as XML or more human-readable HTML.


Note: today's daily blog was written by Chris Adamson (invalidname), Associate Online Editor for java.net


In today's Weblogs, Daniel Brookshier reports on New Education Projects at GELC: "Many more projects have been added to the Global Education and Learning Community (GELC) at java.net. Again we have quite a mix from a student's exploration into Java, a Tapestry project and even an attempt to create a web interface in the style of one of my favorite BBC programs 'Connections'."

Billy Newport's SDTimes comments on OSGI links to an article on the emergence of the Open Services Gateway Initiative (OSGI) as a standard for third-party plug-ins. Billy takes it a step further: "I think OSGI has a big future on the server side. Andrew talks about the bulk etc of J2EE containers but if we could get the open source and commercial application server vendors using OSGI for their runtime frameworks for servers then a lot of interesting things could happen."

John Reynolds writes: " Rich Web based applications are far from "new", but there still doesn't seem to be a general consensus on how they should be constructed. To the contrary, there are a dizzying array of options for constructing both the client and the server parts of the equation." In The Rich Web Client conundrum, he takes a top-level view of the options, both on the server and client sides, and works out what factors in your application will dictate a particular choice.


In Also in Java Today, Just in time for last-minute holiday shoppers, java.about.com's Kevin Taylor has assembled his list of the Top 10 Must-Read Java Books. From concepts to API listings, swing to servlets, he says "these books are must-reads for every professional Java programmer, no matter their specialty or experience level."

Writing Jetspeed portlets is somewhat like writing servlets. Portlets need to function well in a framework and on a page full of HTML elements. In A well-behaved Jetspeed portlet Bob Fleischman constructs the LinkFarm portlet for Jetspeed 1.5 and examine techniques for coding a portlet that doesn't interfere with other portlets.


In Projects and Communities, The Java Web Services and XML home page is featuring Qusay H. Mahmoud's java.sun.com article Getting Started with Java Message Service (JMS), a "fast track introduction and tutorial to JMS and its programming model."

The Java User Group community includes the the j2me-cdc JUG . People from all over the world are invited for "discussion, the exchange of source code and documents, and anything related to J2ME CDC technology."


In today's Forums, cowwoc notes the cost of A Keyword Suggestion : 'check': "It is *extremely* difficult to introduce new keywords into a language, not only from a technical point of view but also from a social point of view. If we're going to do such a thing, there has to be an overwealming evidence that the majority of the community likes your suggestion and will be positively affected by it. I am a strong believer in putting up strong resistence to any new feature requests within applications not to mention within Java itself. We are all best served by running new ideas through a tough gauntlet. Those that do not come out the other side might have been good, but not great enough to warrant the cost."

To those who want more choices in terms of compilers and build tools to build J2SE from source, kellyohair writes in Re: More Flexible Build: "Certainly using a single compiler with the same command line has it's advantages. And I also have wondered if it might be better to use one compiler. But in reality we have not been able to use the same gcc compiler on all Linux machines, we have to use different versions. Speaking as someone that builds the J2SE on Solaris, Linux, and Windows all the time, when you crank up the optimization level to the max, you want the best optimizing compiler available, where best includes quality and performance. And the ABI stability of the Linux g++ compiler and runtime libraries is a major pain right now, in my opinion."

subanark for a Mustang feature he calls Unique Maps: "I couldn't find any class similar to this in tiger (correct me if Im wrong). I would like to see a class like this:

public interface UniqueMap
{
 public static class Identifier 
 {}
  E get(Identifier identifier);
  void put(Identifier identifier, E value);
}
This way you can put items into a set with a given type and take them out without casting (assuming that there are multiple types in the set)."


In today's java.net News Headlines :

Registered users can submit news items for the java.net News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to thejava.net News RSS feed.


Current and upcoming Java Events :

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Get your EJB's testable
Comments
Comments are listed in date ascending order (oldest first)