tag:blogger.com,1999:blog-56798321573908941382024-03-19T02:23:52.900-07:00SCEA J2EE Enterprise ArchitectureSUN CERTIFIED ENTERPRISE ARCHITECT
SCEA EXAMS 310-051, 310-300A, 310-061Abhihttp://www.blogger.com/profile/03486192572557893099noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5679832157390894138.post-63474308462492506392008-07-21T12:07:00.001-07:002008-10-26T12:43:21.009-07:00<span style="font-family:Arial;"><br />SUN CERTIFIED ENTERPRISE ARCHITECT<br />SCEA EXAMS 310-051, 310-300A, 310-061<br /><span style="color: rgb(255, 102, 102);"><strong></strong></span><br /><a name="top">_</a><br /><strong>FBN Booking System</strong><br /><a href="#background">Background</a><br /><a href="#Objective">Objective</a><br /><a href="#Architecture">Architecture Overview</a><br /><a href="/2008/07/diagrams.html">Class Diagram</a><br /><a href="/2008/07/diagrams.html">Component Diagram</a><br /><a href="/2008/07/diagrams.html">Deployment Diagram</a><br /><a href="/2008/07/diagrams.html">Prepare Itinerary Sequence Diagram</a><br /><a href="/2008/07/diagrams.html">Price Itinerary Sequence Diagram</a><br /><a href="/2008/07/diagrams.html">Pay For Itinerary Sequence Diagram</a><br /><a href="2008/07/diagrams.html">Change Itinerary Sequence Diagram</a><br /><a href="#Assumptions">Assumptions</a><br /><a href="#State">State Management</a><br /><a href="#Authentication">Authentication/Authorization</a><br /><a href="#Persistence">Persistence</a><br /><a href="#Localization">Localization/Internationalization</a><br /><a href="#Patterns">J2EE Design Patterns</a><br /><a href="2008/07/q.html">Q&A</a><br /><br /><br /><br /><a name="background"><b><u>Background</u></b></a><br />FlyByNight, Inc. (FBN) is a regional commuter airline and uses its own travel agents for booking all airfares.<br />The current system comprises of<br /><br /><li>Cobol based Legacy System and an IMS Database accessed through 3270 screens.<br /></li><li>Credit cards processing service by Transmaster via a secured socket across a dedicated line.<br /></li><li>A Web Based Frequent Flyer Mileage (FFM) system that tracks mileage earned and used.<br /><br /><a href="#top"><i>top</i></a><br /><br /><br /><!-- Objectives --><br /><br /><a name="Objective"><b><u>Objective</u></b></a><br />The main objectives of the new system are to<br /></li><li>Provide a Web Interface for booking airfares.<br /></li><li>Replace Travel Agents' 3270 screens by a GUI.<br /></li><li>Integrate FFM system with the Travel Agents' Desktop and Web Application.<br /></li><li>Use the new Transmaster XML/RPC API.<br /></li><li>All interaction with the customer and the system must be secured with SSL.<br /><br />On the performance front, the system must be able to<br /></li><li>Handle 200,000 airfares bookings per day.<br /></li><li>Handle 20 Travel Agents and 600 web users concurrently.<br /></li><li>Keep the response time within 5 seconds for Travel Agents.<br /></li><li>Ensure that response time doesn't exceed 10 seconds more than 20%<br />of the time for web users.<br /><br /><a href="#top"><i>top</i></a><br /><br /><br /><!-- Architecture --><br /><br /><a name="Architecture"><b><u>Architecture Overview</u></b></a><br />The proposed architecture is based on J2EE. J2EE provides a stack of technologies which cover the gamut of enterprise applications like this. The J2EE platform provides all the services e.g. security, transactions and lifecycle management which simplify development of multi tier, component based and scalable systems.<br /><br />The new application will be based on J2EE Platform and make use of the following APIs:<br /></li><li><b><u>JSP/Servlets</u></b> for Web Presentation along with elements like GIFs, HTML and JavaScript.<br /></li><li><b><u>EJBs</u></b> for Business Logic and Transaction Management.<br /></li><li><b><u>JDBC</u></b> For connection to RDBMS.<br /></li><li><b><u>JavaMail</u></b> For E-mail notification.<br /></li><li><b><u>JAXP</u></b> for XML processing.<br /></li><li><b><u>Swing</u></b> For Desktop Client.<br /></li><li><b><u>I18N</u></b> API For Internationalization/Localization.<br /></li><li><b><u>Java WebStart</u></b> for Installation/Auto-Update of Desktop Client.<br /><br />The application will be based on MVC Model 2 architectural pattern.<br /><br /><a href="#top"><i>top</i></a><br /><br /><br /><!-- Assumptions --><br /><br /><a name="Assumptions"><b><u>Assumptions</u></b></a><br /></li><li>A given Itinerary is composed of Segments. Each Segment represents a flight. The traveler would select a seat on each segment.<br />e.g. Going from LAX to SEA via SFO has two segments: LAX-SFO by Flight#F1 and SFO-SEA by Flight#F2. Traveler needs a reservation on both of these segments.<br /></li><li>Unpaid Itineraries will be persisted.<br /></li><li>A seat would be counted as reserved only when the Itinerary is paid for.<br />An unpaid itinerary can still have the seat number, but it would be available for others to book. When that happens, the unpaid itinerary cannot be confirmed without selecting a new available seat. In such cases where Itinerary has become invalid, the Prepare Itinerary Use Case is initiated.<br /></li><li>The overall price of an itinerary is the sum of that of all the included Segments.<br />Every segment (source-destination) has a fixed fare for a Service Class (e.g. First, Economy, Business).<br /></li><li>Service Class would be a part of Search Criteria.<br /></li><li>The use cases do not indicate when Credit Cards are added to the profile. It is assumed that Create/Update profile use case would include that feature.<br /></li><li>The Pay For Itinerary doesn't indicate how Mileage is awarded or deducted. It only checks if there is sufficient mileage available for a new reservation. It is assumed that the mileage would be updated in the FFM Database by a separate use case not described here.<br /></li><li>When an Itinerary is changed and a Segment is deleted, its not clear where the Prepare Itinerary Use Case starts.<br />Its assumed that it would begin at alternative flights view for that source-destination airports and if already Confirmed the itinerary status would change to Unconfirmed.<br /></li><li>The FFM Relational Database Schema is known and can be directly accessed by the new system using a JDBC driver.<br /></li><li>Travel agents computers are inside the FBN Firewall and tunneling is not required for accessing EJBs.<br /></li><li>The two SUN 450 can have J2EE WebContainers. If its not the case, the web application can be co-located with the EJB Application as one EAR.<br /><br /><a href="#top"><i>top</i></a><br /><br /><br /><!-- State Management --><br /><br /><a name="State"><b><u>State Management</u></b></a><br />For the web application, session would be kept as HTTPSession, maintained in the webserver.<br />Desktop Client would maintain its own state and would access stateless EJB Services.<br />Desktop Client would also benefit from <u><b>local cache of frequently used data</b></u> which would help achieve its performance targets.<br />The other alternatives of session state being using Stateful Session Beans and Database are not recommended.<br />The majority of users are projected to be using the Web Application, so leveraging the cluster of two WebServers justifies the choice.<br /><br /><a href="#top"><i>top</i></a><br /><br /><br /><!-- Authentication --><br /><br /><a name="Authentication"><b><u>Authentication/Authorization</u></b></a><br />There are two kinds of users of the application - Travel Agents using the Desktop Client and Customers who use the web interface.<br />The Desktop application would be a J2EE Application Client, and the J2EE Client container would authenticate the travel agents.<br />Web Users will be authenticated by the container using a FORM login mechanism.<br />The J2EE platform does not standardize a mechanism to add users dynamically to applications. So there is an obvious tradeoff.<br />Container Managed Security is easier to implement and maintain but would require a container specific code to access the user directory of the server. As this will only be a small piece of code and can be developed in a pluggable way so that when the need arises, can be replaced without much impact to the application, the architecture proposes the use of Container Managed Security.<br /><br /><a href="#top"><i>top</i></a><br /><br /><br /><!-- Persistence --><br /><br /><a name="Persistence"><b><u>Persistence</u></b></a><br />The new application will make use of <b><u>CMP Entity Beans</u></b>. All Entity Beans will expose <b><u>local interfaces</u></b><br />and there relationships will be managed by Container (CMR EJB 2.1).<br /><br />Entity Beans would follow the <b><u>Composite Entity Pattern</u></b>.<br /><br />The new application will also use DAOs for searches and integration with FFM.<br /><br /><a href="#top"><i>top</i></a><br /><br /><br /><!-- Persistence --><br /><br /><a name="Localization"><b><u>Localization/Internationalization</u></b></a><br />Its common industry practice to show <b>local times</b> for Flights. As the airports could very well lie in different time zones, <b><u>I18N</u></b> APIs would be used for this translation.<br /><br /><a href="#top"><i>top</i></a><br /><br /><br /><!-- Patterns --><br /><br /><a name="Patterns"><b><u>J2EE Patterns in Use</u></b></a><br />The new architecture makes use of a number of design patterns including:<br /><br /></li><li>Composite View<br /></li><li>Front Controller<br /></li><li>Business Delegate<br /></li><li>Session Facade<br /></li><li>Composite Entity<br /></li><li>Transfer Object<br /></li><li>Data Access Object<br /><br /><a href="#top"><i>top</i></a><br /><br /></li></span>Abhihttp://www.blogger.com/profile/03486192572557893099noreply@blogger.com0tag:blogger.com,1999:blog-5679832157390894138.post-18183815600764428112008-07-21T11:37:00.000-07:002008-07-21T12:06:40.903-07:00Q&AHow does your design handle Scalability? <br />The following design aspects would help make the architecture scalable:<br /><br />Web Server Cluster<br />The proposed solution makes use of the two web-servers. These servers will be clustered and would host the web-application. A load balancer would be used to distribute traffic to these servers. This will ensure best utilization of their capacity and also make sure no server is overloaded when no of users spikes up. <br /><br />Stateless EJB<br />EJBs are the core of the proposed architecture. Stateless EJBs are container managed components and allow a limited number of instances to serve many clients thus making the application more scalable. The application server would ramp up/down the no. of instances as required. <br /><br />Hardware Vertical and Horizontal Scaling <br />As the new architecture is J2EE based which would also support horizontal scaling. If, in future, FBN decides to add another Application Server, that can be clustered with the existing server. <br /><br />DB Connection Pooling <br />JDBC database connections are both expensive to initially create and then maintain over time. As an application of this scale where users connect and disconnect frequently with applications, the application requests for data access can surge to considerable volume. Connection pooling would help reduce the overhead of creating new connections and would have a positive impact on scalability and performance. <br /><br />How does your design handle performance?<br />Connection Pool <br />Connection pooling can improve the response time of any application that requires connections, especially Web-based applications. DAO Flight Search would undeoubtedly be the most frequently function of the system. In order to make it fast, DAOs are proposed. DAOs would give us the liberty of Query Optimization which can greatly enhance performance. This is in contrast to CMP Entity Beans where queries are generated by the Container. The other option that was considered was using BMP Entity Beans with DAOs, however, for searches we have avoided entity bean altogether and called Search DAOs from Stateless Session Beans. <br /><br />Entity Beans <br />The new architecture proposes a mix of Entity Beans and DAOs. DAOs will be used for Searches whereas EntityBeans will be used for Itinerary and Profile Management. The benefit of Entity Beans can be leveraged in this case as it will not only make the development easier but also lifecycle/transaction management by the container would be more efficient. <br /><br />Caching <br />Using ServiceLocators with Caching strategy would help minimize resource lookups. Frequently Used Data will be cached for the FatClient. <br /><br />Local Interfaces <br />All EJBs are colocated and will use Local Interfaces. This will reduce the network overhead. <br /><br />How does your design handle security?<br />For all internet communication, HTTPS will be used. Apart from that a DMZ would be created around the servers hosting the application. Also, travel agents nodes will be inside the network firewall. <br /><br />How does your design handle Availability? <br />There is only one application server and two web servers. The availability is reduced as the app server is a single point of failure. However, the cluster of webservers would help keep at least one of the servers alive so the application would be up and running even if one of the webservers goes down. <br /><br />How does your design handle Extensibility? <br />Extensibility is achieved by Low coupling, interfaces and encapsulation. The new application follows industry standard design patterns and strategies, makes use of components and employs interfaces for all external systems. This would ensure that the impact on the application would be minimal when it comes to enhancing/adapting it to changes. <br /><br />How does your design handle Maintainability? <br />Low coupling, modularity, documentation <br /><br />How does your design support session/state handling? <br />For the web application, session would be kept as HTTPSession, maintained in the webserver. Desktop Client would maintain its own state and would access stateless EJB Services. Desktop Client would also benefit from local cache of frequently used data which would help achieve its performance targets. The other alternatives of session state being using Stateful Session Beans and Database are not recommended. The majority of users are projected to be using the Web Application, so leveraging the cluster of two WebServers justifies the choice. <br /><br />How does your design handle persistence? <br />The new application will make use of CMP Entity Beans. All Entity Beans will expose local interfaces and there relationships will be managed by Container (CMR EJB 2.1). Entity Beans would follow the Composite Entity Pattern. The new application will also use DAOs for searches and integration with FFM. <br /><br />How does your client tier talk to business tier? <br />Both Web and Desktop Applications make use of services exposed by EJBs. The Business Delegate pattern is applied to ensure low-coupling between client and business tier. The business delegate in turn uses a Service Locator for looking up EJBs. The communication protocol is RMI/IIOP. <br /><br />How does your design handle transactions? <br />EJBs are the core of the new application. The architecture proposes use of Container Managed (declarative) Transacations. This not only keeps the code clean and maintainable but also ensures that ACID requirements are satisfied without the developer coding for it. This is one of the biggest advantage of using EJBs. <br /><br />How does your design handle authentication and authorization? <br />There are two kinds of users of the application - Travel Agents using the Desktop Client and Customers who use the web interface. The Desktop application would be a J2EE Application Client, and the J2EE Client container would authenticate the travel agents. Web Users will be authenticated by the container using a FORM login mechanism. The J2EE platform does not standardize a mechanism to add users dynamically to applications. So there is an obvious trade-off. Container Managed Security is easier to implement and maintain but would require a container specific code to access the user directory of the server. As this will only be a small piece of code and can be developed in a pluggable way so that when the need arises, can be replaced without much impact to the application, the architecture proposes the use of Container Managed Security.Abhihttp://www.blogger.com/profile/03486192572557893099noreply@blogger.com0tag:blogger.com,1999:blog-5679832157390894138.post-83156901950430962342008-07-20T14:12:00.001-07:002008-07-21T11:30:02.020-07:00Diagrams<span style="font-weight: bold;">Deployment Diagram<br /></span><br /><a href="http://bp1.blogger.com/_1bCfz759OG4/SIOquphmm1I/AAAAAAAAAUk/zh7Wv2Tm1AY/s1600-h/deploymentdiagram.jpg"><img id="BLOGGER_PHOTO_ID_5225207711077407570" style="margin: 0px 10px 10px 0px; float: left;" alt="" src="http://bp1.blogger.com/_1bCfz759OG4/SIOquphmm1I/AAAAAAAAAUk/zh7Wv2Tm1AY/s320/deploymentdiagram.jpg" border="0" /></a><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;"><br /><br /><br /><br /><br />Class Diagram<br /></span><br /><a href="http://bp0.blogger.com/_1bCfz759OG4/SIOqf9T83OI/AAAAAAAAAUE/u0bR7RylHEw/s1600-h/classdiagram.jpg"><img id="BLOGGER_PHOTO_ID_5225207458690817250" style="margin: 0px 10px 10px 0px; float: left;" alt="" src="http://bp0.blogger.com/_1bCfz759OG4/SIOqf9T83OI/AAAAAAAAAUE/u0bR7RylHEw/s320/classdiagram.jpg" border="0" /></a><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;"><br /><br /><br /><br /><br /><br />Component Diagram<br /></span><br /><a href="http://bp1.blogger.com/_1bCfz759OG4/SIOqgHj8wNI/AAAAAAAAAUM/JjspRgIgTU4/s1600-h/componentdiagram.jpg"><img id="BLOGGER_PHOTO_ID_5225207461442273490" style="margin: 0px 10px 10px 0px; float: left;" alt="" src="http://bp1.blogger.com/_1bCfz759OG4/SIOqgHj8wNI/AAAAAAAAAUM/JjspRgIgTU4/s320/componentdiagram.jpg" border="0" /></a><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;"><br /><br /><br /><br /><br /><br />Prepare Itinerary Sequence Diagram<br /></span><br /><a href="http://bp2.blogger.com/_1bCfz759OG4/SIOqvaaMyDI/AAAAAAAAAU0/mPJAq5AyC7w/s1600-h/prepareitinerary.jpg"><img id="BLOGGER_PHOTO_ID_5225207724199692338" style="margin: 0px 10px 10px 0px; float: left;" alt="" src="http://bp2.blogger.com/_1bCfz759OG4/SIOqvaaMyDI/AAAAAAAAAU0/mPJAq5AyC7w/s320/prepareitinerary.jpg" border="0" /></a><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;"><br /><br /><br /><br /><br /><br /><br /><br /><br />Price Itinerary Sequence Diagram<br /></span><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE5dnNVpdg0ZHggPMEZWRCYzvp8AZyQvRaO8mOONFhRW3YhajSjd2o2Es2t1vhLfAw0Wic9gQlp9OMoWJcVVbcdGiqslfggerQJON5Ue_tVRoX6CLsNEUxkCxDnjR13-Pz5a6Rr2KlGIj6/s1600-h/priceitinerary.jpg"><img id="BLOGGER_PHOTO_ID_5225207724092343426" style="margin: 0px 10px 10px 0px; float: left;" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE5dnNVpdg0ZHggPMEZWRCYzvp8AZyQvRaO8mOONFhRW3YhajSjd2o2Es2t1vhLfAw0Wic9gQlp9OMoWJcVVbcdGiqslfggerQJON5Ue_tVRoX6CLsNEUxkCxDnjR13-Pz5a6Rr2KlGIj6/s320/priceitinerary.jpg" border="0" /></a><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;"><br /><br /><br /><br /><br /><br /><br /><br />Change Itinerary Sequence Diagram<br /></span><br /><a href="http://bp1.blogger.com/_1bCfz759OG4/SIOqf7ZdeKI/AAAAAAAAAT8/0bsXY1wWObg/s1600-h/changeitinerary.jpg"><img id="BLOGGER_PHOTO_ID_5225207458177054882" style="margin: 0px 10px 10px 0px; float: left;" alt="" src="http://bp1.blogger.com/_1bCfz759OG4/SIOqf7ZdeKI/AAAAAAAAAT8/0bsXY1wWObg/s320/changeitinerary.jpg" border="0" /></a><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;"><br /><br /><br /><br /><br /><br /><br /><br />Pay for Itinerary Sequence Diagram<br /></span><br /><a href="http://bp1.blogger.com/_1bCfz759OG4/SIOqgmKKW1I/AAAAAAAAAUc/cVWrlGiCzro/s1600-h/payforitinerary.jpg"><img id="BLOGGER_PHOTO_ID_5225207469655612242" style="margin: 0px 10px 10px 0px; float: left;" alt="" src="http://bp1.blogger.com/_1bCfz759OG4/SIOqgmKKW1I/AAAAAAAAAUc/cVWrlGiCzro/s320/payforitinerary.jpg" border="0" /></a>Abhihttp://www.blogger.com/profile/03486192572557893099noreply@blogger.com0