Pattern. seconda parte. Types of patterns. ...other good guidance... some GRASP. design patterns (software design) Types of software patterns



Similar documents
Patterns in Software Engineering

Architectural Patterns. Layers: Pattern. Architectural Pattern Examples. Layer 3. Component 3.1. Layer 2. Component 2.1 Component 2.2.

Chapter 3 Chapter 3 Service-Oriented Computing and SOA Lecture Note

Patterns in a Nutshell

Patterns in. Lecture 2 GoF Design Patterns Creational. Sharif University of Technology. Department of Computer Engineering

Architectural Patterns: From Mud to Structure

XXI. Object-Oriented Database Design

SOFT 437. Software Performance Analysis. Ch 5:Web Applications and Other Distributed Systems

CHAPTER 4: PATTERNS AND STYLES IN SOFTWARE ARCHITECTURE

PATTERN-ORIENTED ARCHITECTURE FOR WEB APPLICATIONS

Encapsulating Crosscutting Concerns in System Software

Programma corso di formazione J2EE

Client-server 3-tier N-tier

A MODEL OF HETEROGENEOUS DISTRIBUTED SYSTEM FOR FOREIGN EXCHANGE PORTFOLIO ANALYSIS

Customer Bank Account Management System Technical Specification Document

ARCHITECTURAL DESIGN OF MODERN WEB APPLICATIONS

Information Systems Analysis and Design CSC John Mylopoulos. Software Architectures Information Systems Analysis and Design CSC340

A methodology for secure software design

Understanding Architectural Assets

Excerpts from Chapter 4, Architectural Modeling -- UML for Mere Mortals by Eric J. Naiburg and Robert A. Maksimchuk

September 18, Modular development in Magento 2. Igor Miniailo Magento

Design Patterns. Design patterns are known solutions for common problems. Design patterns give us a system of names and ideas for common problems.

Structuring Product-lines: A Layered Architectural Style

Architecture. Reda Bendraou

