290 likes | 469 Views
Web Architecture. Introduction. Architecture concept in software development From the point of the Unified Process … Physical architecture Computational nodes distribution over the network Software component-computational node mapping Modern architecture concept…
E N D
Introduction • Architecture concept in software development • From the point of the Unified Process … • Physical architecture • Computational nodes distribution over the network • Software component-computational node mapping • Modern architecture concept… • Architectural design patterns • Separation of concerns • There is no way to represent the software architecture with current tools (UP-UML)
Java Web Applications Propagation • Strong support from software producers: • Sun Microsystems. JEE • BEA Systems, Weblogic • IBM, WebSphere • Netscape (Sun): iPlanet • Orion – Oc4J Oracle 9IAS • And Strong support from the open source world! • www.apache.org Development of the apache web server, the most used in the world. • Jakarta.apache.org. Frameworks and support classes to support server side web apps development over JEE. • www.jboss.org EJB Container.
Architectural Models Evolution • Model 1 • Model 1.5 • Model 2 • Model 2X Servlets/JSPs MVC Model Multichannel
Script CGI Browser Database Architectural model 1 CGI Applications • The most primitive ones. • CGI Web apps. • Presentation, business and persistence responsibilities mixed. • The user state is stored in the client PC and each request is a complete transaction (Transaction Script)
Architectural model 1.5JSP & Servlets • Separation of responsabilities: • JSPs for the presentation logic (Navegability, rendering, etc.) • Embedded Beans implement business and persistence responsabilities.
Architectural model 2MVC • Evolution of the 1.5 model • It incorporates the MVC pattern. • Controller: Navigability • Business and Persistence: Beans • Presentation: JSPs
Architectural model 2MVC with Struts • Struts the reference implementation of the MVC that apache provides to implement web apps. • http://www.apache.org/struts
Architectural model 2XMultichannel Applications • Evolution of the model 2 to build multichannel applications • Reference implementation: STXX • http://stxx.sourceforge.net/ • XML & XSLTs based solutions
General Aspects in Web Architecture • Scalability • Separation of Concerns • Portability • “Componentize” support services • User session management, entity caching • Design patterns use
Scalability¿Importance? • Main characteristic of Web applications: • Possible fast increasing of the number of users. • It’s important: • Right “sizing” of the system • Adaptability of the system when the demand increases. • Options: • Horizontal scalability • Vertical scalability • Cluster of Servers
Balancer Horizontal Scalability • We clone the system and balance the load System System Internet users System System
Horizontal Scalability. HW Balancer • Selects the target machine for the HTTP request based on pre-configured algorithms (Round Robin, LRU, etc.) • So, the clone is selected randomly. • Problem: No warranty that different request from the same user served by the same machine. -> There is no session maintenance in the server -> determines the design! • Session must be managed by the developer explicitly by: • Cookies • Database • It’s HW-> It’s FAST!
Horizontal Scalability. SW Balancer • They examine the request at HTTP level to guarantee user session maintenance. • Different requests from the same user are managed by the same server. • Slower then HW balancers • Cheap solutions • Ex., mod mod_jk for apache.
Horizontal Scalability. HTTP HW Balancer • HW devices that examines the request at HTTP level. • In the middle of the other ones. • Warranty of session maintenance. • Faster than SWB but slower than HWB.
Complete System Machine Layer 1 Layer 2 Layer n Machine 1 Machine 1 Machine 1 VerticalScalability • We implement logic separation of layers in a way that we can separate them physically. • We need a kind of Middleware to allow remote invocation
Scalability with Cluster of Serves • Common in the commercial Application Servers (Weblogic, WebSphere, iPlanet, etc.). • It can be defined as horizontal or vertical. • Distributes and scale the system transparently to user and administrator. • Guarantees that regardless of which server process the request, it will have access to the session of the user. (Session replication) • Session replication is costly and can decrease system performance.
Separation of concerns • Base idea for the layer separation • Different responsibilities should not be managed by the same class. • Current trend in web app.: • n-layers architecture • Based on the three layers model: • Presentation • Business • Persistence • Independence between layers
presentation JSPs, HTML, presentation logic business Business processes and logic. persistence Database access components Separation of concerns • 3 layers architecture
presentation JSPs, HTML, presentation logic business Business processes and logic. persistence Database access components Separation of concerns • Brown model, n-layers
Presentation layer • All around presentation logic responsibilities: • Navigability • Input data validation • Output data formatting • Internationalization • Presentation composition. • Etc.
Business layer • Business responsibilities or logic • It’s the result of the functional analysis: • The set of business rules obtained from the real world analysis.. • Must be independent of other layers
Persistence layer • Anything related with persistence logic, like operations: • insert • delete • update • searches • Etc. • Not always based on relational databases.
Portability • An application should be able to be adapted to different physical deploying environments. • The task of adapting to a new deploying environments should be reduced to configuration task. • Example: Customer that doesn't want to be forced to use EJB components.
“Componentize” support services • ¿support or infrastructure services?: Domain independent components • ¿Breaking separation of layers? • Form the infrastructure layer • Ex.: • Log service • Pool JDBC • Configuration Service • Authorization service • Etc.
User Session Management • Very Delicate Aspect! • Entity caching in • Httpsession object • Application Context • Information expiration • Data refresh • System performance? We are using server resources!
Design patterns use • What is a design pattern? • GOF 94 Design Patterns • Moreover of being an standard solution, they are a communication tool! • Gets software development faster • Turns maintenance easier. • Starting to be integrated in the CASE tools(Rose, Together, etc.).
Thanks!!! ¿? Dr. Daniel Fernández Lanvin University of Oviedo