Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Component Diagram

 
Harish Ramchandani
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Folks,
Could you please comment on the following approach to group components in a component diagram. Should it be in tiers e.g.
1. Client-Tier package - Has two more packages
1.1 Web-UI package - has all JSP components required in application.
1.2 Java-UI package - has all Swing components required in application.
2. Web-Tier package - has two front controllers (one for Web-client and other for Java-client), common servlet filter, common Request Processor and common HTML Actions components etc.)
3. EJB-Tier package - has EJB Contoller, EJB Action and EJBs.
4. EIS-Tier package - has database and external systems.
Cheers !!!
- Harish
 
manoj pillai
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Makes sense. You could avoid putting the package around the components to avoid cluttering if you need to - just grouping and layering them should be sufficient. I feel the emphasis should be on the core J2EE components - your JSPs, Servlets and EJBs.
 
Harvey
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think your division on the packages is good enough to satisfied the marker.
 
Sanz Vai
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harish,
Can you pls explain why we need 2 front controllers? What is the diff between the two?
A request is a request no matter it is a web client or java client. Based on this request, and some mapping, it is decided which Action to perform and what actions to take place on success or failure.
Eg:
action=doThis
success=a.jsp
failture=error.jsp
In this case, how do we handle the success and failure for Swing?
 
Harish Ramchandani
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanz,
The communication protocol between Client-Tier and Web-Tier is HTTP for both types of clients. I agree that they both will use the same HTTPRequest and HTTPResponse to talk to each other. However, there is a huge difference in the way data are being passed. In the Java based client, it will be in the XML format if you are planning to use Java Web Start. We will have need to do different type of data processing based on clients. I was even thinking of writing two different Request Processors for different clients. Typically, RequestProcessor uses request.getRequestURI() method to know the URL and then fetches the Action mapping out of mapping.xml file. In Java based clients, the URL-patterns will be differnt than of HTML clients.
I hope this make sense. Any comments?
 
Sanz Vai
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harish,
Basically I agree. But couldn't we use the same Front Controller to check what kind of data has been received. If no exception is thrown while parsing the input, it is XML data and you get a DOM or JDOM document. Then just map XML nodes to attributes of a CommandObject, if non XML, map request attributes to attributes of CommandObject.
About the mapping.xml, will you have one or two of these files?
 
Harish Ramchandani
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sanz Vai:
Harish,
Basically I agree. But couldn't we use the same Front Controller to check what kind of data has been received. If no exception is thrown while parsing the input, it is XML data and you get a DOM or JDOM document. Then just map XML nodes to attributes of a CommandObject, if non XML, map request attributes to attributes of CommandObject.
About the mapping.xml, will you have one or two of these files?

It is always good practice to separate out the duties of components. In theory, we can always do all processing in just one java component but we generally don't.
I want to keep only ONE mapping.xml file and therefore, was planning to use separate RequestProcessor for Java-Client. I will have abstract RequestProcessor and two concrete RequestProcessors (One for each type of client).
Cheers !!!
Harish
http://www.harishramchandani.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic