Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Easiest, breeziest EJB components

Using Rational Application Developer for WebSphere Software

Jeff K. Wilson (wilsonje@us.ibm.com), Technical Consultant, IBM
Jeff Wilson, a self-proclaimed dot.com refugee, has for the past three and a half years been an e-business architect for the DragonSlayers, IBM's ISV and Developer Relations Technical Consulting team in Austin, Texas. It is their goal to excite, evangelize, educate, and enable developers on the latest tools and technologies available. Jeff welcomes any and all questions, comments, recipes, insider stock tips, cash, prizes, and any good juicy gossip. He can be reached at wilsonje@us.ibm.com.

Summary:  This tutorial introduces you to IBM Rational Application Developer for WebSphere Software, a comprehensive, highly visually-driven integrated development environment, that takes the process of creating EJB components to its simplest level yet. You will learn new ways to visually construct your components and then run easy to use wizards to create J2EE applications faster than ever.

Date:  11 Jan 2005
Level:  Introductory PDF:  A4 and Letter (83 KB | 22 pages)Get Adobe® Reader®

Activity:  9301 views
Comments:  

Before you start

Introduction

A while back, I wrote...

"A while back, I wrote a tutorial on EJB components in a previous version of WebSphere Studio. At the time I knew enough about EJB components to fully grasp what they were for, why they made J2EE development easier for Java™ developers (particularly servlet and bean developers) and, most importantly, why EJB developers were paid so well and why I didn't want any part of it... "

I rambled on a bit longer about how EJB development was historically tedious, complex, and a bit mystifying to those not skilled in the art and how the tooling included in the latest development tools made the whole process considerably more point-and-click-like.

That second tutorial, Easier, breezier EJB components: WebSphere Studio V5.1 simplifies EJB component development (the sequel to Easy Breezy EJB components), went rather well, I would say, based on the e-mails I received from people quickly becoming more fluent in the technology than I and describing how they wanted to expand on the exercise rather than asking for clarification.

Now, enter stage left, the latest IBM® integrated development environment (IDE), IBM Rational® Application Developer for WebSphere® Software and, with that, the long awaited (at least by me and those that hold the mortgage on my house) third tutorial in the series, Easiest, Breeziest EJB components.

For today's exercise, let me set the stage. For those of you who are familiar with the various IBM WebSphere Studio IDEs, our newly acquired friends at Rational have taken on the responsibility of improving on some of our development tools -- namely WebSphere Studio. If you are familiar with the Rational toolset, you are aware that their shtick is in model-driven development (among some other interesting things). As it happens, people tend to enjoy dragging and dropping elements to visually develop rather than type actual code. Thus, Rational's approach seems a great fit within Studio, and you will find in many areas within the new tools some swanky new ways to model your application components and then run wizards to automatically chunk out the code. EJB development is certainly included.

What you will find in this tutorial is how these latest tools make life so much easier than days of old.


What this tutorial is about

I probably should point out one important aspect of enterprise development -- in case you are somewhat new to this -- the "model" layer.

By now you are likely familiar with the notion of the standard model-view-controller architecture promoted by an industry-wide J2EE practice. It is widely accepted that the front end of an application may change frequently. This might be as simple as tweaking the color scheme of the HTML pages your users see, to something a little more complex, as in adding new features. Parts that change less frequently are the parts that make up the actual data used by your system. In addition, the back-end data might be reused by many different areas of your application. Replication -- how the data is pulled from a data source -- or replicating any part of your application -- is considered bad form because in time you may need to change how that part works and, thus, necessarily need to change the same code in multiple areas.

None of this should be news to you. But this is at the heart of a model-view-controller architecture. By separating the view (HTML, JSPs, the parts the user sees) from the controlling business logic (servlets, JavaBeans, the stuff that does a great deal of the work) from the model or back-end data (user data, stuff pulled from a database perhaps), you can easily replace or reuse parts in very efficient and flexible ways. By separating, I mean do not include Java code in your JSPs that call a database directly. Some other JSP may need to call the same database for the same information, thus requiring you to replicate the call to the database. This will help you avoid the potential for hosing a key piece of business logic because it was embedded in a block of HTML code that was marked for removal.

EJB components are the model in an enterprise application. By packaging the way data is pulled from a data source, not only do you isolate it to components not touched by other areas of your development team as described above, but you also gain the benefit of being able to easily reuse those components by many areas of your application, as well as by other applications throughout (or beyond) your enterprise.

Quite frankly, in a simple case -- one that this tutorial illustrates -- the tools in WebSphere Studio make EJB development less coding and more administration. I don't mean to diminish the importance or even the potential complexity of EJB development -- far from it. Abstracting out the data connections from your application to a series of reusable objects is likely no lighthearted task. The power and flexibility of EJB components is ultimately balanced with potential performance and environment factors that need to be carefully weighed. This tutorial assumes that you have already decided to use them and does not really discuss these issues in depth.

You will simply look at the tools within Rational Application Developer that help you create your new EJB components. The beans you develop may likely be similar to some of what you will ultimately develop on your own, but as you can imagine, you may be working with a far more complicated architecture.


Who should take this tutorial

This tutorial is for lazy developers who want big bucks, as well as Java application developers with some basic knowledge of DB2® Universal Database.


Prerequisites

To complete this tutorial, you need Rational Application Developer, IBM DB2 UDB V8.2, and a couple of scripts I wrote to get your database rolling.

Download and install the two applications as normal in the default directories. Save each of the ddl files to C:\temp.

1 of 17 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=135396
TutorialTitle=Easiest, breeziest EJB components
publish-date=01112005
author1-email=wilsonje@us.ibm.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.