Download - Chapter 6 Design Model
![Page 1: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/1.jpg)
Chapter 6Chapter 6Design ModelDesign Model
![Page 2: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/2.jpg)
Design Model (DM)Design Model (DM) Guiding principles Guiding principles
All classes should be specified to the level of detail All classes should be specified to the level of detail that they represent implementation classes.that they represent implementation classes.
A sequence diagram should be defined for each flow A sequence diagram should be defined for each flow of events in each use case.of events in each use case.
All messages in sequence diagrams should All messages in sequence diagrams should represent actual operations of participating objectsrepresent actual operations of participating objects
You should avoid representing in the diagram the You should avoid representing in the diagram the classes of the underlying technological framework classes of the underlying technological framework (e.g., classes in Java packages)(e.g., classes in Java packages)
Achieve class cohesiveness, minimizing Achieve class cohesiveness, minimizing communication between classes.communication between classes.
![Page 3: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/3.jpg)
DM: Guiding principles -tempDM: Guiding principles -temp
Domain entities:Domain entities: Classes, objects, and packages that are found from Classes, objects, and packages that are found from
the use cases to specify system functionsthe use cases to specify system functions Entities of this type at the design model are basically Entities of this type at the design model are basically
a copy of those in the analysis model by addinga copy of those in the analysis model by adding Operations and attributesOperations and attributes
Implementation-level entities:Implementation-level entities: Classes, objects, and packages that are identified by Classes, objects, and packages that are identified by
the designer to support the implementation of the the designer to support the implementation of the system.system.
Examples includes list, database tables, Java beansExamples includes list, database tables, Java beans
![Page 4: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/4.jpg)
DM: Model structureDM: Model structure The same analysis packages are also design packagesThe same analysis packages are also design packages Each design package is structured into three layers:Each design package is structured into three layers:
Presentation layerPresentation layer Business layerBusiness layer Data access layerData access layer
Each design package has subpackages for the Each design package has subpackages for the realization of the use case in the packagerealization of the use case in the package Use elements in the three layers to realize each use case in Use elements in the three layers to realize each use case in
the packagethe package At the business layer of each package there is an entity At the business layer of each package there is an entity
manager that manages all elements/entities of the manager that manages all elements/entities of the package at the data access layer.package at the data access layer.
![Page 5: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/5.jpg)
Design model structureDesign model structure
Figure 6-2
![Page 6: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/6.jpg)
Data access
DM: Model structureDM: Model structure
Presentation
Business
Use case realizations
Business package i
Data Types
Wrappers
Data Access
![Page 7: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/7.jpg)
DM: Data Access Layer - 1DM: Data Access Layer - 1
Although entities are managed by different Although entities are managed by different managers, but each use case may need, managers, but each use case may need, normally does, entities from other packages to normally does, entities from other packages to be realized.be realized.
Create a data model for the whole systemCreate a data model for the whole system When an entity (A) has an association with When an entity (A) has an association with
another entity (B) which is managed by a another entity (B) which is managed by a different entity manager, then the manager of A different entity manager, then the manager of A must request services from the manager of B in must request services from the manager of B in order to make changes or retrieve info oforder to make changes or retrieve info of B. B.
![Page 8: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/8.jpg)
DM: Data Access Layer - 2DM: Data Access Layer - 2
The data access layer may be further The data access layer may be further divided into:divided into:Data Type classes: the data itself (stored in : the data itself (stored in
DB).DB).Wrapper classes: the data and getters and : the data and getters and
setters.setters.Data Access Layer classes: that define a set : that define a set
of operations for the specific needs of our of operations for the specific needs of our solutionsolutionCRUD: create, retrieve, update, and deleteCRUD: create, retrieve, update, and delete
![Page 9: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/9.jpg)
DM: Data Access Layer - 3DM: Data Access Layer - 3
Data Access Layer and Wrapper classes
StudentDALcreate()
findStudent(id)findStudents(major)
Update()Delete()
MajorDALcreate()
findMajor(id)Update()Delete()
MajorInfoId
NameHost college
StudentInfossn
NameAddress
DOB
Data Type ClassesRegisterInfo
StudentSSNSectionNo
grade
<Wrapper>>
MajorId, Name,hostCollegeGetters()Setters()
<Wrapper>>
StudentSSN, name,Address, DOBGetters()Setters()
![Page 10: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/10.jpg)
DM: Data Access Layer - 4DM: Data Access Layer - 4 Data Type classes are mapped to relations (tables) in Data Type classes are mapped to relations (tables) in
relational database.relational database. Each M:N relationship between data type classes is Each M:N relationship between data type classes is
mapped to a table (called association table). (e.g., table mapped to a table (called association table). (e.g., table registerregister in next slide) in next slide)
When an M:N relationship spans two entities managers, When an M:N relationship spans two entities managers, the association table belongs to both managers (e.g., the association table belongs to both managers (e.g., table table registerregister on next slide). on next slide).
The database model can be traced back to the The database model can be traced back to the managed entities diagram in the Analysis Model (see managed entities diagram in the Analysis Model (see Managed Entity Diagram slide)Managed Entity Diagram slide)
![Page 11: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/11.jpg)
DM: Data Access Layer - 5DM: Data Access Layer - 5
<<table>>
StudentInfossn
NameAddress
DOBmajorID
<<table>>
MajorInfoId
NameHost college
Database Model
<<table>>
SectionInfosectionNolocationcourseIDInstructor
<<table>>
CourseInfoCourseID
TitleCredits
<<table>>
FacultyInfossn
NameOffice
department
<<table>>
DeptInfodeptIDName
mainOffice
<<table>>
RegisterInfoStudentSSNSectionNo
grade
Note: Arrows show foreign keys.
![Page 12: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/12.jpg)
DM: Data Access Layer - 6DM: Data Access Layer - 6
<<table>>
StudentInfossn: char(9);name: varchar(20)address:DOB: char(8);majorID: int
StudentDAL+create(Student s): int+findBySSN(string ssn): Student+findByMajor(mid): List<Student>+update(Student s): int+delete(string ssn): int+getMajor(string ssn): int+getTranscript(string ssn): List<crsId, grd>;
<<Wrapper>>
Student-ssn: string-Name: string-Address: string-DOB: Date-majorID: int+get/setSSN(ssn);+get/setName(name);+get/setAddr(addr);+get/setDOB(date)+get/setMajor(int mid)
<<table>>
RegisterInfoStudentSSNSectionNo
grade
RDBMS
![Page 13: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/13.jpg)
DM: Data Access Layer - 8DM: Data Access Layer - 8
StudentDAL
<<Wrapper>>
Student
<<table>>
StudentInfo
<<table>>
RegisterInfo
RDBMS
Web Server: Node
<<driver>>
JDBC
DB Server: Node
<<driver>>
JDBC
MajorDAL
<<Wrapper>>
Major
<<table>>
MajorInfo
Intranet
…
…
A Look Ahead to deployment
![Page 14: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/14.jpg)
DM: Presentation layerDM: Presentation layer Three diagrams are defined for each business package:Three diagrams are defined for each business package:
Boundary traceability (Mapping): traces each XyzView back to traces each XyzView back to the boundary classesthe boundary classes
Each screen (and its included input forms) is mapped to a Each screen (and its included input forms) is mapped to a XyzView class XyzView class
Control traceability (mapping): trace dispatcher classes back to trace dispatcher classes back to dispatcher classes in analysis modeldispatcher classes in analysis model
Each dispatcher class in analysis model is mapped to a dispatcherEach dispatcher class in analysis model is mapped to a dispatcher Participants: a class diagram showing the relationship between a class diagram showing the relationship between
classes in the presentation layer (including XyzView classes classes in the presentation layer (including XyzView classes and dispatchers)and dispatchers)
Show the relationship between View classes and dispatchersShow the relationship between View classes and dispatchers
![Page 15: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/15.jpg)
MediatorMediatorDesign PurposeDesign Purpose
Avoid references between dependent Avoid references between dependent objects.objects.
Design Pattern SummaryDesign Pattern SummaryCapture mutual behavior in a separate Capture mutual behavior in a separate
class.class.
![Page 16: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/16.jpg)
Mediator - ModelMediator - Model
Mediator Colleague
ConcreteMediator
Colleague_BColleague_A
![Page 17: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/17.jpg)
Mediator Sequence DiagramMediator Sequence Diagram
Client A:Colleague_A
:Mediator
B: Colleague_B
request()
takeAction_1()
mediate()
:Mediator C: Colleague_A
takeAction_2()
takeAction_3()
![Page 18: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/18.jpg)
DM: Business layerDM: Business layer
The entity manager of each business package The entity manager of each business package is mapped to a subsystem.is mapped to a subsystem. A subsystem is an instance of a packageA subsystem is an instance of a package The Interface: the specification of the subsystem, The Interface: the specification of the subsystem,
defines everything a client needs to know in order to defines everything a client needs to know in order to use the subsystemuse the subsystem
The realization of the interface: the implementation The realization of the interface: the implementation of the subsystem, interior structure that implements of the subsystem, interior structure that implements the interface.the interface.
To start, define one class that implements all the To start, define one class that implements all the
operations specified in the interfaceoperations specified in the interface..
![Page 19: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/19.jpg)
AM: Relationship between classesAM: Relationship between classes
SectionInfo
CourseInfo
ClassroomInfo
dispatcher
dispatcher
dispatcher
Presentation Layer
Business Package i
Business Layer Data Access Layer
Course
Section
Classroom
CourseDAL
CroomDAL
SectionDAL
Entity Manager
Subsystem
![Page 20: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/20.jpg)
DM: Identify class operations - 1DM: Identify class operations - 1
For Boundary classes (View classes/Web pages):For Boundary classes (View classes/Web pages): Attributes of a screen are mapped to text displayAttributes of a screen are mapped to text display An input form is mapped to an HTML formAn input form is mapped to an HTML form Attributes of an input form are input fields of the Attributes of an input form are input fields of the
HTML formHTML form Operations of a screen may be mapped to Operations of a screen may be mapped to
Javascript display function and Web linksJavascript display function and Web links Operations of an input form may be mapped to Operations of an input form may be mapped to
HTML form submit buttons.HTML form submit buttons. The program that processes the HTML form submits The program that processes the HTML form submits
is the dispatcher of the use case.is the dispatcher of the use case.
![Page 21: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/21.jpg)
DM: Identify class operations - 2DM: Identify class operations - 2 Identify operations for control and data access Identify operations for control and data access
layer classeslayer classes Use sequence diagram to help in identifying class Use sequence diagram to help in identifying class
operations for all control classes (dispatchers and operations for all control classes (dispatchers and entity manager) and entity classes (data access entity manager) and entity classes (data access layer classes)layer classes)
For every scenario of every use case, create a For every scenario of every use case, create a sequence diagram.sequence diagram.
Follow the message in the sequence diagram one by Follow the message in the sequence diagram one by one to identify the operation the receiving class one to identify the operation the receiving class should have.should have.
![Page 22: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/22.jpg)
DM: Identify class operations - 3DM: Identify class operations - 3
Each operation identified should be Each operation identified should be documented with: documented with: name of the operationname of the operation A brief description of the operation’s functionA brief description of the operation’s function In and out parametersIn and out parameters Return valueReturn value Define the skeleton of the operation’s body as Define the skeleton of the operation’s body as
feasible.feasible. Follow the javadoc, cppdoc, and phpdoc format Follow the javadoc, cppdoc, and phpdoc format
or a standard.or a standard.
![Page 23: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/23.jpg)
DM: SummaryDM: Summary For each business packageFor each business package
Each boundary class is mapped to a Web pageEach boundary class is mapped to a Web page The entity manager is mapped to the entity manager The entity manager is mapped to the entity manager
subsystemsubsystem Each dispatcher is mapped to a subclass of HTTPServletEach dispatcher is mapped to a subclass of HTTPServlet Each entity class is mapped to Each entity class is mapped to
A DAL classA DAL class A wrapper class (Java Bean)A wrapper class (Java Bean) A data type class (DB table)A data type class (DB table)
Identify operationsIdentify operations Each operation of a boundary class from the user experience Each operation of a boundary class from the user experience
model is mapped to a web link, or an html submit inputmodel is mapped to a web link, or an html submit input For dispatchers, entity manager subsystem (its classes), and For dispatchers, entity manager subsystem (its classes), and
DAL classesDAL classes Use sequence diagrams to identify their operations based on the Use sequence diagrams to identify their operations based on the
messages a receiving class receives.messages a receiving class receives.
![Page 24: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/24.jpg)
Managed entitiesManaged entities
Figure 6-3
![Page 25: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/25.jpg)
Data Access classes for User Data Access classes for User Account ManagementAccount Management
Figure 6-4
![Page 26: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/26.jpg)
XML Schema designer in Microsoft Visual XML Schema designer in Microsoft Visual Studio .NET, with the definition of a strongly Studio .NET, with the definition of a strongly
typed DataSettyped DataSet..
Figure 6-5
![Page 27: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/27.jpg)
Database modelDatabase model
Figure 6-6
![Page 28: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/28.jpg)
Tracing Data Access classes Tracing Data Access classes to analysis classesto analysis classes
Figure 6-7
![Page 29: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/29.jpg)
Structure detail of the Data Structure detail of the Data Access Layer packageAccess Layer package
Figure 6-8
![Page 30: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/30.jpg)
Structure detail of the Structure detail of the Presentation Layer packagePresentation Layer package
Figure 6-9
![Page 31: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/31.jpg)
Equivalence of structures between Equivalence of structures between design model and analysis modeldesign model and analysis model
Figure 6-10
![Page 32: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/32.jpg)
Tracing dispatcher classes to Tracing dispatcher classes to analysis classesanalysis classes
Figure 6-11
![Page 33: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/33.jpg)
Tracing Web forms/controls Tracing Web forms/controls to analysis classesto analysis classes
Figure 6-12
![Page 34: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/34.jpg)
Participants in the presentation layer Participants in the presentation layer of User Account Managementof User Account Management
Figure 6-13
![Page 35: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/35.jpg)
Structure detail of the Structure detail of the Business Layer packageBusiness Layer package
Figure 6-14
![Page 36: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/36.jpg)
Enterprise component interface with Enterprise component interface with associated Data Layer classesassociated Data Layer classes
Figure 6-15
![Page 37: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/37.jpg)
Tracing enterprise component Tracing enterprise component interface to analysis classesinterface to analysis classes
Figure 6-16
![Page 38: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/38.jpg)
Realization of the enterprise Realization of the enterprise component interfacecomponent interface
Figure 6-17
![Page 39: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/39.jpg)
Class diagram for the enterprise Class diagram for the enterprise component implementationcomponent implementation
Figure 6-18
![Page 40: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/40.jpg)
Structure detail of the Use Structure detail of the Use Case Realizations packageCase Realizations package
Figure 6-19
![Page 41: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/41.jpg)
Tracing use case realizations Tracing use case realizations from design to analysisfrom design to analysis
Figure 6-20
![Page 42: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/42.jpg)
Figure 6-22
![Page 43: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/43.jpg)
Sequence diagram for the basic Sequence diagram for the basic flow of Create Account use caseflow of Create Account use case
Figure 6-23
![Page 44: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/44.jpg)
Structure detail of the Structure detail of the Common packageCommon package
Figure 6-24
![Page 45: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/45.jpg)
Collaboration detail: Collaboration detail: CreateAccount_Entry validationCreateAccount_Entry validation
Figure 6-25
![Page 46: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/46.jpg)
Collaboration detail: Create Collaboration detail: Create AccountAccount
Figure 6-26
![Page 47: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/47.jpg)
Collaboration detail: Adding Collaboration detail: Adding User to GroupUser to Group
Figure 6-27
![Page 48: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/48.jpg)
Role-based security handling: Role-based security handling: ParticipantsParticipants
Figure 6-28
![Page 49: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/49.jpg)
Activity graph: submitSignIn Activity graph: submitSignIn in SignInDispatcher classin SignInDispatcher class
Figure 6-29
![Page 50: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/50.jpg)
Sequence diagram: Set Session Sequence diagram: Set Session Authentication on Sign-InAuthentication on Sign-In
Figure 6-30
![Page 51: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/51.jpg)
Declare forms authentication Declare forms authentication in Web.configin Web.config
Figure 6-31
![Page 52: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/52.jpg)
Activity graph: Activity graph: Application_AuthenticateRequest in Application_AuthenticateRequest in
Global classGlobal class
Figure 6-32
![Page 53: Chapter 6 Design Model](https://reader030.vdocuments.us/reader030/viewer/2022020801/568134c0550346895d9be25c/html5/thumbnails/53.jpg)
Sequence diagram: Request Sequence diagram: Request authenticated but no role cookieauthenticated but no role cookie
Figure 6-33