Architecture of new Petstore application

I was wondering if there is any architecture document of the new Petstore application that uses JSF, AJAX, JMaki etc. If yes, then what is the URL of the documentThanks-Sankate
[204 byte] By [sankatea] at [2007-11-26 21:06:41]
# 1

Hi,

We started a rough version of an architecture document. Maybe we can post the rough version o he blueprinst site for early acess.

Do you have some specific questions we could address? What types of questions would you like to see answered in the architetcure document?

Maybe w ecan answer sokme of them here.

Sorry for the slow response.

hth,

Sean

seanbrydona at 2007-7-10 2:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

I had given up all hopes of getting any reply :-)

Thanks for the response.

I had few questions

1. The Map module in particular, most the websites using Google mashups do not require so much server side plumbing, any particular reason of this approach?

2. I want a clean separation of web tier and business tier so that these two can run on two different JVM's. I was not able to figure out the clear boundaries in case of Petstore, this is why I was looking for Architecture diagram.

Thanks,

Sankate

sankatea at 2007-7-10 2:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

Hi,

> 1. The Map module in particular, most the websites

> using Google mashups do not require so much server

> side plumbing, any particular reason of this

> approach?

The page that displays the maps (you can see a live demo at http://webdev2.sun.com/petstore/faces/mapAll.jsp and click "Map Category") has a lot of features. Beside just using the google map APIs to show a map with data points pulled from PS, it also dispays a list of items in a left side bar with pop up balloon details) So for one thing it has some extra features so some extra code.

Using the google map Javascript library to just display the google map on a page with data provided from your app can be simpler, you could just use the google map Javascript library APIs directly in the page.

In our case we decided to wrap that map functionality into a JSF component so that people could re-ues the functionality. It can be tricky to build a JSF component and the coding burden is placed on the component developer, but once you have a JSF component it can be easy for the page author to use the JSF component. We use the same mapping JSF components in several apps and it is alos included in some tools etc, so re-use was useful in our case. For another app, you might not need to wrap it in JSF.

Wrapping in JSF does add some extra plumbing code.

So in general, wrapping a JS library like google maps in a JSF component, can have some extra work, but some benfits as well. It depends how you plan to use the functionality, if you plan for re-use then JSF is one way to accomplish this. It imposes a certain architecture on that functionality.

Also, in terms of back end plumbing, also you do need a web request on youre server to process the request, and return a page with UI and data. We stroed the data in a database so this has some backend code as well. For example, that page displays a list of pets in that area in a left side bar, so need to persist and retrieve that data from DB. Also, google maps requires longitute and latitute, so you need to get that data too. Since we store addresses for each Item (pet info) in the DB, and google needs latitude and longitude, when we add a new address ad Item to DB, we also use yahoo geocoding service mashup to lookup cooresponding latitude and longitude and store that along with other address data, so we dont have to look it up from yahoo for each client map viewing request, instead we can just pull the info from DB along with other Item info.

So there is some necessary extra data and plumbing and coding required, even if you do not wrap it in a JSF component.

hth,

Sean

seanbrydona at 2007-7-10 2:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

Hi,

> 2. I want a clean separation of web tier and business

> tier so that these two can run on two different

> JVM's. I was not able to figure out the clear

> boundaries in case of Petstore, this is why I was

> looking for Architecture diagram.

>

In general, the model tier is encapsulated behind the modle facade, which is called CatalogFacade.java and can be found in your petstore download at \javapetstore-2.0-ea4.5\src\java\com\sun\javaee\blueprints\petstore\model\CatalogFacade.java

The CatalogFacade encapsulates all the data access and a lot of the bsuiness logic. For all the web requests that want to access the data, they should be calling this class. The servlet requests should use this class to access all the model tier functionality. The JSF managed beans also should be using it for any access to the model tier. This is one place to look if you want seperation of web tier and model tier.

In theory, you could make all of these calls into remote callls(RMI-IIOP or even web service), and move all this code to another VM

Please feel free to ask more questions.

hth,

Sean

seanbrydona at 2007-7-10 2:40:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...