Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

Renaud FLORQUIN

Greenhorn
+ Follow
since Mar 22, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Renaud FLORQUIN

UML 2 notation for component is a simple rectangle with a stereotype (or icon), and the rectangle with two small rectangle prongs is the UML 1.X old notation ...
See S. Ambler: http://www.agilemodeling.com/artifacts/componentDiagram.htm

Renaud
Thanks Joseph for you reply

I understand the term Web Server as HTTP Server (e.g. Apache) + Web Container (e.g. Tomcat).

I agree that putting all things in the same machine will decrease the performance but we can use load-balancer between the DMZ area and internal network and to balance the dynamic request to application server (=Web container + EJB container), in this case we can improve the global performance of the system.

In other words (and I forget the HTTP server which can be one or several small dedicated machines), if we have two machines A and B, we have two solutions:
Put the web container on A and the EJB container on B, each machine processing all requests.
or
Put the Web container and EJB container on the two machines with load balancer, each machine processing the half of requests.

About security, we can put only the HTTP server in the DMZ; the Web, EJB containers and DB are in internal network.

I totally agree about the issue of different web tiers. I will think about that ...

Renaud
I know that the deployment view (i.e. decisions like physical nodes, network, DMZ, location of the Web & EJB containers on which host) is not part of the delivery for certification part 2, but I think this aspect is very important (fundamental) for non-functional requirements like availability, performance, scalabity, security so I would like to discuss about the deployement of a typical J2EE application with a Web access.
In the component diagram, I can specify the "Tier" but the term Tier is confusing: sometimes like an application layer, sometimes like a machine ...

My fundamental question is:
Do we have to locate the Web-Container and EJB-Container on separate machine? Pros and Cons

I will try to give an answers, perhaps bad answers :-)
About performance, it is better (10x, 100x ...) to put the two containers on the same machine (local interface or application server optimization) (in spite of all EJB-Patterns to avoid netword traffic)
About security, it is better to minimize the application on DMZ, so a simple Web server for static content of the site and forwarding the dynamic request to the machine (outside the DMZ) hosting the web-container is a good approach. In this case, we split the Web server and the machine running the Web-container.
I don't know the impacts in case of Web services (?)
About scalability and availability, I don't see any difference -> we can add instance of Application server (Web-Container+EJB-Container put together) or instance of Web-tier host and EJB-tier host

Last remark (I hope I will not violate the rules of this newgroup)
I think it is harm to not require the deployement view in the project submission. It should be: 'you have a budget of xxxx $US or Euro for the hardware infrastructure, the material must come from Sun, it's a Sun certification :-), specify the deployement view (machine, network topology, ...)'

Instead of that the project statement imposes the machines: "we have chosen one ..." for Application server, Web servers and DB and there are two single points of failure in the descibed system (DB and Application server); difficult in this case to achieve the required four'9 level of availability in this situation.

Renaud
I don't understand why there is a difference between how a Web Container manages a Servlet (only one instance / one thread per request) and how a EJB Container manages a Stateless Session Bean (pool of instances).

Renaud
Perenity = duration of the support of the application
Large scale develop. = big investisment -> long term application
-> we have to take care about the stability of integrated products or technology.
From one aspect, the use of a standard (EJB is a Sun "oriented" standard) is good for stability but a "non-intrusive" technology like Spring or Hibernate is also a garantee of stability ....
The size of the application is not the only non-functional criteria to take into account to choice between J2EE "classical model" and Spring with Hibernate approach. You have to take into account the perenity, environment (knowledge of the team, current tools), support, ...
You have to manage the risk to adopt one approch or the other, and perhaps to realize a Proof of Concept (short duration project)

Unfortunately, the most influential criteria is 'political' like good relationship between an organization and product company, ...
Indeed, I just try the trial version of Software Architect and it is possible to structure a sequence diagram using "fragment". Unfortunately there is no "ref" fragment type ... with the reference to the target sequence diagram ( with input/output parameters).

Renaud
Although I saw this construction in internet (http://www.agilemodeling.com/style/sequenceDiagram.htm) and some case tools accept this, I never read this in UML standard or the Three Amigo's UML Reference Book.

So, I think it's not UML compliant; instead you can use the "ref" construction for referencing sequence diagrams within sequence diagrams. The problem is that I never see a UML Case tool supporting this construction

Renaud
When I add a message from one object to another on a sequence diagram, I ask myself how this object know the other one; sometimes the reference of the destination object comes from the flow of information (previous message), sometimes it comes from a link (association) between two objects.
It helps me to validate my model: Does my static model (structural information) give me enough information to realize the behavior.
It depends also of the level of abstraction: At architectural level it is not so easy (or helpful) to add this information.

For UML point of view, there is no constraint about the first part of the indentification (object name).

Renaud
The objectname in sequence diagram can refer to the role name of an association defined in class diagram.
For example, I have a class diagram with two class A and B, and there is an association between A and B (B plays a role in this association: 'roleB').
The sequence diagram can illustrate a scenario where a instance of A calls a service of an instance of B but not any instance of B but the 'associate' instance of B: In this case, we can specify in the sequence diagram: 'roleB:B'
It can be useful to make the link between structural diagrams and behavioural diagrams; often this link is not very clear.

Renaud

One of the EJB restrictions also is that we cannot use nonfinal static fields. Is this just for the bean classes? Can we still use static (synchronized) cache for all the bean instances if it's in a class "outside" the bean (in a different jar)? Or is a stateful (one per client) EJB the only way to build a cache?


I'm not an EJB specialist but for me a bean should not call a class with synchronized code (raison: the concurrency is controlled by the container). A stateful bean can build a cache but only for its own client (concurrent call is not allowed for a Stateful Session Bean).
Renaud
The border between architecture and design can depend on the context (knowledge, size, ... of the team). For example the detail of an architecture will differ if we have a 3-people team with limited knowledge or if the architecture is related to a large development with senior developpers.
In the context of a certification, we can't evaluate this context and we have to make assumptions.
For me an architecture should cover the global organization of an application (static/dynamic/deployment) but also give "common mechanisms" used for the development. The choice of Unique ID generation strategy can be a common mechanism.

Renaud
Thanks Tomi for your answer.
I agree with you; it is a balance between portability and performance and the performance depends on the context (# of concurrent users, transaction duration, ...).
FYI there is an article about ID generator using session bean at theServerSide.com site (http://www.theserverside.com//patterns/thread.tss?thread_id=4228).

Renaud
Thanks for your answer.
I agree with your logic but the PetStore uses the cache version of the ServiceLocator for the web tier and most of the components (inside the business tier) use the version without cache.
The cache implementation uses a synchronized map and thread synchronization is a restriction of a EJB component; so I think it is the reason of the two implementation.
Is the synchronization always required? I don't think but a book like 'Core J2EE Patterns' should discuss this type of issues instead to show how to use Service Locator for EJBHome, DataSource, JMS Topic, ... (very similar) but I didn't find :-(

Renaud

Originally posted by James J Xu:

Originally posted by Harish Ramchandani:
[QB]
Harish,
Thanks for the response.
Some use cases include alternative flows, like "Pay for Itinerary" use case has a basic flow "pay with credit card" and an alternative flow "select award travel". How could we model these in one sequence diagram?

James



The version 2.0 of UML 2.0 adds several useful concepts/notations to illustrate alternative flow, iterations, ... for sequence diagram.
Unfortunately I never see a case tool supporting the version 2.0 of UML although this release is one year old.

Renaud