2 Layers & TiersLayers are merely logical groupings of the software components that make up the application or service.Whereas tiers refer to the physical residence of those layers (hardware)In general,Layers – represents logical view of applicationTiers – represents physical view of applicationHowever, both terms are used interchangeably.
3 LayersFigure shows a simplified view of one application and its layers.
4 Tiers Presentation Layer Web Layer Business Layer EIS Layer browser Client machineWeb serverWeb LayerServer machineApplicationserverBusiness LayerDB serverEIS LayerDB machine
5 Layers  Presentation layer Collects user inputs Validates user inputsPresents the results of a computationControls the screen flow
6 Layers  Business Layer Concerned with the application specific functionalityUsed to implement business rules and to perform business tasksFor example, in a banking system, banking functions such as opening an account, calculation of Tax, etc.
7 Layers Data LayerConcerned with the management of the data & data sources of the system.Data sources can be database, XML , web services, flat file etc.Encapsulates data retrieval & storage logicFor example, the address book application needs to retrieve all person records from a database to display them to the user
8 Frameworks(Struts,JSF etc) Layers Support in JavaLayersJava/J2EE TechnologyClient PresentationHTML/AppletsJSP / ServletsFrameworks(Struts,JSF etc)Server PresentationBusinessJavaBeans / EJBDataDAO / Connectors
10 What is J2EE? Open and standard based platform for: Development & deployment of n-tier web based and component based enterprise applicationsReusability, enhance-ability, scalability & interoperability
11 J2EE Suite Core technology: Web Technology Platform services Container infrastructure, language and environment supportWeb TechnologyJava ServletsJavaServer Pages (JSP)JavaServer Pages Standard Tag Library (JSTL)JavaServer Faces (JSF)Platform servicesSecurityTransactionsResourcesConnectorsJava Message ServiceAnd extensive support forXML technologyEnterprise Java Bean (EJB) technology etc.
19 Case Study: Matrix Multiplication Problem StatementCalculate product of two matrices of order 2 * 2Result of multiplication should be stored in DB as well as shown to the user.
20 Case Study: Matrix Multiplication FormatInput formatinput will be in 4,2,6,5 format separated by commas where 4,2 represents entries of the first rowDisplay formatDisplays the matrix as a squareStorage formatMatrix will be stored as a string