Programação de Sistemas Distribuidos

Similar documents
Object-Oriented Software Development Goal and Scope

Learning patterns of application architecture by looking at code

Model-View-Controller

Towards Better Support for Pattern-Oriented Software Development

Coordination Patterns

Introduction to Design Patterns

Introduction to Design Patterns

Data Synchronization Patterns in Mobile Application Design

COMP9321 Web Application Engineering

Transparent Remote Access

Work groups meeting 3

Patterns for Decoupling

WS01/02 - Design Pattern and Software Architecture

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D

Design Patterns. Gunnar Gotshalks A4-1

CS/CE 2336 Computer Science II

Design Patterns. An introduction

Distributed Systems Development

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

A Metric of the Relative Abstraction Level of Software Patterns

A Metric for Measuring the Abstraction Level of Design Patterns

Patterns. Erich Gamma Richard Helm Ralph Johnson John Vlissides

Work groups meeting 3

Mod4j Application Architecture. Eric Jan Malotaux

Incorporating applications to a Service Oriented Architecture

Mining Relationships Between the Participants of Architectural Patterns

Chapter 10: Performance Patterns

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

COMP9321 Web Application Engineering

Broker Pattern. Teemu Koponen

Using Design Patterns in Java Application Development

CPSC 310 Software Engineering. Lecture 11. Design Patterns

A Pattern Language for MVC Derivatives

Design for Testability

X-S Framework Leveraging XML on Servlet Technology

JDBC Today C HAPTER 1 INTRODUCTION

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software

Design Patterns. Observations. Electrical Engineering Patterns. Mechanical Engineering Patterns

3 Product Management Anti-Patterns by Thomas Schranz

NCOIC Interoperability Framework (NIF ) and NCOIC Patterns Overview

Using a Declarative Chain of Responsibility Pattern to Write Robust, Self- Correcting Distributed Applications

Distributed Proxy: A Design Pattern for Distributed Object Communication

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Reference: Java Web Services Architecture James McGovern, Sameer Tyagi, Michael Stevens, and Sunil Mathew, 2003

An Introduction to Patterns and Pattern Languages. Overview. Patterns -- Why? Patterns -- Why?

PersistF: A Transparent Persistence Framework with Architecture Applying Design Patterns

Initial contents proposal. List of topics. Common Architectural Styles. Architectural Styles. A sample from Elements of Software Architecture

Lecture 19: Introduction to Design Patterns

DESIGN PATTERN - INTERVIEW QUESTIONS

Outline. Design Patterns. Observer Pattern. Definitions & Classifications

Design patterns. Valentina Presutti courtesy of Paolo Ciancarini

More on Design. CSCI 5828: Foundations of Software Engineering Lecture 23 Kenneth M. Anderson

CSC7203 : Advanced Object Oriented Development. J Paul Gibson, D311. Design Patterns

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

Dynamic Data Access Object Design Pattern (CECIIS 2008)

Dynamic Data Access Object Design Pattern (CECIIS 2008)

Sun Java TM Composite Applications Platform Suite Implementing Selected EAI Patterns

Application Servers in E-Commerce Applications

Design Patterns For Object Oriented Software Development Acm Press

OBJECT-ORIENTED MODELING AND DESIGN. Introduction

CS 575: Software Design

Patterns for Asynchronous Invocations in Distributed Object Frameworks

SOFTWARE PATTERNS. Joseph Bonello

Next-Generation Data Programming: Service Data Objects A Joint Whitepaper with IBM and BEA

Chapter 12 (revised by JAS)

(9A05803) WEB SERVICES (ELECTIVE - III)

SPIM Architecture for MVC based Web Applications

Pattern-Based Architectural Design Process Model

Distribution and Integration Technologies

JUnit A Study on Applying JUnit Framework to Document Knowledge of Object-Oriented Software Systems

An Introduction to Patterns

Towards a Java Framework for Knowledge Representation and Inference

Crash course on design patterns

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CHAPTER 6: CREATIONAL DESIGN PATTERNS

Web Applications: A Simple Pluggable Architecture for Business Rich Clients

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Advanced Object Oriented PHP

Enterprise Integration Patterns Exemplified in Java Business Integration

Lesson 19 Software engineering aspects

Choice, Choices, Choices: Fat versus Thin Clients

Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming

Freeway Patterns for SOA Systems Vinod Sarma N MindTree Ltd. Global Village, RVCE Post, Mysore Rd Bangalore , India

Lecture 13: Design Patterns

Applying the Observer Design Pattern

Pattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository

Software Architecture

A System of Patterns for Web Navigation

Application Architectures, Design Patterns

SUMMARY LAYERED ARCHITECTURE

PATTERN-ORIENTED ARCHITECTURE DESIGN OF SOFTWARE FOR LOGISTICS AND TRANSPORT APPLICATIONS

Services Oriented Architecture and the Enterprise Services Bus

Reusability Evaluation of a Domain-Specific Web Application Framework

Inheritance. EEC 521: Software Engineering. Dealing with Change. Polymorphism. Software Design. Changing requirements Code needs to be flexible

Generating Systems from XML Design Patterns:

Foundations of Software Engineering Design Patterns -- Introduction

Transcription:

Programação de Sistemas Distribuidos Paulo Gandra de Sousa psousa@dei.isep.ipp.pt Mestrado em Engenharia Informática DEI/ISEP

Disclaimer Parts of this presentation are from: Paulo Sousa (PARS) Ron Jacobs (ARC01) 1

Today s lesson Design Patterns Patterns for distributed Systems Service Orientation 2

3 DESIGN PATTERNS

