Web Application System Design: Modeling and Mapping Techniques
Explore modeling techniques and mapping strategies for web application system design using UML and EJB subsystems. Learn about different types of application servers and their roles in multi-tier applications. Understand web application design principles and J2EE application scenarios for efficient development.
Web Application System Design: Modeling and Mapping Techniques
E N D
Presentation Transcript
Chapter 8 - Web Application System Design • Modeling Web Application using UML • Application Server • Web Application Design
Modeling Web Application using UML
8.1 - Modeling Web Application using UML • Modeling Web Pages • Modeling EJB
Modeling Web Pages • For web pages, the stereotypes indicate that the class is an abstraction of the logical behavior of a web page on either theclient or the server. The two abstractions are related to each other with a directional relationship between the two. Thisassociation is stereotyped as «build», since it can be said that a server page builds a client page .
Modeling EJB • Modeling EJB as a subsystem • Two approach: • Standard UML-Java Mapping • Sun JSR-000026 UML/EJB Mapping
Modeling EJB as a subsystem ICustomerMgt => CustomerHome (home interface) Icustomer => Customer (remote interface) <<subsystem proxy>>Customer =>CustomerEJB (bean class) validateCustomer() => findUser() (in home interface)
8.2 - Application Server • Application Servers • J2EE Application Servers • Web Server and Application Server
mainframe terminals terminals Application Servers • In the beginning, there was darkness and cold. Then, … Centralized, non-distributed
Application Servers • The In the 90' s, systems should be client- server
Application Servers • Today, enterprise applications use the multi-tier model
Application Servers • " The Multi- tier applications" have several independent components • An application server provides the infrastructure and services to run such applications
Application Servers • Application server products can be separated into 3 categories: • J2EE-based solutions • Non-J2EE solutions (PHP, ColdFusion, Perl, etc.) • And the Microsoft solution (ASP/COM and now .NET with ASP.NET, VB.NET, C#, etc.)
J2EE Application Servers • Major J2EE products: • BEA WebLogic • IBM WebSphere • Sun iPlanet Application Server • Oracle 9iAS • HP/Bluestone Total-e-Server • Borland AppServer • Jboss (free open source)
Web Server and Application Server App Server 1 Internet Browser Web Server(HTTP Server) HTTP(S) App Server 2
8.3 - Web Application Design • Application Layer • Business Layer • J2EE Multi-tier Model • J2EE Application Scenarios • Main Technologies • Examples • Case Study –Online Bank
J2EE Application Scenarios • Multi-tier typical application
J2EE Application Scenarios • Stand-alone client
J2EE Application Scenarios • Web-centric application
J2EE Application Scenarios • Business-to-business
Main technologies • JavaServer Pages (JSP) • Servlet • Enterprise JavaBeans (EJB) • JSPs, servlets and EJBs are application components
JSP • Used for web pages with dynamic content • Processes HTTP requests (non-blocking call-and-return) • Accepts HTML tags, special JSP tags, and scriptlets of Java code • Separates static content from presentation logic • Can be created by web designer using HTML tools
Servlet • Used for web pages with dynamic content • Processes HTTP requests (non-blocking call-and-return) • Written in Java; uses print statements to render HTML • Loaded into memory once and then called many times • Provides APIs for session management
EJB • EJBs are distributed components used to implement business logic (no UI) • Developer concentrates on business logic • Availability, scalability, security, interoperability and integrability handled by the J2EE server • Client of EJBs can be JSPs, servlets, other EJBs and external aplications • Clients see interfaces
EJB at runtime Client can be local or remote
Session Bean • Stateful session bean: • Retains conversational state (data) on behalf of an individual client • If state changed during this invocation, the same state will be available upon the following invocation • Example: shopping cart
Session Bean • Stateless session bean: • Contains no user-specific data • Business process that provides a generic service • Container can pool stateless beans • Example: shopping catalog
Entity Bean • Represents business data stored in a database ? persistent object • Underlying data is normally one row of a table • A primary key uniquely identifies each bean instance • Allows shared access from multiple clients • The Can live past the duration of client' s session • Example: shopping order
Entity Bean • Bean-managed persistence (BMP): bean developer writes JDBC code to access the database; allows better control for the developer • Container-managed persistence (CMP): container generates all JDBC code to access the database; developer has less code to write, but also less control
Message-Driven Bean • Message consumer for a JMS queue or topic • Benefits from EJB container services that are not available to standard JMS consumers • Has no home or remote interface • Example: Order processing – stock info
Examples • JSP example • Servlet example • EJB example