Happy Tree Friends World Village Software Architecture Document Version 1.1 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Revision History Date Version Description Author 10/03/2009 1.0 Architectural Representation, Implementation View Zhenya Renhart 10/03/2009 1.0 Vikash Raunyiar 14/03/2009 1.0 Architectural Goals and Constraints, Use Case View Quality, Size, Deployment View 15/03/2009 1.0 Introduction, Logical View Mohsen Anvaari 30/03/2009 1.0 Editing quality and size parts Najam Nazar 31/03/2009 1.0 Editing Architectural Representation, Implementation View Zhenya Renhart 3/04/2009 1.0 Editing Architectural Goals and Constraints, Use Case View Vikash Raunyiar 4/04/2009 1.0 Editing Indroduction, Logical View Mohsen Anvaari 17/04/2009 1.1 Editing Logical View Mohsen Anvaari 24/04/2009 1.1 Add package role’s descriptions Zhenya Renhart 27/04/2009 1.1 Editing Logical View Mohsen Anvaari Happy Tree Friends, 2016 Najam Nazar Page 2 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Table of Contents 1. Introduction 5 1.1 1.2 1.3 1.4 1.5 5 5 5 5 5 Purpose Scope Definitions, Acronyms, and Abbreviations References Overview 2. Architectural Representation 6 3. Architectural Goals and Constraints 6 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 6 6 7 7 7 7 7 7 7 7 7 7 8 4. Technical Platform Security Usability Availability Accessibility Capacity Suitability Scalability Operability Fault tolerance Recoverability Changeability Stability Use-Case View 9 User Management 10 Announcement management 11 Ecopark 12 Entertainment (music, video, movie and picture) 13 5. 14 Logical View 5.1 5.2 Overview Architecturally Significant Design Packages 14 Error! Bookmark not defined. 6. Deployment View 16 7. Implementation View 16 7.1 7.2 16 18 18 18 18 19 Overview Layers 7.2.1 Presentation Layer 7.2.2 HTML Prototypes Layer 7.2.3 Control Layer 7.2.4 Web Configuration Layer Happy Tree Friends, 2016 Page 3 of 21 World Village Software Architecture Document 7.2.5 7.2.6 7.2.7 7.2.8 7.2.9 7.2.10 Version: 1.1 Date: 27/04/2009 Business Logic Layer Entities layer Hibernate Configuration Layer Database Access Layer Common Elements Layer Database Layer 19 19 19 19 20 20 8. Size and Performance 20 9. Quality 20 Happy Tree Friends, 2016 Page 4 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Software Architecture Document 1. Introduction 1.1 Purpose This document provides a comprehensive architectural overview of the World Village Web Application, using a number of different architectural views to depict different aspects of the system. It is intended to capture and convey the significant architectural decisions which have been made on the system. In order to depict the software as accurately as possible, the structure of this document is based on the “4+1” model view of architecture [1]. 1.2 Scope The scope of this document is to describe the architecture of the World Village application and some examples to show how this architecture should be applied in design phase. 1.3 Definitions, Acronyms, and Abbreviations RUP: Rational Unified Process UML: Unified Modeling Language SAD: Software Architecture Document 1.4 References [1] Philippe Kruchten, The “4+1” view model of software architecture, November 1995, http://www3.software.ibm.com/ibmdl/pub/software/rational/web/whitepapers/2003/Pbk4p1.pdf [2] Use Cases Document of World Village Project [3] Yoshi Lounge, N-tier Web Applications Using ASP.Net, 11 June 2008 [4] YummiSAD: Software Architecture Document of Yummy Inc : Online Catering Service 1.0 1.5 Overview This document contains following sections to document all aspects of the system architecture: Section “Architectural Representation” describes the use of each view. Section “Architectural Goals and Constraints” describes the architectural constraints of the system. Section “Use Case View” describes the most important use cases of the system. Section “Logical View” describes the layers and subsystems of the application and how design elements should be set on those layers. Happy Tree Friends, 2016 Page 5 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Section “Implementation View” describes the decomposition of the software into layers and implementation subsystems in the implementation model. Section “Deployment View” describes how the system will be deployed. Section “Size and Performance” describes any performance issues and constraints. Section “Quality” describes any aspects related to the quality of service (QoS) attributes. 2. Architectural Representation This document details the architecture using the views defined in the “4+1” model [KRU41] which are applicable for World Village project. For the names of views RUP naming convention is used. Here is the list of views used to document the World Village Project. Use Case view Audience: whole project team and stakeholders Area: describes the set of use cases that represent some significant, central functionality of the system Related Artifacts: Use-Case document Logical view Audience: designers Area: defines overall candidate architecture, describes the most important use-case realizations. Related Artifacts: design model Implementation view Audience: programmers Area: software components: describes the layers and subsystems of the application. Related Artifacts: implementation model, software components Deployment view Audience: deployment managers Area: describes the mapping of the software onto the hardware Related Artifacts: deployment model 3. Architectural Goals and Constraints This section describes the software requirements and objectives that have some significant impact on the architecture. 3.1 Technical Platform The World Village project will be deployed onto a J2EE application server and MySql server for database. We will use following programming language tools and data bases: Struts 2, JSP, AJAX, HTML, and CSS Presentation layer Hibernate Data access layer MySql Data base layer 3.2 Security World Village system must protect information and data, so that unauthorized users or systems cannot read or modify them. For logging in to the website, users need to register first then system will check authentication with username and password whenever users want to log in. It must be handles that all the user information is highly secure as possible. Happy Tree Friends, 2016 Page 6 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 3.3 Usability The World Village system features should be considered in a way to be easy to use. Users just need to log in, and use website features. Website will also contain user manual to help users. The language of site should be international because the users are from different countries. 3.4 Availability The World Village website must be up and running 24/7/365 and it must be available when accessed by diverse browsers. 3.5 Accessibility The World Village website must be easy to access by as many users as possible. 3.6 Capacity System will give limited space to users for upload their files (movies, sounds, pictures, workshop materials and so on). System will not have limited number for online users. 3.7 Suitability The suitability for World Village system is the capability to provide an appropriate set of functions for specified system goals and user needs. 3.8 Scalability The World Village website should provide enough scalability to deal with thousands or millions of activities performing at the same time by several users. It must be prepared to grow quickly both in terms of number of users serviced and in terms of functions offered. 3.9 Operability The system should have capability to enable the users to operate and control it. The website should not place undue burdens on users, for example, requiring special browser versions. 3.10 Fault tolerance The World Village system should be fault tolerant to maintain a specified level of performance in cases of happening faults and do not let the crash of whole system. 3.11 Recoverability To support the recoverability the World Village system should be able to re-establish a specified level of performance and recover the data directly affected in the case of a failure. 3.12 Changeability The changeability for World Village system is the capability to enable a specified modification to be implemented. Happy Tree Friends, 2016 Page 7 of 21 World Village Software Architecture Document 3.13 Version: 1.1 Date: 27/04/2009 Stability The World Village system design should provide the maintainability that is the capability of a product to be modified, and to avoid unexpected effects from modifications. Modifications may include corrections, improvements, or adaptation of the website to changes in requirements and functional specifications. Happy Tree Friends, 2016 Page 8 of 21 World Village Software Architecture Document 4. Version: 1.1 Date: 27/04/2009 Use-Case View For World village project three groups of users are defined: - Casual user (any user surfing the internet) - Registered user (registered member of the system) - Administrator (administrator of the system) In the use case diagrams below some more roles can be appeared according to different scenarios, but the system will know only about the main three roles. The diagram below shows interconnections between different sets of features of the system. Lines indicate that one subset of features users another World Village User Management Virtual tour Casual user Job Upload Management Entertainment Registered user Ecopark Administrator Announcement Management Education Calendar City Information World Village information Forum Happy Tree Friends, 2016 Page 9 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 We considered mainly five significant features of our world village project to design and implement, these are as follows: 1. 2. 3. 4. 5. User Management Announcement Management Upload Management Ecopark and Entertainment User Management Figure 1: User management Happy Tree Friends, 2016 Page 10 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Announcement management <include> Modify Announcement Reset <include> <include> <include> Create Announcement Cancel with confirmation Remove Announcement Register User View Announcement Search Announcement Casual User Administrator Registration for Participating Figure 2: Announcement management Happy Tree Friends, 2016 Page 11 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Ecopark Reset Cancel with Confirmation <<Includet>> <<Include>> Create Ecopark Event <<Include>> <<Include>> Modify Ecopark Event Casual User Registered User View Ecopark Event Administrator Announce Event Upload Material Search Ecopark Event Figure 3: Ecopark Happy Tree Friends, 2016 Page 12 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Entertainment (music, video, movie and picture) Entertainment Search files Filter files Registered user Casual user View file Link to upload material Add comment Figure 4: Entertainment For more details of each use case scenarios: Use the “Use Case Document” of World Village Project. Happy Tree Friends, 2016 Page 13 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 5. Logical View 5.1 Overview The World Village web application is divided into layers based on N-tier architecture: The dependencies of architectural layers will be explained and shown in Deployment View section. Now we will describe responsibility of each layer and its significant packages: Presentation Layer: This is a front-end component, which is responsible for providing portable presentation logic. This layer works with the results/output of the business logic layer and transforms the results into something usable and readable by the end user. [3] o Model: This component holds the data, which should be displayed to the user or which the user enters. It also interacts with business logic layer. o View: Displays the model on the screen. o Controller: Responds to user input by modifying the model. It sends requests to model when user performs some activities on the page. Happy Tree Friends, 2016 Page 14 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Business Logic Layer: Allows users to share and control business logic by isolating it from the other layers of the application. The business layer functions between the presentation layer and data access layer, sending the client's data requests to the database layer through the data access layer. [3] o Data Manager: This component encapsulates the business logic of the application. It works with entities or objects containing information of what is needed from database. It is responsible for forming these objects and sending them to data access layer. Data Access Layer: Provides access to the database by executing a set of SQL statements or stored procedures. As the name suggests, the data access layer contains no business rules or data manipulation/transformation logic. It is merely a reusable interface to the database. [3] o ORM: This component is responsible for generating SQL requests from objects it gets from business logic layer. SQL requests are sent to database and then the response is converted to entities. Database Layer: Provides the mechanism to store and retrieve data. [3] Common Layer: o Entities: These are domain objects that contain their properties and relationships between each other. These objects are used by all layers. Presentation layer may use them as model representation. Business logic layer will work with them to perform business logic operations. And finally, data access layer (ORM) maps entities to the database. Figure below shows Architecture Analysis Model Overview of the system. User Interface Package corresponds to Presentation Layer, Controller relates to Business Logic Layer, Data Access Package corresponds to Data Access Layer and Database relates to Database Layer. Entity package is in common section of architecture. Happy Tree Friends, 2016 Page 15 of 21 World Village Software Architecture Document 6. Version: 1.1 Date: 27/04/2009 Deployment View Internet Browser 7. Implementation View 7.1 Overview Web Server Database Server The implementation view depicts the physical composition of the implementation in terms of Implementation Subsystems, and Implementation Elements (directories and files, including source code, data, and executable files). Unlike logical view it is dependent on technology. The programming language is Java. Also the technologies and frameworks will be used: Presentation layer – JSP, JavaScript, CSS, Ajax, Html, Struts 2 (tegs) Business logic layer – Struts 2, Xml (for configuration) Data access layer – Hibernate, Xml (for configuration) Database layer – SQL (on MySql server) The layers of the implementation view fit the layering defined in the Logical view in the following way: 1. Presentation tier in logical view (orange) is split into presentation layer, which contains JSP pages and HTML prototypes with only html code. Html prototypes will not be part of final products, but helps to split work between different developers. 2. Business logic tire (blue) defined in logical view is split into two layers in implementation view – control and business logic layers. Control layer serves as an interface between presentation tier and business logic tier. Business logic layer includes business logic itself. 3. Data access tier (green) was split into hibernate configuration layer, which only makes mapping between entities and database, and database access layer. 4. Common elements layer (yellow) was split into web configuration layer, common elements layer and entities. Web configuration layer includes configuration for connecting presentation and control layers, which, apart from configuration are independent. Common elements layer includes entities, logging, as in logical view, but also some elements containing common functionality. Entities layer contains entities, as name suggests. 5. DB layer corresponds to DB layer in logical view. The diagram below shows relations between layers. The connections specify that one layer uses another, or we could say one layer knows about another. This diagram gives understanding of dependence between subsystems (layers). For example we can see that entities layer, html prototype layer and database layer are absolutely independent from others. This means that each of them can be easily used in different system and can be Happy Tree Friends, 2016 Page 16 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 developed by independent developer. In this way this dependencies can be a guide of how to divide work between developers. Also the diagram can be a hint of the sequence of developing. For example it is clear that most subsystems need entities, so developing them must be number one priority. Entities HTML Prototypes Presentation Layer Control Layer Web Configuration Layer Hibernate Configuration Layer Business Logic Layer Database Access Layer DB Layer Common Elements Layer The diagram below shows overall package hierarchy. ituniv.htf.wv.presentation.jsp ituniv.htf.wv.presentation ituniv.htf.wv.actions src ituniv.htf.wv ituniv.htf.wv.presentation.js ituniv.htf.wv.presentation.css ituniv.htf.wv.model ituniv.htf.wv.db.dao ituniv.htf.wv.db ituniv.htf.wv.db.hibernate ituniv.htf.wv.util WEB-INF lib For more details see detailed layers description. Happy Tree Friends, 2016 Page 17 of 21 World Village Software Architecture Document 7.2 Version: 1.1 Date: 27/04/2009 Layers 7.2.1 Presentation Layer The Presentation layer contains all the components needed to allow interactions with an end-user and a controller. It encompasses the user interface. According to Logical view this layer is part of presentation tire. JSP pages, js (JavaScript) and css (Style sheets) are included here. The diagram shows package hierarchy. ituniv.htf.wv.presentation.jsp.user ituniv.htf.wv.presentation.jsp.entertainment ituniv.htf.wv.presentation.jsp ituniv.htf.wv.presentation ituniv.htf.wv.presentation.js ituniv.htf.wv.presentation.css ituniv.htf.wv.presentation.jsp.job ituniv.htf.wv.presentation.jsp.ecopark ituniv.htf.wv.presentation.jsp.announcement 7.2.2 HTML Prototypes Layer HTML Prototypes layer contains html prototypes - .html files. This layer enables separate working on user interface. In the end html prototypes must be merged with jsp pages. The diagram shows package hierarchy. ituniv.htf.wv.presentation 7.2.3 ituniv.htf.wv.presentation.htmlprototypes Control Layer The Control layer contains all the components used to access the domain layer. According to Logical view this layer is part of business logic tire. It contains Struts 2 actions. The diagram shows package hierarchy. ituniv.htf.wv.actions Happy Tree Friends, 2016 Page 18 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 7.2.4 Web Configuration Layer Web configuration layer includes web.xml file, which is standard for web applications and struts configuration xml files. These files will be in WEB-INF directory. WEB-INF 7.2.5 Business Logic Layer The Business Logic layer contains all the components related to the business logic. Managers are POJOs (plain old java objects). This layer interacts with data access layer. According to Logical view this layer is business logic tire. The diagram shows package hierarchy. ituniv.htf.wv.managers 7.2.6 Entities layer This is the model of the system. This layer contains entities (POJOs). The diagram shows package hierarchy. ituniv.htf.wv.model 7.2.7 Hibernate Configuration Layer This layer maps database layer to entities. It contains XML hibernate configuration files - *.hbm.xml The diagram shows package hierarchy. ituniv.htf.wv.db.hibernate.config 7.2.8 Database Access Layer The Database Access layer contains the components needed to enable communication with the database. According to Logical view this layer is data access logic tire. It contains DAO objects – POJOs, and hibernate specific classes. The diagram shows package hierarchy. Happy Tree Friends, 2016 Page 19 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 ituniv.htf.wv.db.hibernate ituniv.htf.wv.db ituniv.htf.wv.db.dao 7.2.9 Common Elements Layer The Common Element layer contains the components re-used within several layers. Log4j library will be used for logging as part of this layer. The diagram shows package hierarchy. ituniv.htf.wv.util 7.2.10 Database Layer This is the database, created with SQL scripts. MySql server will be used. 8. Size and Performance Volumes: Estimated calls: 100 a day, with peaks in work timings. Performance: 9. Time to process and online payment (credit card validation + confirmation) : less that 10 seconds required Quality As far as our application is concerned, the following quality goals have been identified: Scalability: Description : System’s reaction when user demands increase Solution : Jboss or Tomcat web servers support several workload management techniques Reliability, Availability: Description : In case of failure, application can respond and give appropriate messages. Application doesn’t crash on failure. Solution : Tomcat web server also supports mechanism for handling failures. Description : Is reusable and customizable with change in environment. Portability: Happy Tree Friends, 2016 Page 20 of 21 World Village Software Architecture Document Version: 1.1 Date: 27/04/2009 Solution : The system is developed in java so easily portable to any environment. Description : Authentication and authorization mechanisms make it secure Solution : Webserver has good mechanism for authorization and creating new sessions. Security: Happy Tree Friends, 2016 Page 21 of 21