[TheServerSide Newsletter #19]

TheServerSide.com Connection newsletter keeps you up-to-date on the most important J2EE industry news and issues emerging on The ServerSide.com. More, it delivers to your screen exclusive J2EE articles and advanced topics not available on any other enterprise java site or publication. This newsletter is transmitted bi-weekly. It is printer-friendly and available online


IN THIS ISSUE



Tales from TheServerSide
  o How many network calls does it take to screw in a lightbulb???

Upcoming Conferences
 o XML EDGE

Featured Technical Articles
  o Tutorial: Message Driven Bean

Enterprise Java Education Strategies
 o Enterprise Java Training & A Pledge Of Support

EJB Book Projects on TheServerSide
  EJB Design Patterns:
 o EJB Strategies, Tips and Idioms
 o EJB Command Pattern

Key J2EE Industry News Headlines
 Some key headlines:
 o IBM attacks BEA's position with software consulting companies
 o Gartner Group: Ditch Microsoft IIS now

Special Announcement: TheServerSide.com is now featured on java.sun.com

TheServerSide.com and the J2EE community has finally made it to the home page of java.sun.com!
In their featured article "TheServerSide: Bringing the J2EE Community Together", the TheServerSide
and its founders are interviewed about the history of TheServerSide, whats new and cool, design
patterns and TSS' architecture, and what cool features to expect.

It has been a dream of mine to have this site featured on the java.sun.com homepage for some time.
Thank you all our members for helping make this site as great as it is! We could not have done it
without you.

Sincerly,
Floyd




TALES FROM THE SERVER SIDE



How many network calls does it take to screw in a lightbulb???


Consider the following typical sequence of events required to use a stateless session bean:

Some claim that this sequence in fact requires 5 network calls. Why does narrowing the home and creating the session bean require network calls? Why would a developer bother to destroy a session bean after using it? Let's invesitage these two questions.

Question: Why does the act of PortableRemoteObject.Narrow'ing a home object and home.create'ing a session bean require network calls?

Narrowing typically does not require a network call except on certain ORB-based container implementations that require network access to remote repositories for class resolution. This is not the usual case; most narrowing is indeed local. The narrowing requirement is a holdover from initial interoperability approaches. Most vendors can simply let users get away with Java type casting instead. Of course, you'd still have to perform narrowing if you were accessing beans from a CORBA client.

However, creating an EJBObject (as opposed to an EJBLocalObject) does require network calls, and there's really no way around that. The home stub or proxy certainly does know about its server, but that's not enough to actually allocate an instance to the client. Instance means a few things: the actual instance of the bean implementation (or container artifact if the container wraps the bean implementation, which some do) as well as the instance context and possibly other objects as well. Usually refering to and "Instance" entails all of these instance-related objects tied into one cohesive Instance composite.

The container intercepts the create call, passes the invocation through a series of filters (security check, loggers, etc.), and finally passes the invocation to some invoker, which concocts the composite instance based on the environment in the invocation (security info, tx info) and on the actual bean implementation instance, which it pulls from the pool -- possibly causing the pool to create a new instance and set its session context. The container invokes ejbCreate on the new instance, and returns the stub or a proxy for this Instance back to the remote client. In this scenario, the container itself is remote, not located in the same process as the client. So the create invocation must be remote.

Of course, if the container and client are in the same VM under EJB 2.0, the invocation can be passed directly to the local client with no network overhead.

Here's a kicker, though: some vendors these days do not use instance pools for stateless session beans at all. There is evidence to suggest that pooling obects that do not maintain low-level resources (sockets, file descriptors, etc.) is actually more expensive than simply instantiating new instances in modern VM's with their advanced GC. These VM's can optimize instance creation in a way that provides better performance than can object pools, and object pooling actually circumvents this VM feature. Pooling objects with low-level resoures still makes sense (JDBC pools, for example, are still quite necessary). But as a result of powerful new VM's some containers simply create new instances each time rather than pooling them.

Question: Why bother removing a stateless session bean? Session beans live in the pool, why would a client ever need to call remove on a stateless session bean stub?

Practically speaking, there is very seldom a need for a client to invoke 'remove' on a stateless session bean. The only reason you might invoke remove instead of letting the container handle it for stateless session beans is when you explicitly want the client to shrink the instance pool (if your vendor allows this instead of ignoring the remove invocation on stateless beans). This is likely a rare circumstance, but it is possible.

One possible example might be the case of a JMS client (possibly an MDB) that receives some notification of an administrative action, where that action might denote some change in the availability of system resources or even some explicit real-time change in some of the app's metadata, causing the client to perform a lookup, create, and remove of a few session beans in order to shrink the instance pool. This example may sound a little far-fetched or even hackish, but if clients do have some reason for explicitly shrinking the instance pool themselves in a standard manner, invoking remove will accomplish it so long as the container permits it.



Back to Top


UPCOMING CONFERENCES




Oct 22-25, Santa Clara

If you attend any XML developer shows in the fall, then attend XMLEdge. With a strong Web Services Focus (the show is co-locatted with Web Services Edge West) and an excellent lineup of talks, this show promises to be a great technical event. Many interesting talks will be presented, including Code Generation from XSLT, Using XML in J2EE Apps, MVC pattern with XML/XSLT and more.

Get more conference info here



Back to Top



FEATURED TECHNICAL ARTICLES



Message Driven Beans Tutorial
Contributed by



MDBs overcome the limitations of synchronous messaging using session and entity beans in the EJB 1.1 container. MDBs can be deployed in the EJB 2.0 Container, which acts as a message listener and uses inbound messages as a trigger to invoke business methods in an asynchronous manner.

Read the article here


Back to Top

ENTERPRISE JAVA EDUCATION STRATEGIES



Enterprise Java Training & A Pledge Of Support

Like most people around the world, we at The Middleware Company were shocked and saddened by the tragedies at the World Trade Center and Pentagon. Today, we are grateful for every day we are alive and pledge our support to the survivors. In October and November, a portion of your open enrollment tuition will be donated to relief organizations and special funds developed by the American Liberty Partnership in coordination with federal, state and local officials. Register now for open enrollment courses online at http://www.middleware-company.com/schedule.shtml?ts18 or email registration@middleware-company.com.

Favorable pricing is available for companies who want to send multiple students to open enrollment courses. Email sales@middleware-company.com for more information. Also remember that if your company is curbing travel, all advanced EJB, J2EE, and Web Services courses, including the popular EJB for Architects, are available at your site. Call us toll-free at 1 (877) 866-JAVA (5282) to book yours.

Course schedule:

New York, NY:
NOV 12 - 16, FEB 18 - 22    XML & Web Services
NOV 26 - 30,
JAN 21 - 25, MAR 19 - 22
   Mastering EJB
JAN 7 - 11,
MAR 4 - 8
   Building J2EE Systems
OCT 29 - NOV 2,
DEC 10 - 14, FEB 4 - 8
  EJB For Architects
San Francisco, CA:
OCT 29 - NOV 2,
MAR 18 - 22
   XML & Web Services
DEC 10 - 14,
FEB 18 - 22
   Mastering EJB
NOV 12 - 16,
FEB 4 - 8
   Building J2EE Systems
NOV 26 - 30,
JAN 21 - 25, MAR 4 - 8
  EJB For Architects
London, UK:
DEC 3 - 7     EJB For Architects

Get complete course outlines at www.middleware-company.com.
Email: registration@middleware-company.com
Call for details about private courses or for more information: (512) 336-9347


Back to Top


EJB BOOK PROJECTS ON THE SERVER SIDE



Latest Public Review Postings:

EJB Design Patterns

EJB Strategies, Tips and Idioms
1st public review posting, By Floyd Marinescu

The beginning of a colleciton of fine-grained tips and tricks for designing and implementing EJB applications. Tips that are two small to be patterns are put in this chapter. You can submit your own tip to this chapter and have it published in the book ...........

Read/Review rest of the chapter


EJB Command Pattern
1st public review posting, By Floyd Marinescu

How can a developer implement a use cases business logic in a light weight manner, decoupling the client from EJB and executing in one transaction and one network call?

A command bean is just a plain java class with gets, sets and an execute method. Applied to EJB, the command pattern provides a light-weight solution for achieving the same benefits as the Session Façade and Business Delegate patterns: a façade that hides the object model on the EJB layer, execution of a use case in one transaction and one network call, and complete decoupling of the client from EJB. The command pattern achieves these by providing clients with classes that they interact with locally, but which actually execute within a remote EJB server, transparently to the client. ...........

Read/Review rest of the chapter



Back to Top


KEY J2EE INDUSTRY HEADLINES


Sun absorbing iPlanet staff and functions

The iPlanet group, originally called the Sun-Netscape Alliance, was spawned by AOL's acquisition of Netscape '98. As part of the deal, products, programmers and salespeople from Sun and Netscape were merged into an independent group that became iPlanet. But iPlanet has been losing its independence, Sun has been gradually moving iPlanet functions within the rest of Sun.

Click here to read more.


BEA's Bill Coleman turns over CEO position to Alfred Chuang

BEA Systems chief executive Bill Coleman (the "B" in BEA) has stepped down to take on a new job as chief strategy officer and continue as chairman. Chief operations officer Alfred Chuang (The "A" in BEA) is now CEO. Analyst firms have said that its lead over rival IBM is shrinking yearly, furthermore, BEA faces some heavyweight challengers in iPlanet and even Oracle. BEA's re-org is aimed at evolving the companies strategy and continueing as the market leader.

Click here to read more.


IBM attacks BEA's position with software consulting companies

One of BEA's winning strategies was its focus on winning over software consultancy companies to use BEA software in all of their projects. Now that IBM has a comparable product, a new war is being launched. One such skirmish is over Paris-based Valtech, a BEA partner in which IBM is making headway.

Click here to read more.


Sun and Allies Launch Internet Authentication Initiative

Sun and about 30 allies today launched an alliance to manage authentication and identity on the Internet and in offline businesses, which will compete with Microsoft Passport and Hailstorm. Passport is, at least for now, an Internet-centered service, while Liberty could be used in a wide range of services: PCs, cell phones, TVs, cars, credit cards, and point-of-sale terminals. Another difference between Passport and the Liberty Alliance: Passport actually exists, with 165 million accounts, according to Microsoft. The Liberty Alliance is still in the planning stages.

Click here to read more.


Gartner Group: Ditch Microsoft IIS now

Gartner Group has issued a remarkable advisory recommending - in the strongest terms - that enterprises abandon their investments in Microsoft's web server IIS (Internet Information Server).The key point of the advisory is that Gartner has lost faith in Microsoft's ability to patch and fix the IIS. It recommends holding off from .NET products too, or at least those that are based on Microsoft's IIS until the latter is "completely rewritten".

Click here to read more.


JBoss responds to J2EE licensing concerns

Marc Fleury, President of the JBoss Group, has responded to the recent claims made about open-source J2EE licensing and how it effects JBoss. "JBoss remains a highly successful, fully featured and cost-effective J2EE server solution available for free download under the LGPL license."

Click here to read more.




Back to Top


ABOUT THESERVERSIDE / UNSUBSCRIBE


If you are receiving this newsletter it is because you signed up as a member of TheServerSide.com and elected to receive our newsletters. To unsubscribe from TheServerSide.com's bi-weekly newsletter, log on to TheServerSide and edit your user profile. Email webmaster@theserverside.com if you are having problems editing your profile.

About TheServerSide.com

TheServerSide.com J2EE community is brought to you by The Middleware Company. The Middleware Company is an advanced training and consulting company dedicated to server-side Java. The Middleware Company offers onsite training courses in Java 2, Enterprise JavaBeans (EJB), the Java 2 Platform, Enterprise Edition (J2EE), and the Extensible Markup Language (XML). They also aid in the design, development, and deployment of middleware solutions.

Visit The Middleware Company.


This newsletter and contents are Copyright © 2001 The Middleware Company LLC