EOB 1.1

About EOB
News & History
J2EE comparison
Bugs & Issues
Limitations of use
Info & Credits

Simple Stock Quote Servlet
People & Addresses Beans
Shopping Cart
Velocity Webapp
Clock Applet
Swing Bank Account


Hosted By
SourceForge.net Logo

EOB logo  Enterprise Object Broker

Example 0 - Stock prices


Shown here are the central StockQuoteService interface, and the plain immutable bean it creates, PriceDataBean.  There are two implementations of that service - RealStockQuoteService and MockStockQuoteService.  There are three tests that use it - StockTestBean which exists inside the EOB Container, MainableStockTest which launches via main(..), StockQuoteServlet (for running inside a web server).

These are standard Java classes and standard interfaces.  There are some Avalon framework interfaces implementeded and used by the bean implementations, but other than that this is an ordinary relationship between classes and interfaces.

Class Diagram

Class Diagram for Example0

We could, if we wanted separate PriceDataBean into interface and impl and not consider it an immutable "value object".  If separated, we could consider that it was also a facade and support remote calls.

Running Example0

1) Get Phoenix from downloads (unless you have it already). See section titled 'Phoenix in binary form' on the downloads page. Unzip Phoenix

2) Download either eob-with-http.sar or eob-with-http-and-db.sar from the downloads page. Place the sar file in the 'apps' directory of the unzipped Phoenix.

3) CD to the run directory and execute run.bat or run.sh as appropriate. After a few seconds ctrl-c Phoenix.

4) Download* eob-example0.eob and place it in the 'startupApps' directory created a couple of dirs deeper than the phoenix 'apps' dir.

* - Or make this .eob file from the source download by doing 'ant eob'

5) Execute run.bat or run.sh again. You should see....

Phoenix 4.0.1

war =file:/somewhere/eob/phoenix-bin/apps/eob-example0/example0files/example0-test.war
Example0: StockTestBean started.
Example0: Sun's last sale price 0.35734015627838855433395792715600691735744476318359375
Example0: Microsoft's last sale price 0.60391766776897615187635892652906477451324462890625

6) Download 'eob-example0-test.jar' from the downloads page. It is an executable jar remotely queries the launched EOB application to produce the result as above.

7) Point your browser to http://localhost:8080/fred/StockQuoteServlet to see the (ugly) web presentation of the above output.

- EOB team.

$Revision: 1.13 $ $Date: 2003/04/15 21:24:13 $