Web Application Architectures - STI Innsbruck

Transcription

4/23/2013Web EngineeringWeb ApplicationArchitectures Copyright 2013 Ioan Toma & Srdjan Komazec1Where we are?#DateTitle15th MarchWeb Engineering Introduction and Overview212th MarchRequirements Engineering for Web Applications319th MarchWeb Application Modeling49th AprilWeb Application Architectures516th AprilDeveloping Applications with WebML623rd AprilTesting and Usability of Web Applications730th AprilMaintenance and Performance of Web Applications87th MayWeb Technologies I914th MayWeb Technologies II1021st MayWeb Application Development Process1128th MayProject Management for Web Applications124th JuneWeb Application Security1311thMobile Application Development I1418th JuneMobile Application Development II1425th JuneFinal ExamJune21

4/23/2013Overview Web Application Architectures– Introduction Software architecturesArchitectures developmentPatterns and frameworksSpecifics of Web applications– Web Application Architectures Architecture typesMVC, Client-Server, N-Layer, JSP Model 1 and 2, Apache StrutsSummary3What is an architecture?INTRODUCTION42

4/23/2013Software Architectures “Architecture is defined [.] as the fundamental organization of asystem, embodied in its components, their relationships to each otherand the environment, and the principles governing its design andevolution.”(IEEE Architecture Working Group, P1471, 1999) Architectures describe structure– Components of software systems, their interfaces and relationships– Static as well as dynamic aspects– Blueprint of software system Architectures connect software development phases– Requirements mapped iteratively to components and their relationships5Software Architectures “Architecture is the set of design decisions [.] that keeps itsimplementers and maintainers from exercising needlesscreativity.”(Desmond F. D’Souza and Alan C. Wills, 1999) Architectures describe different viewpoints–––– conceptual view: entities of application domain and their relationshipsprocess view: system runs, concurrency, synchronizationimplementation view: software artifacts (subsystems, components, source code)runtime view: components at runtime and their communicationArchitectures make systems comprehensible and controllable– structuring according to different viewpoints– enables communication between different stakeholders63

4/23/2013Developing ArchitecturesInfluences on ArchitecturesFunctional Requirements Clients Users Other StakeholdersArchitectureNon-Functional Requirements Performance Scalability Reusability Other?7Developing ArchitecturesInfluences on ArchitecturesTechnical Aspects Operating System Middleware Legacy Systems Other?ArchitectureExperience with Existing Architecture Patterns Project Management Other?84

4/23/2013Developing Architectures Remember, requirements are always subject to change– Organizational & environment changes– Ambiguous requirements initially Thus, iterative approaches are the suggested means of development– Pro: Helps to mitigate design risks– Caution: Doesn’t guarantee a good architecture9Patterns & Frameworks Patterns describe recurring design problems 3 types of patterns– Architecture patterns (e.g. MVC)– Design patterns (e.g. Publisher-Subscriber)– Idioms (e.g. Counted-Pointer in C ) They are a guideline, implementation must be grounded to the specificproblem Patterns need to be “integrated” amongst each other!105

4/23/2013Patterns & Frameworks Frameworks: another option to reuse existing architecture– Something that provides you a frame to be filled! Reuse of existing software objects that just need to be properlyconfigured Bound to a specific technology– Require training– High cost of switch– Level of customization not always acceptable11Specifics of Web apps High quality demands––––– nceBroad range of technical solutions that can be integrated.– Hard to evaluate quality demands (various components)– Hard to solve (where is the problem?)126

4/23/2013Specifics of Web apps Inhomogeneity and immaturity of technical solutions– Fast product lifecycles– Many components: open source – quality?– Lack of standards Global requirements– Multi linguality– Cultural adaptation? E.g. Google for Korea13WEB APPLICATIONARCHITECTURES147

4/23/2013Architecture Types Layering Aspect– “Separation of concerns”– How many concurrent users are you serving?– Shared needs among multiple applications? (e.g., security) Data Aspect– What kind(s) of data are you delivering? Structured vs. non-structuredOn-demand vs. real-time– What are the bandwidth requirements? Size & nature of dataAgain, audience concerns15Architecture Types Web Platform Architecture (WPA)– Platform Infrastructure HardwareSoftware modules & configurationsChoice of software platform (e.g., J2EE, .NET)Web Application Architecture (WAA)– Conceptual view of how key business processes and needs are separated &implemented– Often domain-specific– Greater complexity requires greater modularity168