What is a Pattern? Each pattern describes a problem that occurs over and over again in our environment and then describes the core of the solution to that problem in such a way that you can use this solution a million times over without ever doing it the same way twice. Christopher Alexander 4

What is a design Pattern? A design pattern names, abstracts, and identifies the key aspects of a common design structure that make it useful for creating a reusable object-oriented design. Design Patterns-Elements of Reusable Object-oriented Software, Gamma et al. (Gang of Four) 5

What a pattern is not A miracleous receipt 6 source: British Medical Journal

What is a pattern A set of best-practices A typified solution for a common problem in a giving context Creates a common vocabulary Patterns are discovered not invented Patterns are half-baked Martin Fowler 7

Anti-pattern Na example of what not to do Proven techniques that have shown bad results 8

PATTERNS FOR DISTRIBUTED APPLICATIONS 14

Architecture client application server application contract Data Transfer Object Service Gateway Remote Façade Service Layer Business logic 15

Pattern Service Gateway An object that encapsulate the code that implements the consumer portion of a contract. They act as proxies to other services, encapsulating the details of connecting to the source and performing any necessary translation. 16 fonte: Enterprise Solution Patterns Using.NET

Pattern Service Gateway Hides the details of accessing the service (ex., network protocol) May be considered a data access component Native support from most tools (e.g., Visual Studio, Netbeans, Rational software Architect) by web service proxies See also Proxy and Broker pattern 17

Pattern Remote Façade Provides a coarse-grained façade on fine-grained objects to improve efficiency over a network 18 fonte: Patterns of Enterprise Application Architecture

Pattern Remote Facade Domain object interfaces are tipically fine grained Inadequeate for remote operations Create a surronding layer above domain objects Local clients use the local interface The facade may encapsulate the interface of one or more business objects Domain objects: Address.New Address.Set Person.AddAddress Person.Update Remote Facade: AddressFacade.AddNewAddressToPerson 19

Pattern Data Transport Object An object that carries data between processes in order to reduce the number of method calls. 20 fonte: Patterns of Enterprise Application Architecture

Pattern Data Transport Object Since XML is the de facto standard DTO should support serialization to/from XML Should be independent of the underlying domain object Should be implemented in accordance with the requiremnts of the remote application CompleteCustomerInfoDTO BasicCustomerInfoDTO Should be independent of the underlying platform (e.g., programming language) DataSet/DataTable.net ResultSet JDBC DateTime.net 21

Pattern Service Layer Defines an application's boundary with a layer of services that establishes a set of available operations and coordinates the application's response in each operation 22 fonte: Patterns of Enterprise Application Architecture

Pattern Service Layer Domain logic pattern in the context of service orientation May be implemented as a Remote Facade or may be called by a Remote Facade 23

Service locator Hides the complexity of finding and creating service gateways 24 fonte: Core J2EE Patterns

Business Logic Outside of the scope Excellent reference: Patterns of Enterprise Application Architecture Table Module Table Data Gateway Domain Model Active Record Data Mapper Optimistic Offline Lock 28

29 SERVICE ORIENTATION

Definitions Contract A funcionality provided by a party Service An endpoint that fullfills one or more contracts Service Orientation An architectural paradigm that employs the four tennets 30

The four tennets of SO Boundaries are explicit Share schema and contract not types Policy define service compatibility Services are autonomous 31

Boundaries are explicit Service boundaries are explicit and the cost of crossing a boundary is known A boundary is the border between the service public interface and its internal implementation Services interact intentionaly and explicitly by exchanging messages 32

Share schema and contract not types Services expose schemas defining data structures and contracts defining available operations Contracts and schema may be independently versioned over time 33

Policy define service compatibility Policy is the statement of communication requirements necessary for service interaction Service capabilities and requirements are expressed in terms of a policy expression A policy can contain multiple assertions 34

Services are autonomous Services are independently deployed, versioned and managed Autonomy Independence Topology of a system evolves over time Unlike OO, services do not share behavior Services gracefully handle failure 35

Service Anti-patterns CRUDy interface Design the same old CRUD interface verbose Loosey-Goosey Design highly flexible interface E.g., Expose direct SQL access In the intent to provide flexibility, there is no service contract 36

Service Patterns Document Processor Provide a document centric contract, not an RPC-like contract Reservation Allow for long running transactions without locking Must have compensation procedure 37

Exercise Remember the example DS you provided in the last session. Define an hypothetical SOA for that system Define contract Identify where you would use the presented patterns 38

Bibliography Buschmann, F.; Henney, K. And Schmidt, D. (2007) Pattern- Oriented Software Architecture: A Pattern Language for Distributed Computing, Volume 4. Willey. Patterns of Enterprise Application Architecture. Martin Fowler. Adisson-Wesley. Core J2EE Patterns: Best Practices and Design Strategies. Deepak Alur, John Crupi and Dan Malks. Prentice Hall / Sun Microsystems Press. http://java.sun.com/blueprints/corej2eepatterns/index.html Enterprise Solution Patterns Using Microsoft.NET. Microsoft Press. http://msdn.microsoft.com/architecture/patterns/default.aspx?p ull=/library/en-us/dnpatterns/html/esp.asp 39

Suggested readings Design patterns : elements of reusable object-oriented software. Erich Gamma, Richard Helm, Ralph Johnson, John Vissides. Pattern-oriented Software Architecture: System of Patterns. Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, Michael Stal Designing Data Tier Components and Passing Data Through Tiers. Microsoft Patterns & Practices. http://msdn.microsoft.com/library/?url=/library/enus/dnbda/html/boagag.asp?frame=true 40