c6minic6miniAdina, RAdina, Rééka, Mariuska, Marius
1111thth of June, 2009 of June, 2009
Apr 22, 2023 1Patterns Of Enterprise
Application Architecture
Apr 22, 2023Patterns Of Enterprise
Application Architecture2
The ChallengeThe Challenge
Software application used by:Human Resources department: track information about company’s offices and employees
Sales department: track information about orders
Based on a given relational schema, develop a multi-layer architecture which:
to use a given combinations of patterns
to process a given set of business rules
to result in a multi-user application with simultaneous user actions
C6: Transform/Template View, Page Controller, C6: Transform/Template View, Page Controller, Domain Model, Data Mapper, Unit of Work, Domain Model, Data Mapper, Unit of Work, Identity MapIdentity Map
Apr 22, 2023Patterns Of Enterprise
Application Architecture3
Apr 22, 2023Patterns Of Enterprise
Application Architecture4
Project OverviewProject Overview
Main technology: Java WebProject Setup:
Apr 22, 2023Patterns Of Enterprise
Application Architecture5
Communication protocol:• Skype conferences• Face-to-face meetings
Communication protocol:• Skype conferences• Face-to-face meetings
Development Environments &Tools:• Eclipse• ANT• Apache Tomcat• Source Control: SVN – Google Code Project Hosting
Development Environments &Tools:• Eclipse• ANT• Apache Tomcat• Source Control: SVN – Google Code Project Hosting
Software Analysis, Architecture & Design:• MS Visio
Software Analysis, Architecture & Design:• MS Visio
SVN RepositorySVN Repository
Apr 22, 2023Patterns Of Enterprise
Application Architecture6
Application Application ArchitectureArchitecture
Apr 22, 2023Patterns Of Enterprise
Application Architecture7
Presentation LayerPresentation Layer
Apr 22, 2023Patterns Of Enterprise
Application Architecture8
Model – View – Controller architectural pattern:
• [Page Controller][Page Controller] Controller: • Requests controller: Struts
the Controller receives the request from the browser, and makes the decision where to send the request
• Dynamic behavior: Struts servlet and actions
• [Template View] [Template View] View:• Visual Styles: CSS• Layout: SiteMesh decorators• Presentation: JSP
Presentation Presentation PackagePackage
Apr 22, 2023Patterns Of Enterprise
Application Architecture9
Domain LayerDomain Layer
Apr 22, 2023Patterns Of Enterprise
Application Architecture10
• [Domain Model][Domain Model]• incorporates both behavior and
data (e.g class Employee)• Simple Domain Model:
similar to database design (domain object <–> DB table)
Business PackagesBusiness Packages
Apr 22, 2023Patterns Of Enterprise
Application Architecture11
Persistence LayerPersistence Layer
Apr 22, 2023Patterns Of Enterprise
Application Architecture12
Mapping to Mapping to Relational DatabaseRelational Database
• Architectural patterns: Architectural patterns: Data Data MapperMapper
• Behavioral Problems:• ensure that the DB state
remains consistent Unit of Unit of Work - Work - object registration: clean/dirty flags
• load each object once Identity Identity MapMap
Persistence PackagePersistence Package
Apr 22, 2023Patterns Of Enterprise
Application Architecture13
Apr 22, 2023Patterns Of Enterprise
Application Architecture14
General Business General Business RulesRules
RBG 1: Adaugare angajat nouRBG 2: Avansarea unui angajat pe un alt tip de jobRBG 3: Afisarea departamentelor cu numarul de angajati si salarul mediuRBG 4‘: Afisarea cu verde a angajatilor cu salarul cu cel putin XX% mai mare decat salarul mediuRBG 4‘‘: Afisarea cu rosu a angajatilor cu salarul cu cel putin YY% mai mic decat salarul mediu
Apr 22, 2023Patterns Of Enterprise
Application Architecture15
General Business General Business RulesRules
RBG 1: Adaugare angajat nou
Apr 22, 2023Patterns Of Enterprise
Application Architecture16
General Business General Business RulesRules
RBG 2: Avansarea unui angajat pe un alt tip de job
Apr 22, 2023Patterns Of Enterprise
Application Architecture17
General Business General Business RulesRules
RBG 3: Afisarea departamentelor cu numarul de angajati si salarul mediu
Apr 22, 2023Patterns Of Enterprise
Application Architecture18
General Business General Business RulesRules
RBG 4‘: Afisarea cu verde a angajatilor cu salarul cu cel putin XX% mai mare decat salarul mediuRBG 4‘‘: Afisarea cu rosu a angajatilor cu salarul cu cel putin YY% mai mic decat salarul mediu
Apr 22, 2023Patterns Of Enterprise
Application Architecture19
Special Business Special Business RulesRules
RBS 1: Cresterea comisionului pentru angajatii care au avut un numar de comenzi mai mare YY in ultimele ZZ zile. RBS 2: Clientii din regiunea KK primesc o reducere cu GG% a pretului de lista, pretul final nefiind insa mai mic decat cel minim acceptat.RBS 3: Angajatii cu vechime in firma mai mare de ZZ ani primesc o crestere a salarului cu KK%.
Apr 22, 2023Patterns Of Enterprise
Application Architecture20
Observed issuesObserved issues
Concurrency Control Mechanism needed – it could be handled by Unit of Work
Apr 22, 2023Patterns Of Enterprise
Application Architecture21
Apr 22, 2023Patterns Of Enterprise
Application Architecture22
Lessons LearnedLessons Learned
Technical:Work with SVN - Google Code Project HostingStruts & SiteMeshUnit of Work & Identity MapPatterns Combination:• Page Controller – Template View• Domain Model - Data Mapper – Identity Map
Team work – remote Reka
Apr 22, 2023Patterns Of Enterprise
Application Architecture23
Lessons learnedLessons learned
Apr 22, 2023Patterns Of Enterprise
Application Architecture24
Cum sa faci o arhitectura in Doodle:
To Be Continued…
Apr 22, 2023Patterns Of Enterprise
Application Architecture25