4/23/2013Example of a WAAWeb ApplicationPresentationPersonalizationBusiness LogicSecurityData ManagementSearch17Generic Web (Platform) Architecture The Web “platform” is based on– TCP/IP– HTTP– HTML It’s essentially a Client/Server architecture!– In term of patterns one of the simplest ones But still things can get complex – Components on the network (firewall, proxy, load balancer)– Components in the intranet (Web server, application server, data base, legacysystems, web services)189

4/23/2013Model View Controller Architectural Pattern from Smalltalk (1979)Decouples data and presentationEases the development19Model View Controller Model–––– View–––– encapsulate application stateresponds to state queriesexposes application functionalitynotifies views of changesrenders the modelsrequests updates from modelssends user interaction to controllerallows controller to select viewController––––defines application behaviormaps user actions to model updatesselects view for responseone for each functionality2010

4/23/2013Web Architectures: Specifics Technological constraints– HTTPBroad variety of technical solutions––application servers, proxies, firewalls, legacy applicationschecking of quality difficult –improvement of quality difficult e.g., code performance may not change overall performance substantiallyTechnical solutions inhomogeneous and immature––– e.g., performance depends on various components, like database, network bandwidth, processor,memory, code, short product life cyclesmissing standards impede component integration from different manufacturesmany solutions are open source: continuity of development, extendibility, Global access to Web applications–internationalization, cultural differences21Model-View-Controller 2 (MVC 2) Adaptation of MVC for the Web– stateless connection between the client and the server– notification of view changes– re-querying the server to discover modification of application’s state2211

4/23/2013Client/Server (2-Layer)ClientClientServerWeb/App ServerServicesDatabaseDynamic HTMLStatic HTML23N-Layer ArchitecturesClientFirewallProxyWeb ServerPresentation LayerBusiness LayerApplication Server(Business Logic, Connectors,Personalization, Data Access)Backend(Legacy Application,Enterprise Info System)Data LayerDBMSB2B2412

4/23/2013Why an N-Layer Architecture? Separating services in business layer promotes re-use amongapplications– Loose-coupling – changes reduce impact on overall system.– More maintainable (in terms of code)– More extensible (modular) Trade-offs– Needless complexity– More points of failure25JSP-Model-1 Architecture2613

4/23/2013JSP-Model-2 Architecture1. user request2. create/change model3. create/change view4. generate output5. server response27Apache Struts ArchitectureEnhances the JSP model 21. user request2. forwarding to controller3. Selecting model in form ofJava bean4. Selecting view to representcontents5. generate output6. server responsehttp://struts.apache.org/2814

4/23/2013WRAP-UP29Things to keep in mind(or summary) Good design of architecture is crucial You can leverage on patterns and frameworks– Both have advantages and disadvantages Design is constrained on Web “infrastructure” MVC is the most commonly used pattern3015

4/23/2013Bibliography Mandatory reading– Kappel, G., Proll, B. Reich, S. & Retschitzegger, W. (2006). Web Engineering, Wiley &Sons. 4th Chapter Web links–Model-View-Controller troller31Next Lecture#DateTitle15th MarchWeb Engineering Introduction and Overview212th MarchRequirements Engineering for Web Applications319th MarchWeb Application Modeling49th AprilWeb Application Architectures516th AprilDeveloping Applications with WebML623rd AprilTesting and Usability of Web Applications730th AprilMaintenance and Performance of Web Applications87thWeb Technologies I914th May1021st MayWeb Application Development Process1128th MayProject Management for Web Applications124th JuneWeb Application Security1311thMobile Application Development I1418th JuneMobile Application Development II1425th JuneFinal ExamMayJuneWeb Technologies II3216

4/23/2013Questions?3317

Architecture Types Web Platform Architecture (WPA) - Platform Infrastructure Hardware Software modules & configurations Choice of software platform (e.g., J2EE, .NET) Web Application Architecture (WAA) - Conceptual view of how key business processes and needs are separated & implemented - Often domain-specific