[Opensource] Expresso 4.1 Documentation Promotion

Peter A. J. Pilgrim peterp at xenonsoft.demon.co.uk
Sun Oct 20 20:06:03 PDT 2002


Geeta Ramani wrote:
> Hi all:
> 
> In an effort to make a contribution to the doc enhancements that Sandra 
> has mentioned below and in other notes, I looked at the "Expresso 
> Controller Objects" document under the "Components Overview" section 
> under "Documentation". I submitted a preliminary revision which now 
> seems to be on-site. (Sandra, I thought you were supposed to wait till 
> we resolved the issues I had..! ;)
> 
> Anyways, here a couple of things I'm concerned about:
> The last piece on "/Controllers and EJBs/" really doesn't seem ok. 
> Especially the bit about "/Expresso Framework is supposed to have a J2EE 
> mapping / integration. /"..Well, does it or doesn't it? I dont know, so 
> I left it untouched, but maybe someone on this list could clarify this?
> 

Hello Geeta, the quoted text was written by me originally in a message
I posted to the "opensource" list or in a forum. I think Sandra C posted
that email verbatim into the documentation.

As for the clause I cannot answer the question myself about Expresso's
EJB integration.

Ok if you have Expresso Framework 5 downloaded and your on your
webserver you can work with Enterprise Java Bean if you want to.
There is no restrictions. However Expresso does not create or
manipulate EJBs directly at the moment. Expresso talks to the database
using its own DBObject.

EJB technology is designed to be distributed component based,
transaction safe, scalable across virtual machines, and
portable across J2EE application servers. This is important
if you running Enterprise mission-critical applications. In detail

(*) Distribute Component - EJB is a component build technology that permits
deployment across local and foreign servers.

(*) Transaction safe - J2EE specifies level of transaction control for
Enterprise JavaBeans so that two separate people withdraw and credit a single 
bank account without serious race condition, double insertion, and phantom reads.

(*) Scalable - J2EE specifies that application servers can deploy EJBs
across virtual machines on a different CPU and across networks. So if you
buy an application server you can take advantage clustering features,
load balancing for your own BankAccount EJB. If London crashes then NewYork
server can take over running the bank business 24/7/365 over the web.
If you find that web business doubles over night then you can buy
more applications server and spread your

(*) Portable - J2EE certified application servers can deploy EJBs that
written on another EJB server. YMMV if you use proprietary server's features
etc, etc


DBObjects in Expresso 5.0 do not have any of the above Enterprise features.
This is what I alluded to in the original mail (if I deleted couple months
ago ). However DBObjects are better nothing if you do have no Object Relational
layer. DBObjects are good because you can manipulate Database tables within
Java, the language we all love. DBObjects are implementation of a
well-decent software design pattern (see Mark Grand, J2EE Enterprise Patterns,
Wiley 2001)

DBObject are not Enterprise Java Beans.

		  	       		
+--------------------+ 	       		
|   Browser          | 	     host: ntpc101
+--------------------+	       	  	
        	 /|\	  	       	  	
..........|.................................
  	  |	  	       	  	
  	 \|/	  	       	  	
+----------------------+	  	
|   Jakarta Tomcat     |	  	
+----------------------+     host: pegasus
|   Expresso Framework |     	
+----------------------+     	
|   Oracle 	       | 	
+----------------------+       	
(Figure 1)	 		


Expresso Framework is a web tier application. DBObjects are a fundamental part
of Expresso Framework. If you use DBObjects read from and write to business 
databases then you are using Web tier to talk to the Back-End Database tier.
This means that you business logic, say to handle withdrawal of cash or
crediting of cash into bank account, has to be written inside Expresso
Controllers. From a technical architect point of view, this may not be
what really you want, because of inflexibility of the moving databases
and configuration.

An architect favourably looks at the J2EE solution to avoid polluting the
web tier with business logic rules. In this case she would use EJB to talk
to the business database. (See Figure 2)		  	       	    				

	       		      .		
	       host: ntpc101  .		
+--------------------+ 	      .	       	       	
|   Browser          | 	      .		    	
+--------------------+ 	      .		    	
        	 /|\   	       	      .		    	
