SOEN 343 Software Design Computer Science and Software

  • Slides: 14
Download presentation
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005

SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin SOEN 343, © P. Chalin SOEN 344, © P. Chalin

Agenda – Lecture 9 a • Architecture: 4+1 view model. – Web EA: Process,

Agenda – Lecture 9 a • Architecture: 4+1 view model. – Web EA: Process, Deployment views. • GRASP: PV. • Web EA: – Applying PV, and separating concerns. – Refactoring: • From a 1 component design solution. • To a 3 component design solution. 12/27/2021 SOEN 343, © P. Chalin, 2

Architecture • … deals with the top-level structure. – Components – Interrelationships 12/27/2021 SOEN

Architecture • … deals with the top-level structure. – Components – Interrelationships 12/27/2021 SOEN 343, © P. Chalin, 3

Documentation of Architectures • Architecture Document = View A + View B + View

Documentation of Architectures • Architecture Document = View A + View B + View C + … View X + “Beyond Views” 12/27/2021 SOEN 343, © P. Chalin, 4

“ 4+1” View Model of Arch. • By Philippe Kruchten [Kruchten 95] (URL to

“ 4+1” View Model of Arch. • By Philippe Kruchten [Kruchten 95] (URL to paper given on web site. ) • Rational Unified Process. 12/27/2021 SOEN 343, © P. Chalin, 5

“ 4+1” View Model of Arch. Implementation/ Deployment/ 12/27/2021 SOEN 343, © P. Chalin,

“ 4+1” View Model of Arch. Implementation/ Deployment/ 12/27/2021 SOEN 343, © P. Chalin, 6

Web EA: Process, Deployment Views • Given in class: – Deployment view. – Process

Web EA: Process, Deployment Views • Given in class: – Deployment view. – Process view. 12/27/2021 SOEN 343, © P. Chalin, 7

GRASP • • • Information Expert. Creator. High Cohesion. Low Coupling. Controller. 12/27/2021 •

GRASP • • • Information Expert. Creator. High Cohesion. Low Coupling. Controller. 12/27/2021 • • Polymorphism. Pure Fabrication. Indirection. Protected Variations. SOEN 343, © P. Chalin, 8

GRASP Protected Variations • Problem: How to design objects, subsystems, and systems so that

GRASP Protected Variations • Problem: How to design objects, subsystems, and systems so that the variations or instability in these elements does not have an undesireable impact on other elements? • Solution: Identify points of predicted variation or instability; assign responsibility to create a stable interface around them. 12/27/2021 SOEN 343, © P. Chalin, 9

Core PV Mechanisms • • Encapsulation. Interfaces. Polymorphism. Indirection, … (Note: we are speaking

Core PV Mechanisms • • Encapsulation. Interfaces. Polymorphism. Indirection, … (Note: we are speaking of mechanisms, not principles) 12/27/2021 SOEN 343, © P. Chalin, 10

PV: Pick Your Battles • Beware not to try to overly “future-proof” your designs.

PV: Pick Your Battles • Beware not to try to overly “future-proof” your designs. • Actually, this is true of any principle … 12/27/2021 SOEN 343, © P. Chalin, 11

Applying PV to Web EA • Consider a single servlet which offers the greeting

Applying PV to Web EA • Consider a single servlet which offers the greeting “Hello”. • Refactor it with the goal of applying PV and separate concerns. 12/27/2021 SOEN 343, © P. Chalin, 12

Applying PV to Web EA • (Solution given in class) 12/27/2021 SOEN 343, ©

Applying PV to Web EA • (Solution given in class) 12/27/2021 SOEN 343, © P. Chalin, 13

Applying PV to Web EA (given in class) • Greeting example with successively refined

Applying PV to Web EA (given in class) • Greeting example with successively refined design solutions: 1. Start from design of 1 servlet class whose purpose is to offer a greeting. 2. Factor out domain logic to create design with: • • • Servlet in Application layer. A class in Domain Logic layer to be responsible for domain logic. How are the responsibilities of MVC distributed now? 3. Separate V and C by using JSP for V. 12/27/2021 SOEN 343, © P. Chalin, 14