POAD Book: Chapter 4: Design Patterns as Components Chapter 5: Visual Design Models Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical.

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

Architecture Representation
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Basic Concepts in Component-Based Software Engineering
Object-Oriented Analysis and Design
Introduction To System Analysis and Design
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
1/31 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2005] January 22, 2009.
Software Engineering I Object-Oriented Design Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science.
© Copyright Eliyahu Brutman Programming Techniques Course.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
Introduction To System Analysis and design
© Drexel University Software Engineering Research Group (SERG) 1 Based on the paper by Philippe Kruchten from Rational Software.
Systems Analysis and Design in a Changing World, Fifth Edition
Chapter 6 System Engineering - Computer-based system - System engineering process - “Business process” engineering - Product engineering (Source: Pressman,
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
An Introduction to Software Architecture
POAD Distributed System Case Study: A Medical Informatics System Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Ch:10 Component Level Design Unit 4. What is Component? A component is a modular building block for computer software Because components reside within.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 09. Review Introduction to architectural styles Distributed architectures – Client Server Architecture – Multi-tier.
Introduction To System Analysis and Design
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
POAD Book: Chapter 9 POAD: The Design Phase Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Systems Analysis and Design in a Changing World, 3rd Edition
Automating the Development of Pattern-Oriented Designs Copyright, 1996 © Dale Carnegie & Associates, Inc. Sherif Yacoub, Hengyi Xue, and Hany Ammar {yacoub,
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
1 COMP 350: Object Oriented Analysis and Design Lecture 1Introduction References: Craig Larman Chapter 1.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
TAL7011 – Lecture 4 UML for Architecture Modeling.
Introduction To OOP 1.0 Fundamentals Of Java Programming Language 2.0 Exception Handling 3.0 Classes, Inheritance And Polymorphism © 2011 | PN AZRINA.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
Part VII: Design Continuous
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Introduction to OOAD and the UML
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
1 Unified Modeling Language, Version 2.0 Chapter 2.
EMEA Beat Schwegler Architect Microsoft EMEA HQ Ingo Rammer Principal Consultant thinktecture
POAD Book: Chapter 7 POAD: The Process Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Introduction to OOAD and UML
Software Design Refinement Using Design Patterns
UML Diagrams: Class Diagrams The Static Analysis Model
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
MPCS – Advanced java Programming
Systems Analysis and Design With UML 2
Introduction to Design Patterns
Unified Modeling Language
Distribution and components
Instructor: Dr. Hany H. Ammar
Inventory of Distributed Computing Concepts and Web services
Chapter 20 Object-Oriented Analysis and Design
Object oriented analysis and design
Appendix A Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Introduction to OOAD and the UML
Presentation transcript:

POAD Book: Chapter 4: Design Patterns as Components Chapter 5: Visual Design Models Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU

Outline n Chapter 4: Design Patterns as Components – Constructional Design Patterns – Software Components – Design Component Properties – Patterns as Components – Pattern Interfaces n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Structural vs Behavioral Pattern Composition n Pattern Oriented Analysis and Design, POAD. Provides a structural approach for pattern composition (Not a behavioral approach such as role based or Aspect-Oriented methods) – Example of an aspect-oriented is the trace pattern applied to a class to trace Functions entries and exits > TraceApplication Trace TraceEntry(String) TraceExit(String) Classi fun() Application_fun() TraceApplication sequence diagram– fun() :Classi :Trace fun() traceEntry(fun.name) Application_fun() traceExit(fun.name)

Role-Based Behavioral Pattern composition (Not to be discussed in details) n A role model is a collaboration of objects that the analyst chooses to regard as a unit, separated from the rest of the application during some period of consideration. A Synthesis Role Model is obtained from different role models Authorizer Traveler tr au bo BookKeeper PayMaster pm Booking Clerk Traveler Book Keeper tr sec pm bk ta Travel Agent PayMaster cust ven X X X Booking Clerk Book Keeper tr sec pm bk ta Travel Agent PayMaster cust ven X X X Authorizer Traveler tr au bo Airline Booking Travel Expense Synthesis Role Model

Outline n Chapter 4: Design Patterns as Components – Constructional Design Patterns – Software Components – Design Component Properties – Patterns as Components – Pattern Interfaces n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Constructional Design Patterns (structural pattern composition) n In POAD, the category of Patterns used is called constructional design patterns. n The term Constructional indicates that the patterns: – Are design components used in constructing Application Design. – Patterns become the core building blocks of the design

What Constructional Design patterns can Offer n Encapsulation is a core concept of Object Oriented Analysis and Design, OOAD. n It provides a means to access an interface n Constructional design patterns encapsulate information – They encapsulate solutions to a common design problems n They are analogous to classes in OOD – Apps are built by gluing these patterns together

Outline n Chapter 4: Design Patterns as Components – Constructional Design Patterns – Software Components – Design Component Properties – Patterns as Components – Pattern Interfaces n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Software Components n Component–Based software development is a corner stone in software engineering (development processes and tools support component-based development) n Software components are: – Self contained – Fairly independent – Require little or no customization (true only at the code level) – Provide well-defined services for the whole application

Software Components: JavaBeans n JavaBeans are reusable software components for Java that can be manipulated visually in a builder tool. Practically, they are classes written in the Java programming language conforming to a particular convention.reusablesoftware components Java Java programming language n They are used to encapsulate many objects into a single object (the bean), so that they can be passed around as a single bean object instead of as multiple individual objects.

Software Components: JavaBeans n AWT, Swing, and SWT, the major Java GUI toolkits, use JavaBeans conventions for their components. AWTSwingSWTGUI n This allows GUI editors like the Eclipse Visual Editor or the NetBeans GUI Editor to maintain a hierarchy of components and to provide access to their properties via uniformly-named accessors and mutatorsEclipseNetBeans

Software Components: Enterprise JavaBeans n Enterprise JavaBeans (EJB) is a managed, server-side component architecture for modular construction of enterprise applications. n EJB encapsulates the business logicbusiness logic of an application, with Concurrency controlConcurrency control, Java Naming and directorydirectory servicesservices (JNDI), Security ( Java Cryptography Extension (JCE) and JAAS ), and Exposing business methods as Web ServicesJNDISecurityJava Cryptography Extension (JCE) JAASWeb Services EventsEvents using Java Message Service, Remote procedure calls using RMI-IIOP.Java Message ServiceRemote procedure calls RMI-IIOP

The Bigger Picture: Java 2 Enterprise Edition (J2EE) : n J2EE Architecture

Software Components: Container Service Application Programming Interfaces (APIs) n Example: create audio component, publish its name in a naming service (JNDI) available to your application. This provides a simple method to access the service APIs

Software Components: Component Object Model (COM) Technologies n Microsoft COM technology in the Microsoft Windows-family of Operating Systems enables software components to communicate. n COM is used by developers to create re-usable software components, link components together to build applications, and take advantage of Windows services. n The family of COM technologies includes COM+, Distributed COM (DCOM) and ActiveX Controls. n Microsoft recommends that developers use the.NET Framework rather than COM for new development.

Software Components:.NET n The Microsoft.NET Framework is a managed code programming model for building applications on Windows clients, servers, and mobile or embedded devices. n Developers use.NET to build applications of many types: Web applications, server applications, smart client applications, console applications, or database applications n Windows Communication Foundation is a set of.NET technologies for building and running connected systems. It is a new breed of communications infrastructure built around the Web services architecture.

Outline n Chapter 4: Design Patterns as Components – Constructional Design Patterns – Software Components – Design Component Properties – Patterns as Components – Pattern Interfaces n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Design Components n Characteristics of design components – Defines a software design fragment – Represented using design notation and delivered as a design model – It is deployable at design time – White box component (well defined design structure and behavior) – Well defined Interface, to glue and integrate with other design components.

Design Component Properties n Composable – The Internals are defined in terms of the internal structure and behavior models. – The interfaces by which it is glued together with other design components n Customizable: Can be customized to allow selection between tradeoffs at lower design levels n Persistent: Internals are preserved after instantiation and are traceable

Outline n Chapter 4: Design Patterns as Components – Constructional Design Patterns – Software Components – Design Component Properties – Patterns as Components – Pattern Interfaces n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Specifying Patterns as Components n A pattern can be described and specified in a variety of forms n We classify techniques to describe a pattern into three categories 1.Recipe – an informal description of the pattern that helps application designers to understand the pattern – Essential elements are – Context in which problem is incurred – The problem solved by the pattern – Forces influencing the selection of the pattern – Solution to be used for problem at hand – Consequences of applying the pattern – When it comes to composition with other patterns, the recipe is not sufficient to guide the integration process

Patterns as Components 2. Formal Specification (use notation based on scripting design languages or design scripts) n Helps designers compare and contrast several solution issues n Improves understandability of patterns n Patterns encapsulate mental reasoning decisions beside their technical solutions that are difficult to capture using formal techniques. 3. Interface Specification – It is necessary to see how the patterns (thr’ interfaces) glue together and to other design artifacts

Component Interfaces n Examples of Interface Specifications – Module Interconnection Languages (MILSs) – Interface Definition Language (IDL) (found in CORBA, now an ISO standard, see – Web Services Description Language (WSDL) (found in SOA, see /#component_model) – Interfaces for OO Components (see One approach uses the idea of contracts to define interfaces of objects

Component Interfaces: APIs n Application/Platform Interfaces (APIs) support portability

Component Interfaces n Interface Properties – Type n Referential – (Class reference or Pattern reference) – A a client or a requestor component has a reference to the provider component with no details about the usage relationship – Useful for building the design structural views n Functional – (Services and Actions) – Specify the services provided by the design component and the services required from other components. – Useful for building the design behavioral views

Component Interfaces n Interface Properties (cont.) – Role: distinguishes the role that is played by a design component n Emphasizes the C/S relationship and explicitly defines provided and required interfaces. – Nature n Abstract (most cases, e.g. abs classes, or Java Interfaces) vs. concrete (provides default implementation for the interface operations. ) – Dynamism n Static (e.g. CORBA IDLs or Java interfaces) vs. Dynamic Interfaces (multiple objects that wait for multiple events)) – Dynamic interfaces are not specified for users at design-time instead they are interrogated (inquired) by the calling component at run-time (for example, CORBA Dynamic Method Invocation).

Component Interfaces – Description n Description characterizes the interface n Signature – Names and parameters n Behavioral – How the component reacts when it is called – Multiplicity n A component can have multiple interfaces, all of which are valid interfaces to the same component n According to the application context using the component one of those interfaces will be used

Outline n Chapter 4: Design Patterns as Components – Constructional Design Patterns – Software Components – Design Component Properties – Patterns as Components – Pattern Interfaces n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Pattern Interfaces n Pattern interfaces must conform with the OO paradigm n Interfaces are important for 3 reasons – Hide details – Distinguish parts crucial for integration – Provide flexibility n Pattern Interfaces are application interfaces

Constructional Design Patterns (CDPs) n Definition: A CDP has additional constraints that allow for composition and integration. n CDPs are OO design patterns n Have interfaces for composition and integration n Their structural solution is based on well- defined class diagrams

A pattern template with emphasis on interfaces Required Interface Provided Interface Classes Attributes Methods Informal Description (Pattern Template) Interfaces Internals (Class Diag.) A Pattern

Examples of CDPs n All object behavioral patterns Iterator (257) Mediator (273) Memento (283) Flyweight (195Iterator (257) Mediator (273) Memento (283) Flyweight (195) Observer (293) State (305) Strategy (315) Visitor (331) Observer (293) State (305) Strategy (315) Visitor (331) Chain of Responsibility (223) Command (233)

Outline n Chapter 4: Design Patterns as Components – Constructional Design Patterns – Software Components – Design Component Properties – Patterns as Components – Pattern Interfaces n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Chapter 5: Visual Design Models

Outline n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Pattern Composition Models n Pattern Visualization – Models that are used to capture the internal design – UML based n Pattern Composition Visualization – Models used to capture integration and composition of a set of patterns – Some use UML others use other tools n POAD is based on structural composition

Pattern Composition Models n POAD requires models to have varying granularity – Course grained n Used for integrating patterns – Fine grain => Class diagrams n Capture the internals of a Pattern n POAD uses Hierarchical OOD – Objects may contain other Objects in a Hierarchical fashion – Connectivity between interface objects and internal objects

Guidelines in defining POAD Models 1. Model elements must serve a purpose Close to mental building blocks 2. Models tend to be Hierarchical Capture the design at various levels of abstraction 3. Exchangeable Should integrate with and use UML. 4. Models serve other models Models used in one phase should be used in others

Outline n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

POAD’s design models 1. Pattern Level – pattern interfaces and dependencies 2. Pattern Level with interfaces – Explicitly defines relationships between interfaces 3. Detailed Pattern level – connectivity between internals and interfaces is defined.

Pattern Level n Schematic- represents the patterns and the relationships between them – Pattern instance n Type – Observer, Factory, Strategy etc. n Name –Application specific as given by designer – Used to differentiate when there exist 2 instances of same type. PatternInstanceName2: Type2 PatternInstanceName1: Type1 PatternInstanceName3: Type2 A schematic diagram for the Pattern-Level model

Pattern Level n Relationships –only one relationship exists – Dependency –USES, further defined later and become associations between interface classes n Design Decisions – Selecting the appropriate Patterns – Defining Dependencies –How one pattern uses another n UML Syntax – Pattern level view resembles UML Package diagrams – Packages represent constructional Patterns – Name of Package is Instance Name n Relationships are defined as dependency

Pattern-Level model using UML Syntax

Outline n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Pattern Level With Interfaces n Schematic –shows interfaces and relationships between them, 2 types of interfaces – Interface Classes –One of the internal classes – Interface Operations –An Operation in one of the interface classes. One internal class can implement several operations.

A schematic diagram for the Pattern-Level with Interfaces model PatternInstance2: Type2 ClassY::Op 4 Class1 Class2 PatternInstance1: Type1 ClassX::Op2 ClassX::Op1 Class1

Pattern Level With Interfaces n Relationships – uses between pattern interfaces further defined – Class/Class –Aggregation, association or dependency – Class/Operation –Interface class can Invoke an operation in another pattern. – Operation/Operation –Models interactions, show the designer’s perceptions of lower level design details

Pattern Level With Interfaces n Design Decisions –Selecting which interface to use for a given application. n UML syntax –UML package and interface notation is used. – For interface classes and operations the UML syntax for interface is used (circle associated with a package). – A circle with only a class name underneath is a class interface – An operation interface is denoted by listing the operation name underneath the class name

The Pattern-Level with Interfaces model using UML

Outline n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Detailed Pattern Level Model n Purpose –To explore the internal details of each pattern and ID the internal classes that implement the interface. n Schematic –Represents Patterns and their internal structure. – Pattern Instances and type – Interfaces – Internal class diagram – Relationship between interfaces and internals is established

Schematic for The Detailed Pattern- Level view PatternInstance1: Type1 ClassX::Op 2 ClassX::Op 1 Class1 ClassX Op1 Op2 Class1 PatternInstance2: Type2 Class1 Class2 Class1 ClassY::Op 4 Class2 ClassZ Op5 ClassY Op4

Detailed Pattern Level Model n Relationships –Connectivity is used to show which elements of internal are visible as interfaces. n Design Decisions –None, This is a refinement stage n UML syntax –The internal class diagram of each pattern is shown. – Interfaces from previous model are incorporated into this class diagram for each pattern

Detailed Pattern Level Model PatternInstance1 > PatternInstance2 > Class1 Class2 ClassX Op1() Class X Op2() ClassY Op4() Class1 Class X Op1() Op2() Class1 ClassZ Class2 ClassY Op4()

Outline n Chapter 5: Visual Design Models – Pattern Composition Models in general – POAD design models n Pattern Level n Pattern Level with Interfaces n Detailed Pattern Level with interfaces – Characteristics of POAD

Characteristics of POAD n Hierarchy –The three models demonstrate 3 levels of abstraction. This allows the internals to be suppressed at one abstraction and then expressed at another. n Traceability –Must be able to trace from high abstraction to lower. – Pattern dependencies in pattern-level are traceable to the relationships in pattern-level with interfaces view.

Characteristics of POAD n Traceability enables designer to navigate up or down levels of abstraction n Composability –enables model elements to be plugged together. Artifacts in each view are described as pluggable