..........|....................		    	
  	  |    	       	      .		    	
  	 \|/   	       	      .	       +-------------------+
+----------------------+      . /---->-|   EJB 	       	   |+  * X
|   Jakarta Tomcat     |      ./       +-------------------+|	
+----------------------+      /	       	+-------------------+	
|   Expresso Framework |     /.	       	       /|\	     	
+----------------------+    / .	       	       	| 	     	
|   EJB (skeleton)     |---/  .	                |            	
+----------------------+      .	       	       \|/     	     	
                               .	       +-------------------+ 	
                               .	       |   Oracle          |+  	
        	       	       	      .	       +-------------------+|  * X
        	       	       	      .		+-------------------+	
   host: pegasus	       	      .		    	  		
	      	  	      .	   host: andromeda		
		  	      .	    	    			
(Figure 2)	 	       		


The second diagram shows that Expresso installed on `pegasus', a tomcat server.
The web application on Expresso uses has Controllers that talk to EJBs
directly. The EJBs are located on another server `andromeda'. Please pay
attention to the network boundary between the differents host `ntpc101'
, `pegasus', and `andromeda'

The EJBs handle all the core business logic, crediting and debiting
bank accounts with money. The Expresso web application never sees or touches
the Oracle database where concern with money. However in order to work
Expresso has to talk to a database of some sort, afterall, so the
administrator and architect set up a separate database to handle on-line
security. This is what I mean in the original mail "... but the default
DBObject needs to talk to a database"

In antifact the host `andromeda' has a J2EE application server, but remember
I said, there can more and than one application server in a J2EE architecture.
This is the meaning of the `* X' symbol in the diagram.

I hope this explains thing better. In conclusion Expresso has no special
support of EJB, in this respect it is identical pure Jakarta Struts. It is
your choice to use or not use EJB.


> Further, the bit about "/The difference between DBObjects and 
> EntityBeans/" seems interesting except the subsequent list doesn't seem 
> to point out any differences, but simply lists how an EJB is supposed to 
> behave. I am sure there's something of importance here: I just don't 
> know enough either about EJBs or about DBObjects to comment/correct.. 
> Again, could someone explain?
> 

I hope I have explained in the long piece above.

> Otherwise the changes I made to the earlier document were mostly 
> cosmetic :).. Btw, does anyone have any comment about the second 
> statement that I added in: / (Contrary to what may be initial 
> expectation, a "Controller" does not therefore extend the Struts 
> ActionServlet.)/
> This is something which confused me at first, so I mentioned it.  I mean 
> the name "Controller" for the Expresso controller made me imagine it 
> "ought to" extend the Struts ActionServlet.. But I have been working 
> with Struts only for a couple of months, so this may just be my 
> inexperience showing. :( Maybe the Struts Action classes are (or should 
> be) in fact considered "part of" the Controller?? .. I always thought of 
> them somehow as a liason between the (one) big-boss (ActionServlet) 
> Controller and the Model classes.. but hey, I'm easy, I can change my 
> mind..;)
> 

Aargh! The confusion is that an `Expresso Controller' is a legacy term
for a web application tasks. Before Expresso Framework 4.0 the toolkit
had its own Model View Controller implement. The `Controller' term
came from that version of the toolkit. An `Expresso Controller'
is derived from a `Struts Action'. Struts Actions are better, I think,
I call them web applications task, some people call them `commands'.
Controllers is not accurate betweens Struts is now the MVC. Whole point
is to allow the web developer to concentrate on writing the `tasks'
not to worry about MVC. This is what Struts provides and is what
Expresso provides.

> I also added a definition for a "finite state machine". I thought some 
> of us may benifit from a review ..
> I also added the "JobSecurityMatrix" Controller to the list of 
> Controllers included with Expresso. I lifted the "description" part 
> right out of the source for that class - so hopefully it isn't way 
> off..! ;) I didn't check on the other descriptions: don't know enough 
> about any of them..
> 
> I guess that's it for now.
> Thanks very much in advance,
> Geeta

-- 
Peter Pilgrim
ServerSide Java Specialist

My on-line resume and for interview videos about myself, J2EE
Open Source, Struts and Expresso.
    ||
    \\===>  `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''




More information about the Opensource mailing list