300 likes | 446 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 • Orión – 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 • Modelo 1 • Modelo 1.5 • Modelo 2 • Modelo 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 responsabilities mixed. • The user state is stored in the client PC and each request is a complete transacction (Transacction 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: Navegability • 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
Aspectos Generales enArquitectura WEB • 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: • Rigth “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 clon is selected radomly. • 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 requets, 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 responsabilities should not be managed by the same class. • Current trend in web app.: • n-layers architecture • Based on the three layers model: • Presentation • Business • Presistence • 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. presistence Database access components Separation of concerns • Brown model, n-layers
Presentation layer • All around presentation logic responsabilities: • Navegability • Input data validation • Output data formatting • Internacionalization • Presentation composition. • Etc.
Business layer • Business responsabilities 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 presistence logic, like operations: • insert • delete • update • searchs • 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 shold 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 • Morover 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