Guida Metodologica Pattern Architetturali Java SQC609006 Ver

Total Page:16

File Type:pdf, Size:1020Kb

Guida Metodologica Pattern Architetturali Java SQC609006 Ver FUNZIONE QUALITÀ E SICUREZZA Controllo delle copie Il presente documento, se non preceduto dalla pagina di controllo identificata con il numero della copia, il destinatario, la data e la firma autografa del Responsabile della Qualità, è da ritenersi copia informativa non controllata. Guida Metodologica Pattern Architetturali Java SQC609006 ver. 2 Guida Metodologica Pattern Architetturali Java SQC609006 VER. 2 Pag. 1/42 FUNZIONE QUALITÀ E SICUREZZA Sommario 1 Scopo e campo di applicazione 3 2 Riferimenti 3 2.1 Controllo del Documento: Stato delle revisioni 3 2.2 Documenti esterni 3 2.3 Documenti interni 3 2.4 Termini e Definizioni 3 3 Introduzione 4 4 Design pattern 5 5 Vantaggi dei pattern 5 6 Pattern di creazione 6 6.1 Singleton 6 6.2 Factory Method 6 6.3 Prototype 8 6.4 Abstract Factory 9 6.5 Builder 10 7 Pattern di struttura 10 7.1 Facade 10 7.2 Composite/Container 12 7.3 Adapter 13 7.4 Proxy/Stub 14 7.5 Decorator o Filter 15 7.6 Flyweight 16 8 Pattern di comportamento 17 8.1 Template Method 17 8.2 Chain of Responsibility 18 8.3 Iterator o Enumeration 18 8.4 Command 19 8.5 Mediator 20 8.6 Observer 22 8.7 State 23 8.8 Strategy 24 8.9 Visitor 25 9 Presentation tier pattern 26 9.1 Model-View-Controller 26 9.2 Estensioni del pattern MVC 27 9.2.1 Front Controller 27 9.2.2 Service to Worker 28 9.3 View Avanzate 29 9.3.1 View Helper 29 9.3.2 Composite View 30 10 Business tier pattern 32 10.1 Composite Entity 32 10.2 Business Delegate 33 10.3 Session Facade 34 10.4 Service Locator 36 10.5 Service Activator 38 11 Communication Pattern 39 11.1 Data Transfer Object Pattern (DTO) 39 12 Data Access Pattern 40 12.1 Data Access Object Pattern (DAO) 41 Guida Metodologica Pattern Architetturali Java SQC609006 VER. 2 Pag. 2/42 FUNZIONE QUALITÀ E SICUREZZA 1 Scopo e campo di applicazione Scopo del presente documento è fornire una panoramica dei pattern più comuni usati nella programmazione ad oggetti. Sebbene nel trattare i pattern ci si possa astrarre dal linguaggio di programmazione utilizzato, questo documento farà riferimento esplicito al loro impiego nel linguaggio Java e, più in particolare, nella tecnologia j2ee. Come conseguenza, essendo il tema trattato di natura prettamente tecnica, ovvero corredato nella sua esposizione da diagrammi, codici d’esempio, scenari comuni e casi reali, si ritiene necessario che il lettore possieda una buona conoscenza dei principi dell'object-orientation e della programmazione in Java. Un pò di pratica di programmazione è di sicuro aiuto perché affrontare i pattern avendo già una esperienza implementativa permette di riconoscerli più facilmente. 2 Riferimenti 2.1 Controllo del Documento: Stato delle revisioni Vers. Descrizione delle modifiche apportate nella revisione alla versione precedente Cap. modificati 2 Revisione Logo Aziendale N.A. 2.2 Documenti esterni • NORMA UNI EN ISO 9001:2008 - Sistemi di gestione per la qualità – Requisiti; • NORMA UNI EN ISO 9004:2000 - Sistemi di gestione per la qualità - Linee guida per il miglioramento delle prestazioni; • NORMA UNI EN ISO 9000:2005 - Sistemi di gestione per la qualità – Fondamenti e terminologia • A Pattern Language: Towns, Buildings, Construction [C. Alexander; Oxford University Press; 1977] • Design Patterns, Elements of Reusable Object-Oriented Software [E. Gamma, R. Helm, R. Johnson, J. Vlissides (Gang Of Four - GOF); Addison Wesley; 1995] • A System of Patterns [F. Bushmann, R. Meunier, H. Rohnert, P. Sommerlad, M. Stal (Gang of Five); John Wiley & Sons; 1996] • Nota Informativa - Design Patterns e Idiomi Java [E. Grasso, 1998] • The Design Patterns Java Companion [J. W. Cooper; Addison Wesley; 1998] • Advanced JavaServer Pages [D.M.Geary; Prentice Hall PTR; 2001] • EJB™ Design Patterns - Advanced Patterns, Processes, and Idioms [F. Marinescu; John Wiley & Sons; 2002] • J2EE Design Patterns [W. Crawford, J. Kaplan; O'Reilly; 2003] 2.3 Documenti interni Manuale della Qualità ACI Informatica; Sistema di Gestione per la Qualità vigente. Guida Metodologica Linee Guida Naming & Coding Conventions per Java Guida Metodologica Java Best Practices 2.4 Termini e Definizioni Per i termini, sigle e acronimi contenuti in questo documento si fa riferimento al Glossario dei termini utilizzati nel Sistema Qualità. Framework software che provvede ad uno strato di isolamento tra le applicazioni e le specifiche implementazioni di risorse o servizi al di sotto di esse. Idioma Un idioma è un soluzione di basso livello che esprime un dettaglio implementativo di un componente in relazione ad un determinato linguaggio ed alle sue caratteristiche. Un esempio può essere preso dalla programmazione Java dove uno degli idiomi più usati è il ciclo: Esempio 1 for (i=0; i<max; i++) { … //do something } Libreria Traduzione del temine inglese library . Il termine identifica in generale un insieme di funzioni, procedure o servizi a disposizione dell'utente, solitamente nelle vesti di programmatore. A grandi linee, le library possono essere classificate a seconda della tipologia di binding (ovvero la modalità con cui vengono "attaccate" al Programma che le utilizza) in dinamiche o statiche . Guida Metodologica Pattern Architetturali Java SQC609006 VER. 2 Pag. 3/42 FUNZIONE QUALITÀ E SICUREZZA 3 Introduzione La fase di progettazione di un sistema software è un’attività cruciale che si interpone tra la fase di analisi e quella di implementazione. Durante la fase di progettazione viene approfondito e specializzato quanto prodotto dalla precedente fase di analisi per avvicinarsi a quanto utile e specifico alla successiva fase d implementazione. E’ per questo che non è raro che la fase di progettazione introduca, rispetto ai modelli iniziali dell’analisi, nuovi oggetti, nuove responsabilità, nuove relazioni e nuove regole di collaborazione. Non che si tratti, ovviamente, di uno stravolgimento strutturale o di una decisa correzione di rotta. Fattori riconducibili a decisioni di quel tipo, del resto, dovrebbero piuttosto comportare una ripartenza o una iterazione dell’intero processo dalle sue fasi iniziali. Piuttosto si tratta dell’evoluzione del sistema dalla sua idea in astratto alla sua applicazione nel concreto, ovvero della necessità di calare la struttura ed il funzionamento teorico del sistema verso la realtà pratica dei linguaggi, delle tecnologie, degli ambienti operativi che saranno il target dell’implementazione Fare una buona progettazione ha, per questo, molto a che vedere con l’esperienza e la conoscenza pratica. In effetti, molto del lavoro di un buon progettista è fondato sulla conoscenza pratica acquisita, cioè sull’uso di soluzioni sperimentate con successo nel passato per risolvere problemi simili. In altre parole, un progettista esperto, avendo maturato la conoscenza di molteplici scenari e soluzioni ed avendo da questi fatti suoi gli elementi di invarianza distintivi di alcune classi di problemi, è in grado di riconoscere, nello specifico di ogni sistema, la possibilità e lo spazio per l’applicazione di modelli (o pattern) di soluzioni noti. La parola “pattern”, in effetti, ha un significato molto più generale dell’italiano ‘modello’ o ‘campione’; nel contesto in esame, comunque, esso indica in qualche maniera una situazione o una problematica nota per cui si ha a disposizione almeno un approccio risolutivo. Il concetto di pattern è un concetto ingegneristico ma non necessariamente informatico. Tanto è vero che la prima definizione di patterrn, risalente al 1977, si deve a Christofer Alexander che la applicò nel campo dell’ingegneria civile. Nonostante ciò la definizione data da Alexander è ancora valida ed è applicabile senza nessuna variazione all’ingegneria informatica. Infatti, secondo Alexander: Definizione 1 Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to this problem in such a way that you can use this solution a million times over, without ever doing it the same way twice. Quindi un pattern serve a risolvere un problema ricorrente documentando una soluzione provata con successo diverse volte. I pattern non hanno la pretesa di inventare nulla. Sono solo una descrizione di pratiche di buon senso che normalmente si imparano dopo lunghi tirocini di esperienza. Un pattern non è inventato, ma riconosciuto, estrapolato e classificato. Il processo è induttivo: se mi accorgo di usare una certa soluzione per risolvere problemi simili, questa soluzione può essere analizzata, estrapolata dal contesto per renderla astratta e più facilmente applicabile in altri domini, e infine catalogata, indicando nome, problema, soluzione e conseguenze. In questo processo di astrazione, la descrizione del pattern diventa sufficientemente generica perché rappresenti la soluzione a una famiglia di problemi. Un pattern funziona come uno stampo in cui le sue componenti sono istanziate nei vari casi concreti. Guida Metodologica Pattern Architetturali Java SQC609006 VER. 2 Pag. 4/42 FUNZIONE QUALITÀ E SICUREZZA 4 Design pattern Tra i primi ad applicare il concetto di pattern al design a oggetti individuandone i più importanti sono stati Gamma, Helm, Johnson, Vlissides (detti GOF = Gang Of Four) con il libro “Design Patterns, Elements of Reusable Object-Oriented Software”, considerato la “bibbia” dei pattern. Il libro di Gamma e soci è soprattutto un catalogo di 23 pattern, ciascuno descritto sottolineando quattro elementi essenziali: 1. Nome . Sembra ovvio, ma dare nomi indicativi ai pattern è molto importante. Un nome è un modo immediato e veloce per individuare un problema di design. Avere questi nomi nel proprio vocabolario permette di comunicare con altri designer passando complesse soluzioni di design con il semplice scambio di una parola. Dire “qui ho usato il Singleton perché dovevo essere sicuro che la risorsa fosse allocata una sola volta” comunica immediatamente la soluzione al problema e il problema stesso. 2. Problema . Per definizione un pattern serve per risolvere un problema. 3. Soluzione . Descrive la struttura del pattern: gli elementi partecipanti e le forme di collaborazione e interazione tra questi.
Recommended publications
  • Design Pattern
    Sitesbay.com A Perfect Place for All Tutorials Resources Java Projects | C | C++ | DS | Interview Questions | JavaScript Core Java | Servlet | JSP | JDBC | Struts | Hibernate | Spring | Java Projects | C | C++ | DS | Interview Questions | Html | CSS | Html5 | JavaScript | Ajax | Angularjs | Basic Programs | C Project | Java Project | Interview Tips | Forums | Java Discussions www.sitesbay.com DESIGN PATTERN By SEKHAR SIR [Thursday, May 29, 2014] Recursive Problem:- If some problem occurs again and again in a particular context then we call it as a Recursive Problem. For example, if an audio player having support with MP2 files gets problem for MP3 files and having support for MP3 gets problem MP4. So it is a recursive problem. In a software application, for example a recursive problem will be transferring the data across layers. Q. Why Design Patterns? Ans:- Design patterns are used for solving recursive problems in a software application design. A design pattern is a description for how to solve a recursive problem. Design patterns are not a technology or a tool or a language or a platform or a framework. Design patterns are effective proven solutions for recursive problems. Q. How many Design Patterns? Ans:- Actually, there is no fixed count of no of design patterns because design patterns is not a package and not in the form of classes. SUN Microsystems constituted a group with four professional with the name of Gang of Four (GOF) to find effective solutions for the recursive problems. According to GOF, they found 23 design patterns as effective solutions for re-occurring problems. GOF divided java design patterns into 4 categories (a) Creational Design Patterns:- (1) Singleton Pattern.
    [Show full text]
  • POJO in Action.Book
    SAMPLE CHAPTER POJOs in Action by Chris Richardson Chapter 1 Copyright 2006 Chris Richardson contents PART 1OVERVIEW OF POJOS AND LIGHTWEIGHT FFFFFFFFFFFFFFFFRAMEWORKS .............................................1 Chapter 1 ■ Developing with POJOs: faster and easier 3 Chapter 2 ■ J2EE design decisions 31 PART 2A SIMPLER, FASTER APPROACH................... 59 Chapter 3 ■ Using the Domain Model pattern 61 Chapter 4 ■ Overview of persisting a domain model 95 Chapter 5 ■ Persisting a domain model with JDO 2.0 149 Chapter 6 ■ Persisting a domain model with Hibernate 3 195 Chapter 7 ■ Encapsulating the business logic with a POJO façade 243 PART 3VARIATIONS ........................................... 287 Chapter 8 ■ Using an exposed domain model 289 Chapter 9 ■ Using the Transaction Script pattern 317 Chapter 10 ■ Implementing POJOs with EJB 3 360 vii viii BRIEF CONTENTS PART 4DEALING WITH DATABASES AND CCCCCCCCCCCCCONCURRENCY .......................................405 Chapter 11 ■ Implementing dynamic paged queries 407 Chapter 12 ■ Database transactions and concurrency 451 Chapter 13 ■ Using offline locking patterns 488 Developing with POJOs: faster and easier This chapter covers ■ Comparing lightweight frameworks and EJBs ■ Simplifying development with POJOs ■ Developing an object-oriented design ■ Making POJOs transactional and persistent 3 4 CHAPTER 1 Developing with POJOs: faster and easier Sometimes you must use a technology for a while in order to appreciate its true value. A few years ago I had to go out of the country on a business trip, and I didn’t want to risk missing episodes of my favorite show. So, rather than continu- ing to struggle with the timer function on my VCR, I bought a TiVo box. At the time I thought it was simply going to be a much more convenient and reliable way to record programs.
    [Show full text]
  • Implementing Domain-Driven Design
    www.EBooksWorld.ir Praise for Implementing Domain-Driven Design “With Implementing Domain-Driven Design, Vaughn has made an important con- tribution not only to the literature of the Domain-Driven Design community, but also to the literature of the broader enterprise application architecture field. In key chap- ters on Architecture and Repositories, for example, Vaughn shows how DDD fits with the expanding array of architecture styles and persistence technologies for enterprise applications—including SOA and REST, NoSQL and data grids—that has emerged in the decade since Eric Evans’ seminal book was first published. And, fittingly, Vaughn illuminates the blocking and tackling of DDD—the implementation of entities, value objects, aggregates, services, events, factories, and repositories—with plentiful exam- ples and valuable insights drawn from decades of practical experience. In a word, I would describe this book as thorough. For software developers of all experience levels looking to improve their results, and design and implement domain-driven enterprise applications consistently with the best current state of professional practice, Imple- menting Domain-Driven Design will impart a treasure trove of knowledge hard won within the DDD and enterprise application architecture communities over the last cou- ple decades.” —Randy Stafford, Architect At-Large, Oracle Coherence Product Development “Domain-Driven Design is a powerful set of thinking tools that can have a profound impact on how effective a team can be at building software-intensive systems. The thing is that many developers got lost at times when applying these thinking tools and really needed more concrete guidance. In this book, Vaughn provides the missing links between theory and practice.
    [Show full text]
  • [ Team Lib ] Crawford and Kaplan's J2EE Design Patterns Approaches
    [ Team LiB ] • Table of Contents • Index • Reviews • Reader Reviews • Errata J2EE Design Patterns By William Crawford, Jonathan Kaplan Publisher: O'Reilly Pub Date: September 2003 ISBN: 0-596-00427-3 Pages: 368 Crawford and Kaplan's J2EE Design Patterns approaches the subject in a unique, highly practical and pragmatic way. Rather than simply present another catalog of design patterns, the authors broaden the scope by discussing ways to choose design patterns when building an enterprise application from scratch, looking closely at the real world tradeoffs that Java developers must weigh when architecting their applications. Then they go on to show how to apply the patterns when writing realworld software. They also extend design patterns into areas not covered in other books, presenting original patterns for data modeling, transaction / process modeling, and interoperability. [ Team LiB ] [ Team LiB ] • Table of Contents • Index • Reviews • Reader Reviews • Errata J2EE Design Patterns By William Crawford, Jonathan Kaplan Publisher: O'Reilly Pub Date: September 2003 ISBN: 0-596-00427-3 Pages: 368 Copyright Preface Audience Organization of This Book For Further Reading Conventions Used in This Book Comments and Questions Acknowledgments Chapter 1. Java Enterprise Design Section 1.1. Design Patterns Section 1.2. J2EE Section 1.3. Application Tiers Section 1.4. Core Development Concepts Section 1.5. Looking Ahead Chapter 2. The Unified Modeling Language Section 2.1. Origins of UML Section 2.2. The Magnificent Seven Section 2.3. UML and Software Development Lifecycles Section 2.4. Use Case Diagrams Section 2.5. Class Diagrams Section 2.6. Interaction Diagrams Section 2.7.
    [Show full text]
  • Domain-Specific Service Decomposition with Microservice Api Patterns
    DOMAIN-SPECIFIC SERVICE DECOMPOSITION WITH MICROSERVICE API PATTERNS Keynote, International Conference on Microservices 2019 Dortmund, Germany February 19, 2019 Prof. Dr. Olaf Zimmermann (ZIO) Certified Distinguished (Chief/Lead) IT Architect Institute für Software, HSR FHO [email protected] Abstract Service orientation is a key enabler for cloud-native application development. Microservices have emerged as a state-of-the-art implementation approach for realizations of the Service-Oriented Architecture (SOA) style, promoting modern software engineering and deployment practices such as containerization, continuous delivery, and DevOps. Designing (micro-)services interfaces to be expressive, responsive and evolvable is challenging. For instance, deciding for suited service granularities is a complex task resolving many conflicting forces; one size does not fit all. Domain- Driven Design (DDD) can be applied to find initial service boundaries and cuts. However, service designers seek concrete, actionable guidance going beyond high-level advice such as “turn each bounded context into a microservice”. Interface signatures and message representations need particular attention as their structures influence the service quality characteristics. This presentation first recapitulates prevalent SOA principles, microservices tenets and DDD patterns. It then reports on the ongoing compilation of complementary microservices API patterns and proposes a set of pattern-based, tool-supported API refactorings for service decomposition. Finally, the presentation highlights related research and development challenges. Page 2 © Olaf Zimmermann, 2019. Architecture of this Talk (“Micropresentations”) Introduction to Mythbusting Domain-Driven Design SOA 101 & Real-World Microservices Service Examples Tenets (Case Studies) Service Legend: Granularity and Loose Experience Coupling Architectural Literature Service Analysis Analysis & Design Refactoring (to Microservices) (Modeling) Patterns Microservice API Research Patterns (MAP) Pbs/Qs Opinions Page 3 © Olaf Zimmermann, 2019.
    [Show full text]
  • Groovy Basics
    SECOND EDITION COVERS GROOVY 2.4 Dierk König Paul King with Guillaume Laforge Hamlet D’Arcy Cédric Champeau Erik Pragt Jon Skeet FOREWORD BY James Gosling MANNING www.allitebooks.com FACETS OF GROOVY Object iteration methods Collection and map enhancements Dynamic typing Builders Static typing Optional typing GDK Type checker Threads, processes extensions Files, streams, IO, sockets Dynamic Inspections, converters, Method dispatch transformations Static Library Databases Lists, maps, ranges (SQL, NoSql) Web Services, REST, Closures XML, JSON Literals GStrings, multiline Parallel programming Modules Regular expressions Testing Elvis (?:) Swing, Ant Null-safe deref (?.) Templating, NIO Operators Spreads (*) Business rules Features Customizing Language Domain-specific languages Groovy Traits Full stack development Groovy beans, properties Usages Parallel, functional programming GPath Syntax Command line Optionals, command chains Ad hoc queries Implicit and explicit coercion and constructors REPL for interactive prototyping MOP methods Gaelyk, Ratpack, Vert.x, Spring Boot Grails, GORM, GSP, Griffon, Meta class, extensions GroovyFX Runtime Gradle, GContracts, Codenarc, Categories Spock Meta- Mixins programming Ecosystem GrooScript, Scriptom GPars, GroovyStream, FunctionalGroovy AST transformations Compile time GroovyServ, GVM Groovy for Android Licensed to Markwww.allitebooks.com Watson <[email protected]> Praise for the First Edition For anyone considering Groovy, or just interested in seeing what all of the fuss is around the features of dynamic languages, this book will deliver. —Gregory Pierce, JavaLobby.org Not just a language guide, this book presents the clear, readable, and enjoyable specification of Groovy … you should definitely read it. —Alexander Popescu, Mindstorm A real page-turner. Brilliant examples … all other programming books I know really fall behind. —Dr. Gernot Starke Excellent code samples ..
    [Show full text]
  • Transfer Object Dispatcher View Transfer Object Assembler Value List Handler J2EE Core Patterns Problem BLOG
    Software Design and Implementation J2EE Design Patterns Enterprise Software ● Enterprise is an organization of individuals or entities, working together to achieve some goals ● They have common needs for collaboration: information sharing, resource planning, customer management, etc. ● Enterprise software has to provide support for all of those needs ● B2B and B2C J2EE Patterns ● Same idea ● Application of GoF patterns ● Patterns are not isolated island ● J2EE specifics – Existing infrastructure – Enterprise environment – More complex – need (in depth) understanding of J2EE ● In the course we’ll consider only few patterns J2EE Patterns ● Pattern name ● Problem ● Forces (Motivation) ● Solution – Structure – Strategies ● Consequences ● Sample code ● Related Patterns Terminology ● EJB – Enterprise Java Bean ● POJO – Plain Old Java Object ● BMP – Bean Managed Persistence ● CMP – Container Managed Persistence ● DAO – Data Access Object J2EE and UML ● (Heavy) use of stereotypes – EJB – SessionEJB – EntityEJB – View – JSP – Servlet – Session – Singelton – Custom Tag – POJO Core J2EE Patterns http://java.sun.com/blueprints/corej2eepatterns/Patterns/ J2EE Core Patterns Presentation Tiers Business Tier Integration Tier Intercepting Filter Business Delegate Data Access Object Front Controller Service Locator Service Activator Context Object Session Façade Domain Store Application Controller Application Service Web Service Broker View Helper Business Object Composite View Composite Entity Service to Worker Transfer Object Dispatcher View Transfer
    [Show full text]
  • Domain-Driven Service Design Context Modeling, Model Refactoring and Contract Generation
    Domain-driven Service Design Context Modeling, Model Refactoring and Contract Generation Stefan Kapferer and Olaf Zimmermann University of Applied Sciences of Eastern Switzerland (HSR/OST), Oberseestrasse 10, 8640 Rapperswil, Switzerland fstefan.kapferer, [email protected] Abstract. Service-oriented architectures and microservices have gained much attention in recent years; companies adopt these concepts and sup- porting technologies in order to increase agility, scalability, and main- tainability of their systems. Decomposing an application into multiple independently deployable, appropriately sized services and then integrat- ing them is challenging. Domain-driven Design (DDD) is a popular ap- proach to identify (micro-)services by modeling so-called Bounded Con- texts and Context Maps. In our previous work, we proposed a Domain- specific Language (DSL) that leverages the DDD patterns to support ser- vice modeling and decomposition. The DSL is implemented in Context Mapper, a tool that allows software architects and system integrators to create domain-driven designs that are both human- and machine- readable. However, we have not covered the tool architecture, the iter- ative and incremental refinement of such maps, and the transition from DDD pattern-based models to (micro-)service-oriented architectures yet. In this paper, we introduce the architectural concepts of Context Map- per and seven model refactorings supporting decomposition criteria that we distilled from the literature and own industry experience; they are grouped and serve as part of a service design elaboration method. We also introduce a novel service contract generation approach that leverages a new, technology-independent Microservice Domain-Specific Language (MDSL). These research contributions are implemented in Context Map- per and being validated using empirical methods.
    [Show full text]
  • Supporting Migration to Microservices with Domain Driven Design
    Supporting Migration to Microservices with Domain Driven Design ANDRÉ MIGUEL SANTOS AZEVEDO Outubro de 2019 Supporting Migration to Microservices with Domain Driven Design André Miguel Santos Azevedo Dissertation to obtain the degree of Master in Informatics Engineering, Specialization Area of Software Engineering Advisor: Isabel Azevedo Jury: President: [President’s Name, DEI, ISEP] Members: [Member Name, DEI, ISEP] [Member Name, DEI, ISEP] Porto, October 2019 ii Dedicatória “Dedico o meu trabalho a todos os que me suportaram desde família, professores e colegas.” iii iv Resumo Uma empresa e-commerce com um marketplace disponível para todo o mundo tem crescido significativamente durante os anos, com mais clientes interessados e um aumento nas vendas. Com isto, o software cresceu com a tendência, numa arquitetura a nível monolítica. A área de processamento de encomendas foi a que se mais sentiu este aumento, com um serviço monolítico que integra múltiplas equipas de desenvolvimento com âmbitos de negócio abrangentes. A equipa apelidada de “ST” é uma das participantes, tendo como responsabilidades, a implementação e manutenção do software para Ocorrências em Encomendas e Devoluções. No entanto, para a equipa “ST” é cada vez mais complicado realizar alterações no seu software, visto que o domínio não é mais flexível, sendo uma tarefa difícil para os programadores, a sua compreensão e a sua evolução para novos requisitos de negócio. Aproveitando a tendência de evolução existente na plataforma, a equipa “ST” realizará uma migração do software de Ocorrências para uma arquitetura orientada a microserviços, com auxílio de Domain Driven Design, definindo os contextos limitados, desenhando os modelos de domínio, e implementando os respetivos serviços com a utilização de boas práticas de engenharia, como padrões de software.
    [Show full text]
  • Integration Patterns Integration Patterns
    Integration Patterns Integration Patterns patterns & practices David Trowbridge, Microsoft Platform Architecture Guidance Ulrich Roxburgh, Microsoft Consulting Services (Australia) Gregor Hohpe, ThoughtWorks, Inc. Dragos Manolescu, ThoughtWorks, Inc. E.G. Nadhan, EDS ISBN 0-7356-1850-X Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. © 2004 Microsoft Corporation. All rights reserved. Microsoft, MS-DOS, Windows, Windows NT, Windows Server, Active Directory, BizTalk, InfoPath, Visio, Visual Basic, and Visual Studio are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
    [Show full text]
  • Pojos in Action Fills a Void: the Need for a Practical Explanation of the Techniques Used at Various Levels for the Successful Building of J2EE Projects
    FROM OUR PEER REVIEW ... “Chris Richardson targets critical design issues for lightweight Java enterprise applications using POJOs with fantastic in-depth exam- ples. This book extends Martin Fowler’s great book, Enterprise Architecture Patterns, as well as the more recent Domain-Driven Design by Eric Evans, by providing practical design guidance and useful examples. It also addresses the architecture and design issues asso- ciated with Spring and Hibernate development, whereas Man- ning’s companion ‘in Action’ books focus primarily on the Spring and Hibernate technologies. “This is a powerful book for architects, senior developers, and consultants. It uniquely combines best practices and design wisdom to integrate domain-driven design and test-driven development for object-oriented Java enterprise applications using lightweight Spring, Hibernate, and JDO technologies. “The table of contents reflects the important topics that most architects and enterprise developers face every day. There is signifi- cant need for a book like this, which shows how to address many common and complex design issues with real-world examples. The content in this book is unique and not really available elsewhere.” DOUG WARREN Software Architect Countrywide Financial “POJOs in Action fills a void: the need for a practical explanation of the techniques used at various levels for the successful building of J2EE projects. This book can be compared with the less enterprise- oriented and more abstract J2EE Development without EJB by Rod Johnson, but Richardson offers a step-by-step guide to a successful J2EE project. The explanations of the various alternatives available for each step provide the main thrust of this book.
    [Show full text]
  • POSA Half Sync / Half Async
    Design Patterns MSc in Computer Science Produced Eamonn de Leastar ([email protected]) by ! Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie POSA Patterns Other sources - POSA - 5 Volumes! Volume 4 • Collates a terse description of large collection of patterns associated with Distributed Systems • Repeats patterns from earlier volumes in series + patterns from GoF and PoEAA • Extensive discussion on how multiple patterns participate in solving a given problem Catalog (Extract) • Sophisticated and Specialised From Mud To Structure: DOMAIN MODEL (182), LAYERS (185), MODEL-VIEW-CONTROLLER (188), PRESENTATION-ABSTRACTION-CONTROL (191), MICROKERNEL (194), REFLECTION (197), PIPES AND FILTERS (200), SHARED REPOSITORY (202), BLACKBOARD (205), and DOMAIN OBJECT (208). Distribution Infrastructure: MESSAGING (221), MESSAGE CHANNEL (224), MESSAGE ENDPOINT (227), Pattern Language MESSAGE TRANSLATOR (229), MESSAGE ROUTER (231), BROKER (237), CLIENT PROXY (240), REQUESTOR (242), INVOKER (244), CLIENT REQUEST HANDLER (246), SERVER REQUEST HANDLER (249), and PUBLISHER-SUBSCRIBER (234). Event Demultiplexing and Dispatching: REACTOR (259), PROACTOR (262), ACCEPTOR-CONNECTOR (265), and ASYNCHRONOUS COMPLETION TOKEN (268). Interface Partitioning: EXPLICIT INTERFACE (281), EXTENSION INTERFACE (284), INTROSPECTIVE INTERFACE (286), DYNAMIC INVOCATION INTERFACE (288), PROXY (290), BUSINESS DELEGATE (292), FACADE (294), COMBINED METHOD (296), ITERATOR (298), ENUMERATION METHOD (300), and BATCH METHOD (302). Component Partitioning: ENCAPSULATED IMPLEMENTATION (313), WHOLE-PART (317), COMPOSITE (319), MASTER-SLAVE (321), HALF-OBJECT PLUS PROTOCOL (324), and REPLICATED COMPONENT GROUP (326). Application Control: PAGE CONTROLLER (337), FRONT CONTROLLER (339), APPLICATION CONTROLLER (341), COMMAND PROCESSOR (343), TEMPLATE VIEW (345), TRANSFORM VIEW (347), FIREWALL PROXY (349), and AUTHORIZATION (351). Concurrency: HALF-SYNC/HALF-ASYNC (359), LEADER/FOLLOWERS (362), ACTIVE OBJECT (365), MONITOR OBJECT (368).
    [Show full text]