Microsoft .NET: Architecting Applications for the Enterprise Ebook

Total Page:16

File Type:pdf, Size:1020Kb

Microsoft .NET: Architecting Applications for the Enterprise Ebook PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2009 by Andrea Saltarello and Dino Esposito All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Control Number: 2008935425 Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 QWT 3 2 1 0 9 8 Distributed in Canada by H.B. Fenn and Company Ltd. A CIP catalogue record for this book is available from the British Library. Microsoft Press books are available through booksellers and distributors worldwide. For further infor mation about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to [email protected]. Microsoft, Microsoft Press, Access, ActiveX, IntelliSense, MS, MSDN, MS-DOS, PowerPoint, Silverlight, SQL Server, Visio, Visual Basic, Visual C#, Visual Studio, Windows, and Windows Vista are either registered trademarks or trademarks of the Microsoft group of companies. Other product and company names mentioned herein may be the trademarks of their respective owners. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions Editor: Ben Ryan Project Editor: Lynn Finnel Editorial Production: S4Carlisle Publishing Services Technical Reviewer: Kenn Scribner ; Technical Review services provided by Content Master, a member of CM Group, Ltd. Cover: Tom Draper Design Body Part No. X15-12272 To Silvia, Francesco, and Michela who wait for me and keep me busy. But I’m happy only when I’m busy. —Dino To Mum and Depeche Mode. —Andrea “Any suffi ciently advanced technology is indistinguishable from magic.” —Arthur C. Clarke Contents at a Glance Part I Principles 1 Architects and Architecture Today. 3 2 UML Essentials. 31 3 Design Principles and Patterns . 63 Part II Design of the System 4 The Business Layer . 129 5 The Service Layer . 193 6 The Data Access Layer . 251 7 The Presentation Layer. 343 Final Thoughts. 401 Appendix: The Northwind Starter Kit . 405 Index . 413 v Table of Contents Acknowledgments . .xiii Introduction . xvii Part I Principles 1 Architects and Architecture Today. 3 What’s a Software Architecture, Anyway? . 4 Applying Architectural Principles to Software . 4 What’s Architecture and What’s Not . 8 Architecture Is About Decisions . 10 Requirements and Quality of Software . .12 Who’s the Architect, Anyway? . .17 An Architect’s Responsibilities . 17 How Many Types of Architects Do You Know? . .20 Common Misconceptions About Architects . 21 Overview of the Software Development Process . 24 The Software Life Cycle. 24 Models for Software Development. 26 Summary . 30 Murphy’s Laws of the Chapter . .30 2 UML Essentials. 31 UML at a Glance . 32 Motivation for and History of Modeling Languages . 33 UML Modes and Usage. 36 UML Diagrams . 41 Use-Case Diagrams . 43 Class Diagrams . 47 Sequence Diagrams. 53 What do you think of this book? We want to hear from you! Microsoft is interested in hearing your feedback so we can continually improve our books and learning resources for you. To participate in a brief online survey, please visit: www.microsoft.com/learning/booksurvey/ vii viii Table of Contents Summary . 61 Murphy’s Laws of the Chapter . 61 3 Design Principles and Patterns . 63 Basic Design Principles . 63 For What the Alarm Bell Should Ring. 65 Structured Design . 66 Separation of Concerns. 70 Object-Oriented Design . 73 Basic OOD Principles . 73 Advanced Principles . 80 From Principles to Patterns. 85 What’s a Pattern, Anyway?. 86 Patterns vs. Idioms. 92 Dependency Injection. 95 Applying Requirements by Design . 97 Testability . 97 Security . .108 From Objects to Aspects. 116 Aspect-Oriented Programming. 116 AOP in Action . 120 Summary . 124 Murphy’s Laws of the Chapter . 125 Part II Design of the System 4 The Business Layer . 129 What’s the Business Logic Layer, Anyway?. 130 Dissecting the Business Layer . .130 Where Would You Fit the BLL? . 134 Business and Other Layers . 138 Patterns for Creating the Business Layer . 141 The Transaction Script Pattern. 145 Generalities of the TS Pattern . .145 The Pattern in Action . 149 The Table Module Pattern . .154 Generalities of the TM Pattern. 155 The TM Pattern in Action . 159 Table of Contents ix The Active Record Pattern . .165 Generalities of the AR Pattern . 166 The AR Pattern in Action . .168 The Domain Model Pattern . ..
Recommended publications
  • IBM Research Report Software Development As a Service: Agile
    RJ10476 (A1011-022) November 19, 2010 Other IBM Research Report Software Development as a Service: Agile Experiences Tobin J. Lehman IBM Research Division Almaden Research Center 650 Harry Road San Jose, CA 95120-6099 USA Akhilesh Sharma IBM Global Services IBM Almaden Research Center 650 Harry Road San Jose, CA 95120-6099 USA Research Division Almaden - Austin - Beijing - Cambridge - Haifa - India - T. J. Watson - Tokyo - Zurich LIMITED DISTRIBUTION NOTICE: This report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publication. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to the outside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and specific requests. After outside publication, requests should be filled only by reprints or legally obtained copies of the article (e.g. , payment of royalties). Copies may be requested from IBM T. J. Watson Research Center , P. O. Box 218, Yorktown Heights, NY 10598 USA (email: [email protected]). Some reports are available on the internet at http://domino.watson.ibm.com/library/CyberDig.nsf/home . Software Development as a Service: Agile Experiences Tobin J. Lehman Akhilesh Sharma Almaden Services Research IBM Global Services IBM Almaden Research Center IBM Almaden Research Center San Jose, California, U.S.A. San Jose, California, U.S.A [email protected] [email protected] Abstract— At the IBM Almaden Research Center, we have projects from our past as examples, we show that the level of been working with other divisions of IBM, offering Software program technology and requirement understanding Development as a Service (SDaaS).
    [Show full text]
  • Automatically Detecting ORM Performance Anti-Patterns on C# Applications Tuba Kaya Master's Thesis 23–09-2015
    Automatically Detecting ORM Performance Anti-Patterns on C# Applications Tuba Kaya Master's Thesis 23–09-2015 Master Software Engineering University of Amsterdam Supervisors: Dr. Raphael Poss (UvA), Dr. Giuseppe Procaccianti (VU), Prof. Dr. Patricia Lago (VU), Dr. Vadim Zaytsev (UvA) i Abstract In today’s world, Object Orientation is adopted for application development, while Relational Database Management Systems (RDBMS) are used as default on the database layer. Unlike the applications, RDBMSs are not object oriented. Object Relational Mapping (ORM) tools have been used extensively in the field to address object-relational impedance mismatch problem between these object oriented applications and relational databases. There is a strong belief in the industry and a few empirical studies which suggest that ORM tools can cause decreases in application performance. In this thesis project ORM performance anti-patterns for C# applications are listed. This list has not been provided by any other study before. Next to that, a design for an ORM tool agnostic framework to automatically detect these anti-patterns on C# applications is presented. An application is developed according to the designed framework. With its implementation of analysis on syntactic and semantic information of C# applications, this application provides a foundation for researchers wishing to work further in this area. ii Acknowledgement I would like to express my gratitude to my supervisor Dr. Raphael Poss for his excellent support through the learning process of this master thesis. Also, I like to thank Dr. Giuseppe Procaccianti and Prof. Patricia Lago for their excellent supervision and for providing me access to the Green Lab at Vrije Universiteit Amsterdam.
    [Show full text]
  • De La Torre C. Et
    y i EDITION v2.01 DOWNLOAD available at: https://aka.ms/microservicesebook PUBLISHED BY Microsoft Developer Division, .NET and Visual Studio product teams A division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2017 by Microsoft Corporation All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. This book is provided “as-is” and expresses the author’s views and opinions. The views, opinions and information expressed in this book, including URL and other Internet website references, may change without notice. Some examples depicted herein are provided for illustration only and are fictitious. No real association or connection is intended or should be inferred. Microsoft and the trademarks listed at http://www.microsoft.com on the “Trademarks” webpage are trademarks of the Microsoft group of companies. Mac and macOS are trademarks of Apple Inc. The Docker whale logo is a registered trademark of Docker, Inc. Used by permission. All other marks and logos are property of their respective owners. Co-Authors: Editors: Cesar de la Torre, Sr. PM, .NET product team, Microsoft Corp. Mike Pope Bill Wagner, Sr. Content Developer, C+E, Microsoft Corp. Steve Hoag Mike Rousos, Principal Software Engineer, DevDiv CAT team, Microsoft Participants and reviewers: Jeffrey Ritcher, Partner Software Eng, Azure team, Microsoft Dylan Reisenberger, Architect and Dev Lead at Polly Jimmy Bogard, Chief Architect at Headspring Steve Smith, Software Craftsman & Trainer at ASPSmith Ltd. Udi Dahan, Founder & CEO, Particular Software Ian Cooper, Coding Architect at Brighter Jimmy Nilsson, Co-founder and CEO of Factor10 Unai Zorrilla, Architect and Dev Lead at Plain Concepts Glenn Condron, Sr.
    [Show full text]
  • Mastering JEE Design Patterns
    "Charting the Course ... ... to Your Success!" Mastering JEE Design Patterns Course Summary Description Geared for experienced enterprise Java (JEE) developers, Mastering JEE Design Patterns is a lab- intensive Java / JEE design patterns training course which explores the many sophisticated JEE-oriented design patterns and how to use these patterns to develop solid, robust and reusable JEE applications. Technologies such as JPA and EJB3, as well as frameworks such as Spring, web services and rich interfaces, have significantly impacted previous generations of design patterns. Many of these technologies were heavily influenced by the very problems that previous design patterns addressed. While the basic patterns still ring true, the more advanced patterns have evolved into more robust solutions for secure, stable and scalable enterprise applications. Working in a hands-on environment, developers will explore key patterns in each of the different JEE layers and how they are used most effectively in building robust, reusable JEE applications. Objectives Working in a dynamic, interactive discussion and hands-on programming environment, let by our JEE expert team, students will explore the following pattern categories: Crosscutting Business Tier Presentation Tier Integration Tier Topics Introduction to Design Patterns Integration Tier Patterns “Gang of Four” Design Patterns Presentation Tier Patterns Base Patterns Crosscutting Patterns Business Tier Patterns Working with Patterns Audience This is an intermediate level Java EE (JEE) developer course, designed for experienced Java developers, new to JEE, that need to further extend their skills in web development and Struts. Prerequisites Attendees should have an extensive working knowledge in developing basic Java applications. Duration Five days Due to the nature of this material, this document refers to numerous hardware and software products by their trade names.
    [Show full text]
  • Designing Software Architecture to Support Continuous Delivery and Devops: a Systematic Literature Review
    Designing Software Architecture to Support Continuous Delivery and DevOps: A Systematic Literature Review Robin Bolscher and Maya Daneva University of Twente, Drienerlolaan 5, Enschede, The Netherlands [email protected], [email protected] Keywords: Software Architecture, Continuous Delivery, Continuous Integration, DevOps, Deployability, Systematic Literature Review, Micro-services. Abstract: This paper presents a systematic literature review of software architecture approaches that support the implementation of Continuous Delivery (CD) and DevOps. Its goal is to provide an understanding of the state- of-the-art on the topic, which is informative for both researchers and practitioners. We found 17 characteristics of a software architecture that are beneficial for CD and DevOps adoption and identified ten potential software architecture obstacles in adopting CD and DevOps in the case of an existing software system. Moreover, our review indicated that micro-services are a dominant architectural style in this context. Our literature review has some implications: for researchers, it provides a map of the recent research efforts on software architecture in the CD and DevOps domain. For practitioners, it describes a set of software architecture principles that possibly can guide the process of creating or adapting software systems to fit in the CD and DevOps context. 1 INTRODUCTION designing new software architectures tailored for CD and DevOps practices. The practice of releasing software early and often has For clarity, before elaborating on the subject of been increasingly more adopted by software this SLR, we present the definitions of the concepts organizations (Fox et al., 2014) in order to stay that we will address: Software architecture of a competitive in the software market.
    [Show full text]
  • Best Practices in Agile Software Development
    Universiteit Leiden ICT in Business Best practices in Agile software development A qualitative study on how organizations identify, analyze, improve, represent and document (best) practices to improve their software development processes. Name: Ing. R.H.J.C. (Roy) van Wel Student-no: 1310194 Date: 25/08/2013 1st supervisor: C.J. (Christoph) Stettina MSc. 2nd supervisor: Dr. L.P.J. (Luuk) Groenewegen MASTER'S THESIS Leiden Institute of Advanced Computer Science (LIACS) Leiden University Niels Bohrweg 1 2333 CA Leiden The Netherlands Acknowledgements By completing this Thesis I finished my education and will receive my Master of Science degree. Of course, I was not able to finish my Thesis without supervision. Therefore I would like to first thank Dr. Luuk Groenewegen, especially for making time available on short notice. Also I would like to give special thanks to Christoph Stettina MSc. for his supervision and coaching skills. You were there when I needed your help and you always gave me enough space for self-deployment. Although my background is ICT-related, I found the Thesis proposal from Christoph very intriguing. The initial objective was to look on currently available Agile practices and compare the applicability of existing process model descriptions to document Agile practices in an accessible but complete manner. During my literature study I got really enthusiastic about the subject Agile software development and decided to also examine how organizations identify, analyze and improve their practices. During my literature research I found very interesting literature how practices can be identified by executing workshops. Because I was really curious how this would work in practice, I asked André Lauwerijssen, a very skilled Scrum Master, to execute the workshop with me.
    [Show full text]
  • Extreme Programming from Wikipedia, the Free Encyclopedia
    Create account Log in Article Talk Read Edit View history Search Extreme programming From Wikipedia, the free encyclopedia Main page Extreme programming (XP) is a software development methodology which is Contents intended to improve software quality and responsiveness to changing customer Featured content requirements. As a type of agile software development,[1][2][3] it advocates frequent Current events "releases" in short development cycles, which is intended to improve productivity Random article and introduce checkpoints at which new customer requirements can be adopted. Donate to Wikipedia Wikipedia store Other elements of extreme programming include: programming in pairs or doing Interaction extensive code review, unit testing of all code, avoiding programming of features Help until they are actually needed, a flat management structure, simplicity and clarity in About Wikipedia code, expecting changes in the customer's requirements as time passes and the Community portal problem is better understood, and frequent communication with the customer and Recent changes among programmers.[2][3][4] The methodology takes its name from the idea that the Contact page Planning and feedback loops in beneficial elements of traditional software engineering practices are taken to extreme programming. Tools "extreme" levels. As an example, code reviews are considered a beneficial What links here practice; taken to the extreme, code can be reviewed continuously, i.e. the practice Related changes Software development of pair programming. Upload file process Special pages Critics have noted several potential drawbacks,[5] including problems with Core activities Permanent link unstable requirements, no documented compromises of user conflicts, and a Requirements · Design · Construction · Testing · Debugging · Deployment · Page information lack of an overall design specification or document.
    [Show full text]
  • Design Optimizations of Enterprise Applications – a Literature Survey
    Design Optimizations of Enterprise Applications – A Literature Survey Willie (Phong) Tu Dept. of Computer Science, University of Calgary [email protected] Abstract Another dimension is the performance improvement for the single user versus multiple users, in other words, Software design patterns have been defined as scalability. The design optimization patterns noted here possible solutions to reoccurring problems. One aspect will focus on actual running time of operations for of the problems is performance. This can be arguably single user performance and multi-user scalability true in high volume enterprise applications. This paper improvements. will explore the current discussions and research in The organization of the findings is categorized utilization of software design patterns to optimize through the usage of an architectural pattern, which is enterprise applications. defined as layer [5]. The layers used are the primary three-layer architecture for information systems [10,21], which includes the data access layer, domain layer, and 1. Introduction presentation layer. Design optimization patterns that spans layers will be elaborated first, then a bottom up First, let’s define what is design optimization. In this approach starting with the data access layer, followed by context, design optimization is the improvement of an the domain layer, and finally the presentation layer. We application’s design and performance using software will then continue on with findings from different design patterns. Design improvements can be subjective, enterprise applications. After which, we will summarize thus the main qualifier is the utilization of software the current state in design optimizations of enterprise design patterns to improve the performance of an applications based on the findings.
    [Show full text]
  • Enterprise Application Design Patterns: Improved and Applied
    Enterprise Application Design Patterns: Improved and Applied Stuart Thiel A Thesis in The Department of Computer Science and Software Engineering Presented in Partial Fulfillment of the Requirements for the Degree of Master of Computer Science at Concordia University Montreal, Quebec, Canada January 2010 © Stuart Thiel, 2010 i CONCORDIA UNIVERSITY School of Graduate Studies This is to certify that the thesis prepared By: Stuart Thiel Entitled: Enterprise Application Design Patterns: Improved and Applied and submitted in partial fulfillment of the requirements for the degree of Master of Computer Science complies with the regulations of the University and meets the accepted standards with respect to originality and quality. Signed by the final examining committee: ______________________________________________Chair Dr. Nematollaah Shiri ______________________________________________Examiner Dr. Greg Butler ______________________________________________Examiner Dr. Yuhong Yan ______________________________________________Supervisor Dr. Patrice Chalin Approved by __________________________________________ Chair of Department or Graduate Program Director _____________________________________ Dr. Robin Drew, Dean Faculty of Engineering and Computer Science Date ______________________________________________ i ii Abstract Enterprise Application Design Patterns: Improved and Applied Stuart Thiel Providing developers with proper tools is of ever increasing importance as software integrates itself further into all aspects of our lives. Aside from conventional hardware and software tools, architectural and design patterns have been identified over the years as a means to communicate knowledge of known problems and their solutions. In this thesis, we present several refinements and additions to these patterns, building primarily on Martin Fowler’s Patterns of Enterprise Application Architecture (2003). We present a practical implementation approach to using these patterns and discuss a framework that we have developed to aid practitioners in following this methodology.
    [Show full text]
  • NET Technology Guide for Business Applications // 1
    .NET Technology Guide for Business Applications Professional Cesar de la Torre David Carmona Visit us today at microsoftpressstore.com • Hundreds of titles available – Books, eBooks, and online resources from industry experts • Free U.S. shipping • eBooks in multiple formats – Read on your computer, tablet, mobile device, or e-reader • Print & eBook Best Value Packs • eBook Deal of the Week – Save up to 60% on featured titles • Newsletter and special offers – Be the first to hear about new releases, specials, and more • Register your book – Get additional benefits Hear about it first. Get the latest news from Microsoft Press sent to your inbox. • New and upcoming books • Special offers • Free eBooks • How-to articles Sign up today at MicrosoftPressStore.com/Newsletters Wait, there’s more... Find more great content and resources in the Microsoft Press Guided Tours app. The Microsoft Press Guided Tours app provides insightful tours by Microsoft Press authors of new and evolving Microsoft technologies. • Share text, code, illustrations, videos, and links with peers and friends • Create and manage highlights and notes • View resources and download code samples • Tag resources as favorites or to read later • Watch explanatory videos • Copy complete code listings and scripts Download from Windows Store Free ebooks From technical overviews to drilldowns on special topics, get free ebooks from Microsoft Press at: www.microsoftvirtualacademy.com/ebooks Download your free ebooks in PDF, EPUB, and/or Mobi for Kindle formats. Look for other great resources at Microsoft Virtual Academy, where you can learn new skills and help advance your career with free Microsoft training delivered by experts.
    [Show full text]
  • Agile Automated Software Testing Into Automotive V-Model Process
    Agile automated software testing into automotive V-Model process: A practical case Xavier Martin Artal Software QA Manager [email protected] es.linkedin.com/pub/xavier-martin/6/a89/723/ Agenda • Introduction • Automotive Trends: Car Connectivity • Car Telematics project Challenges • Use Case Solution: From V-Model to Agile Testing • Results and Conclusions Introduction What is this presentation about? • Expose a practical case of adoption of Agile techniques in automotive testing • Converge Spice automotive V-Model to Agile Spice V-Model Agile • Present Technical Solution adopted: Automation Test Framework • Discuss results and Agile adequacy to Automotive industry Automotive Trends: Vehicle Connectivity Car Telematics • Car Manufacturers start to add 3G/4G capabilities • Connectivity opens new opportunities to develop services for both clients and manufacturers Connectivity Services – Emergency Call – Fleet Management – Car Sharing – Remote Car Diagnostics – Stolen Vehicle Tracking (SVT) – WOTA Update – Dealer Services – User Premium Services Car telematics: eCall • Emergency Call Service for Europe • U.E Council proposes eCall obligatory in European Cars for end 2017 • Automatic call in case of accident or emergency will force car manufacturers to add IVTU to every new car for European Service • Similar regulations for Russia, USA, BRA and PRC Car Telematics Project Challenges What is an iVTU? iVTU = in Vehicle Telematics Unit - Electronic Unit in charge of granting 2G/3G/LTE connectivity to vehicles - Two Main processors architecture:
    [Show full text]
  • An Approach to Maintainable Model Transformations with an Internal DSL
    An approach to maintainable model transformations with an internal DSL Master thesis of Georg Hinkel At the Department of Informatics Institute for Program Structures and Data Organization (IPD) Reviewer: Prof. Dr. Ralf Reussner Second reviewer: Prof. Dr. Walther Tichy Advisor: Dr. Lucia Happe Second advisor: Dr. Thomas Goldschmidt Duration:: 1st May 2013 – 31th October 2013 KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association www.kit.edu I declare that I have developed and written the enclosed thesis completely by myself, and have not used sources or means without declaration in the text. PLACE, DATE ......................................... (Georg Hinkel) iii Abstract In recent years, model-driven software development (MDSD) has gained popularity among both industry and academia. MDSD aims to generate traditional software artifacts from models. This generation process is realized in multiple steps. Thus, before being transformed to software artifacts, models are transformed into models of other metamodels. Such model transformation is supported by dedicated model transformation languages. In many cases, these are entirely new languages (external domain-specific languages, DSLs) for a more clear and concise represen- tation of abstractions. On the other hand, the tool support is rather poor and the transformation developers hardly know the transformation language. A possible solution for this problem is to extend the programming lan- guage typically used by developers (mostly Java or C#) with the re- quired abstractions. This can be achieved with an internal DSL. Thus, concepts of the host language can easily be reused while still creating the necessary abstractions to ease development of model transformations.
    [Show full text]