[2006] IEEE. Reprinted, with permission, from [M. Ye and K. Sandrasegaran, Teaching about Firewall Concepts using the inetwork Simulator, Information

Decomposition into Parts. Software Engineering, Lecture 4. Data and Function Cohesion. Allocation of Functions and Data. Component Interfaces

Génie Logiciel et Gestion de Projets. Patterns

SOACertifiedProfessional.Braindumps.S90-03A.v by.JANET.100q. Exam Code: S90-03A. Exam Name: SOA Design & Architecture

Software Design. Design (I) Software Design Data Design. Relationships between the Analysis Model and the Design Model

Definition: Software Architecture

Construction Principles and Design Patterns. Flyweight, Bridge, Builder

Ingegneria del Software Corso di Laurea in Informatica per il Management. Object Oriented Principles

Web Application Architectures

Designing framework for web development

Software Refactoring using New Architecture of Java Design Patterns

A Review of an MVC Framework based Software Development

Developing GUI Applications: Architectural Patterns Revisited

Literature Review Service Frameworks and Architectural Design Patterns in Web Development

Software Life-Cycle Management

Implementing reusable software components for SNOMED CT diagram and expression concept representations

Service Oriented Architecture 1 COMPILED BY BJ

Structural Patterns. Structural Patterns. Fritz Solms. October 16, 2015

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

Engineering Design. Software. Theory and Practice. Carlos E. Otero. CRC Press. Taylor & Francis Croup. Taylor St Francis Croup, an Informa business

Aspect-Oriented Programming

UML other structural. diagrams. (Implementation Diagrams UML 1.5) Università di Padova. Facoltà di Scienze MM.FF.NN. Informatica - anno

Service Oriented Architecture (SOA) An Introduction

2 (18) - SOFTWARE ARCHITECTURE Service Oriented Architecture - Sven Arne Andreasson - Computer Science and Engineering.

Service-Oriented Architecture and Software Engineering

Distributed Objects and Components

U III 5. networks & operating system o Several competing DOC standards OMG s CORBA, OpenDoc & Microsoft s ActiveX / DCOM. Object request broker (ORB)

Software Engineering. Software Engineering. Component-Based. Based on Software Engineering, 7 th Edition by Ian Sommerville

Component Based Development Methods - comparison

Application of MVC Platform in Bank E-CRM

Architectural patterns

Client-Server Applications

Architectural Patterns (3)

Software Engineering

zen Platform technical white paper

A Brief Analysis of Web Design Patterns

GenericServ, a Generic Server for Web Application Development

Organization. Introduction to Software Engineering

Dynamic Adaptability of Services in Enterprise JavaBeans Architecture

Click DVDs. Just click to pick. CS4125 Systems Analysis and Design Chantelle Geoghegan Danielle Frawley

Experiences with ALM tools in Software Engineering course

Distributed systems. Distributed Systems Architectures

A Pattern System for Network Management Interfaces

Service-Orientation and Next Generation SOA

Quality Ensuring Development of Software Processes

Commercial software development with the help of J2EE architecture and MVC

Corso: Administering Microsoft SQL Server 2012 Databases Codice PCSNET: MSQ2-1 Cod. Vendor: Durata: 5

Implementing Enterprise Integration Patterns Using Open Source Frameworks

Service Oriented Architectures

Using MDA in Web Software Architectures

10 Years of Hype Cycles - Do We Forget Knowledge?

P09. Architecture Patterns

Java Technology in the Design and Implementation of Web Applications

Xtreme RUP. Ne t BJECTIVES. Lightening Up the Rational Unified Process. 2/9/2001 Copyright 2001 Net Objectives 1. Agenda

XFlash A Web Application Design Framework with Model-Driven Methodology

Core J2EE Patterns, Frameworks and Micro Architectures

Design Patterns for Complex Event Processing

Lesson 18 Web Services and. Service Oriented Architectures

Moving from EAI to SOA An Infosys Perspective

Software Architecture. New wine in old bottles? (i.e., software architecture global design?, architect designer)

Event-based middleware services

Swirl. Multiplayer Gaming Simplified. CS4512 Systems Analysis and Design. Assignment Marque Browne Manuel Honegger

Architectural Design with Visualization Patterns

Broker Revisited Michael Kircher, Markus Voelter, Klaus Jank, Christa Schwanninger, Michael Stal

Software Architecture Document

Transcription:

rel. 1.7 Università di Padova Facoltà di Scienze MM.FF.NN Informatica - anno 2008-09 Corso di Ingegneria del Software Pattern seconda parte Renato Conte - Pattern II- 1/48 - Types of software patterns design patterns (software design) architectural (systems design) [POSA]* design (micro-architectures) [Gamma-GoF] idioms (low level)... analysis patterns (recurring & reusable analysis models) [Flower] organization patterns (structure of organizations/projects) process patterns (software process design) domain-specific patterns * Pattern Oriented Software Architecture Renato Conte - Pattern II- 2/48 - Architectural Patterns Types of patterns Expresses a fundamental structural organization or schema for software systems Design Patterns Provides a scheme for refining the subsystems or components of a software system, or the relationships between them. It describes a commonly-recurring structure of communicating components that solves a general design problem within a particular context....other good guidance... some GRASP Idioms An idiom describes how to implement particular aspects of components or the relationships between them using the features of the given language. An Idiom is a low-level pattern specific to a programming language. Renato Conte - Pattern II- 3/48 - Renato Conte - Pattern II- 4/48 -

GRASP General Responsibility Assignment Software Patterns (Pattern generali per l assegnamento delle responsabilità nel software) Which class, in the general case is responsible? You want to assign a responsibility to a class You want to avoid or minimize additional dependencies You want to maximise cohesion and minimise coupling You want to increase reuse and decrease maintenance You want to maximise understandability..etc. Low Coupling Problem: To support low dependency and increased reuse? Solution: Assign responsibilities so that coupling remains low. Renato Conte - Pattern II- 5/48 - Renato Conte - Pattern II- 6/48 - Coupling? TypeX? TypeY In object oriented languages, common form of coupling from TypeX to TypeY include: TypeX has an attribute (data member or instance variable) that refers to a TypeY instance, or TypeY itself. TypeX has a method which references an instance of TypeY, or TypeY itself, by any means. These typically include a parameter or local variable of type TypeY, or the object returned from a message being an instance of TypeY. TypeX is a direct or indirect subclass of TypeY. TypeY is an interface, and TypeX implements that interface. Coupling? Coupling is a measure of how strongly one class is connected to, has knowledge of, or relies upon other classes. A class with high coupling relies upon many other classes; this is undesirable because: Changes in related classes force local changes; Harder to understand in isolation; Harder to reuse because its use requires the additional presence of classes it is dependent upon Renato Conte - Pattern II- 7/48 - Renato Conte - Pattern II- 8/48 -

Low coupling High Cohesion How can we make classes independent of other classes? Classes are easier to maintain Easier to reuse Changes are localized Problem: To keep complexity manageable? Solution: Assign responsibilities so that cohesion remains high. Renato Conte - Pattern II- 9/48 - Renato Conte - Pattern II- 10/48 - Cohesion Cohesion is a measure of how strongly related and focused the responsibilities of a class are. A class with low cohesion does many unrelated things or does too much work. Low cohesion brings the following problems: hard to comprehend hard to reuse hard to maintain delicate; constantly effected by change Some examples: Very Low Cohesion: A Class is solely responsible for many things in very different functional areas Low Cohesion: A class has sole responsibility for a complex task in one functional area. High Cohesion. A class has moderate responsibilities in one functional area and collaborates with classes to fulfil tasks. Renato Conte - Pattern II- 11/48 - Renato Conte - Pattern II- 12/48 -

High cohesion Classes are easier to maintain Easier to understand Often support low coupling Supports reuse because of fine grained responsibility Renato Conte - Pattern II- 13/48 - Renato Conte - Pattern II- 14/48 - Architectural Patterns Architectural patters represent the highest-level patterns in our pattern system. They help you to specify the fundamental structure of an application. Architecture defined Architecture establishes the context for design and implementation Every development activity that follows is governed by this structure-for example, the detailed design of subsystems, the communication and collaboration between different parts of the system, and its later extension. Each architectural pattern helps you to achieve a specific global system property, such as the adaptability of the user interface. CODE design implementation architecture Architectural decisions are the most fundamental decisions; changing them will have significant ripple effects. Renato Conte - Pattern II- 15/48 - Renato Conte - Pattern II- 16/48 -

pattern architetturale [Buschmann+al., 1996] Un pattern architetturale esprime un'organizzazione fondamentale della struttura o lo schema di un sistema software. Definisce un insieme di sotto-sistemi predefiniti, specifica le loro responsabilità, e include regole e linee guida per organizzare le relazioni tra di loro. Architectural Patterns adaptable systems Reflection Microkernel pattern high-level system subdivisions Pipes and Filters interactive systems Broker Pattern Layers pattern Blackboard pattern Model View Controller Presentation-Abstraction-Control distributed systems Renato Conte - Pattern II- 17/48 - Renato Conte - Pattern II- 18/48 - Layers examples Layers pattern The Layers pattern helps to structure applications that can be decomposed into groups of subtasks in which each group of subtasks is at a particular level of abstraction Apart from the usual advantages of modular software with well defined interfaces, the tier architecture is intended to allow any of the tiers to be upgraded or replaced independently as requirements or technology change. networking protocols Renato Conte - Pattern II- 19/48 - Renato Conte - Pattern II- 20/48 -

multi-layer (multi-tier) Layered Architecture ( & reusable objects) Presentation Tier Application Tier Logic Tier Business Logic Tier Data Tier Application-specific layer Application Application Application Car Sales Management Presentazione GUI Logica Applicativa Oggetti del dominio del problema Vendita Pagamenti Oggetti dei servizi per l accesso ai dati Database Broker Security Manager Memorizzazione Dati Database Application-general layer Middleware layer -software layer Customer profile Order management Shopping cart Credit card authorization Object persistency mechanism Renato Conte - Pattern II- 21/48 - Renato Conte - Pattern II- 22/48 - Model-View-Controller pattern MVC: diagramma delle classi The Model-View-Controller pattern (MVC) divides an interactive application into three components: The model contains the core functionality and data. Views display information to the user Controllers handle user input Views and controllers together comprise the user interface. A change-propagation mechanism ensures consistency between the user interface and the model Renato Conte - Pattern II- 23/48 - Renato Conte - Pattern II- 24/48 -

Model-View-Controller :View User Actions Get Data State Change Notification :Controller User Event Model Encapsulates Data presented by view View Renders Model Data Controller Model Controller View Controller Responds to user actions :Model Call Model Action Model is loosely coupled from view State change communicated through notification. Multiple views can be implemented for same model Renato Conte - Pattern II- 26/48 - Esempio di diagramma di comunicazione per un MVC Renato Conte - Pattern II- 27/48 - Renato Conte - Pattern II- 28/48 -

Presentation-Abstraction-Control pattern PAC The Presentation-Abstraction-Control pattern (PAC) defines a structure for interactive software systems in the form of a hierarchy of cooperating agents. Every agent is responsible for a specific aspect of the application's functionality and consists of three components: presentation, abstraction, and control. This subdivision separates the human-computer interaction aspects of the agent from its functional core and its communication with other agents. hierarchical structure of agents Renato Conte - Pattern II- 29/48 - Renato Conte - Pattern II- 30/48 - Presentation-Abstraction-Control PAC Renato Conte - Pattern II- 31/48 - Renato Conte - Pattern II- 32/48 -

pac Broker pattern The Broker pattern can be used to structure distributed software systems with decoupled components that interact by remote service invocations. A broker component is responsible for coordinating communication, such as forwarding requests, as well as for transmitting results and exceptions. CORBA Browser Web Renato Conte - Pattern II- 33/48 - Renato Conte - Pattern II- 34/48 - Blackboard pattern The Blackboard pattern is useful for problems for which no deterministic solution strategies are known. In Blackboard several specialized subsystems assemble their knowledge to build a possibly partial or approximate solution. Renato Conte - Pattern II- 35/48 - Renato Conte - Pattern II- 36/48 -

blackboard blackboard Renato Conte - Pattern II- 37/48 - Renato Conte - Pattern II- 38/48 - Reflection pattern reflection The Reflection pattern provides a mechanism for changing structure and behavior of software systems dynamically. It supports the modification of fundamental aspects, such as type structures and function call mechanisms. In this pattern, an application is split into two parts. A meta level provides information about selected system properties and makes the software self-aware. A base level includes the application logic. Its implementation builds on the meta level. Changes to information kept in the meta level affect subsequent base-level behavior. Renato Conte - Pattern II- 39/48 - Renato Conte - Pattern II- 40/48 -

Microkernel pattern microkernel The Microkernel pattern applies to software systems that must be able to adapt to changing system requirements. It separates a minimal functional core from extended functionality and customer-specific parts. The microkernel also serves as a socket for plugging in these extensions and coordinating their collaboration. Renato Conte - Pattern II- 41/48 - Renato Conte - Pattern II- 42/48 - Pipes and Filters pattern The Pipes and Filters pattern provides a structure for systems that process a stream of data. Each processing step is encapsulated in a filter component. Data is passed through pipes between adjacent filters. Recombining filters allows you to build families of related systems. Renato Conte - Pattern II- 44/48 -

pipe pipe Renato Conte - Pattern II- 45/48 - Renato Conte - Pattern II- 46/48 - Bibliografia Craig Larman Applying UML and Patterns An Introduction to Object-Oriented Analysis and Design and Iterative Development Edition 3 2004 0-13-148906-2 Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software Addison-Wesley Professional Computing Series - 1994 F. Buschmann,R. Meunier,H. Rohnert,P. Sornmerlad,M. Stal PATTERN-ORIENTED SOFTWARE ARCHITECTURE John Willey & sons- 1996 Renato Conte - Pattern II- 47/48 - http://www.cetus-links.org/oo_patterns.html Web reference The Patterns Home Page - hillside.net/patterns/ Hosted by The Hillside Group provides information about patterns, links to online patterns, papers and books dealing with patterns, and patterns-related mailing lists. The Patterns-Discussion - g.oswego.edu/dl/pd-faq/pd-faq.html FAQ maintained by Doug Lea provides a very thorough and highly readable FAQ about patterns. Patterns and Software - www.enteract.com/~bradapp/docs/patterns-intro.html Essential Concepts and Terminology by Brad Appleton provides another thorough and readable account of the patterns field. Patterns - home.earthlink.net/~huston2/dp/patterns.html Dozens of 1-page examples in C++ and Java. Before-and-After refactoring examples. Book summaries. Renato Conte - Pattern II- 48/48 -