39,59 €
If you want to design and develop enterprise applications using .NET Core as the development framework and learn about industry-wide best practices and guidelines, then this book is for you.
The book starts with a brief introduction to enterprise architecture, which will help you to understand what enterprise architecture is and what the key components are. It will then teach you about the types of patterns and the principles of software development, and explain the various aspects of distributed computing to keep your applications effective and scalable. These chapters act as a catalyst to start the practical implementation, and design and develop applications using different architectural approaches, such as layered architecture, service oriented architecture, microservices and cloud-specific solutions.
Gradually, you will learn about the different approaches and models of the Security framework and explore various authentication models and authorization techniques, such as social media-based authentication and safe storage using app secrets. By the end of the book, you will get to know the concepts and usage of the emerging fields, such as DevOps, BigData, architectural practices, and Artificial Intelligence.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Veröffentlichungsjahr: 2017
BIRMINGHAM - MUMBAI
Copyright © 2017 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2017
Production reference: 1210417
ISBN 978-1-78646-888-8
www.packtpub.com
AuthorsGanesan Senthilvel Ovais Mehboob Ahmed KhanHabib Ahmed Qureshi
Copy Editor
Sonia Mathur
Reviewer
Adwait Ullal
Project Coordinator
Prajakta Naik
Commissioning Editor
Aaron Lazar
Proofreader
Safis Editing
Acquisition Editor
Nitin Dasan
Indexer
Aishwarya Gangawane
ContentDevelopmentEditor
Siddhi Chavan
Graphics
Tania Dutta
Technical Editor
Abhishek Sharma
Production Coordinator
Aparna Bhagat
Ganesan Senthilvel is a passionate IT leader with two decades’ experience in architecture, design, and implementing cutting edge solutions to the address business opportunities of enterprise applications. He has earned a Master's degree in Computer Science and Master's degree in Business Administration. Now, he is pursuing a doctorate program in Big Data. He is a consistent technical contributor via COE, Blog, Whitepaper, Summit, Certification, and so on. Highly skilled at providing coaching and mentoring to internal teams and external institutes, he maintains his weekly blog at http://ganesansenthilvel.blogspot.in. He has published double dozens of technology articles on CodeProject and LinkedIn Pulse. He has earned industry certifications in Big Data, Microsoft (MCP, MCAD), and the financial domain.
Ovais Mehboob Ahmed Khan is a seasoned programmer and solution architect with more than 14 years of software development experience. He has worked in different organizations across Pakistan, the USA, and the Middle East. Currently, he is working for a government entity based in Dubai, and also provides consultancy services to a Microsoft gold partner firm based in New Jersey.
He is a Microsoft MVP in Visual Studio and Development Technologies and specializes mainly in Microsoft .NET, Cloud, and Web development. He is a prolific writer and has published numerous technical articles on different websites, such as MSDN, TechNet, DZone, and so on; he also has a personal blog at http://OvaisMehboob.com and is an author of another book named as JavaScript for .NET Developers, published by Packt. He is an active speaker and group leader of Microsoft Developers UAE Meetup, Microsoft Technology Practices, and Developers and Enterprise Practices user groups, and has presented various technical sessions at various events and conferences. In short, Ovais is a passionate developer and architect who is always interested in learning new technologies. He can be reached at [email protected], and on Twitter at @ovaismehboob.
Habib Ahmed Qureshi is an integration architect and lead developer with over 14 years of professional experience in the software industry working with the cutting edge technologies. He has worked globally with on-site, off-site, and remote teams in Karachi, Dubai, Copenhagen, London, and Basel. He is a go-getter, and his teams always look to him for technical reviews and solutions.
He has worked extensively with C++, .NET (C#/VB), Java, TIBCO, and various other middlewares on Windows and other platforms.
You can connect to him on Twitter at @habib_a_qureshi.
Adwait Ullal is an Enterprise Architect with cloud skills, having assisted Fortune 100 companies assess the public cloud environments and migrate applications and infrastructure to the cloud. He is a presenter at the local SQL Saturdays and Code Camps and has also reviewed books for Wrox and Manning. He can be contacted on Twitter at @adwait.
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at https://www.amazon.com/dp/1786468883. If you'd like to join our team of regular reviewers, you can e-mail us at [email protected]. We award our regular reviewers with free eBooks and videos in exchange for their valuable feedback. Help us be relentless in improving our products!
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
Enterprise Architecture Concepts
Why do we need Enterprise Architecture?
Definition of Enterprise Architecture
Stakeholders of Enterprise Architecture
Business benefits
Knowing the role of an architect
Role comparison between EA and SA
Degree of Comparisons
Commonly known EA Frameworks
General Purpose Frameworks
Domain Specific Frameworks
Architecture segregation
Business Architecture
Data Architecture
Application Architecture
Technology Architecture
Introduction to TOGAF
Evolution of TOGAF 9.1
Core components
Industry usage
Introduction to Zachman
Evolution
Core components
Summary
Principles and Patterns
Getting started with principles and patterns
Why follow design principles?
What are design patterns?
Why use design patterns?
SOLID design principles
SRP - Single Responsibility Principle
SRP example - The decorator pattern
OCP - Open Closed Principle
LSP - Liskov Substitution Principle
ISP - Interface Segregation Principle
DIP - Dependency Inversion Principle
Dependency injection
Introducing dependency injection
Knowing about the Service Locator pattern
Dependency injection support with .NET Core
GoF design patterns
What are software design patterns?
Creational patterns
The singleton pattern
Variations on the singleton pattern
The factory method pattern
Abstract factory pattern
Builder pattern
A commentary on creational patterns
Structural patterns
Adapter pattern
Bridge pattern
Flyweight pattern
A commentary on structural patterns
Behavioral patterns
The template method pattern
The observer pattern
The chain of responsibility pattern
The visitor pattern
The strategy pattern
The state pattern
A commentary on behavioral patterns
Summary
Distributed Computing
Understanding Distributed applications
Definition
Comparison
Multiprogramming
Thread synchronization
Storage
Process
Concurrency
Parallelism
Multithreading exercise
ThreadStart
ThreadPool
Task Parallel Library (TPL)
Design challenges
Transparency
Reliability
Fault tolerance
Performance
Decompose
Caching
Scalability
Scale up
Scale out
Comparing scale up with scale out
Connecting the dots
Security
Goals
Attack
Threats
Summary
Software Development Life Cycle
What is SDLC?
Need for a process
Insight of core phases
SDLC models
The Waterfall model
Core phases
Business requirement
System analysis
System Design
Coding
Testing
Maintenance
Understanding the Spiral model
Core phases
Comparing the Waterfall model with the Spiral model
Benefits
Challenges
Usage recommendation
Agile model
Top five reasons to adopt Agile
Ambiguous requirements
Requirement changes
Big planning is not practical
Software review is better than document
Iterative incremental delivery is preferred
Industry evidence
Scaled Agile Framework (SAFe)
History
Success Factors
Microsoft open source strategy to life cycle
Traditional Microsoft model and its origin from MS-DOS
Driving factors of the open source model
Twin tracks of .NET Framework and .NET Core
Comparing .NET with .NET Core
Current stack of open source tools and techniques
Summary
Enterprise Practices in Software Development
What is ALM?
Core aspects
ALM vs SDLC
Source Code Control System
Git
TFS
Git vs TFS
Visual Studio Integration
Team Foundation Version Control (TFVC)
Git
Developing .NET Core project templates for enterprise applications
Creating a custom .NET Core project template using .NET command-line interface tools
Performance measuring for .NET applications
CPU utilization
Using the Sampling method in Visual Studio to collect performance statistics
Measuring UI responsiveness
Analysing memory leaks
Identifying memory leaks
Summary
Layered Approach to Solution Architecture
Layers in layered architecture
Presentation layer
Service layer
Business layer
Transaction Script pattern
Table Module pattern
Active Record pattern
Domain Driven Design (DDD) pattern
Data access layer
Objectives of layered architecture
Practical implementation of layered architecture in .NET Core
Scope
Logical architecture
Presentation layer
Service layer
Business layer
Data access layer
Common layer
Setting up the environment
Creating the solution
Creating the common layer
Entities mapped to database tables
Business objects
Logging events
Logging helper
Data access layer
Creating Data Context
Creating DbFactory
Repository pattern
Unit of Work pattern
Running migration
Business layer
Develop core classes
Developing business managers
Logging in .NET Core
Creating the service layer
Creating base controller
Adding Custom Action Filters
Add controllers
Creating the presentation layer
Single Page Applications
Benefits of a SPA
Developing the presentation layer using ASP.NET Core and Angular
Setting up frontend packages
Configuring the ASP.NET Core pipeline
Adding the Angular components
Creating MVC Controllers and Views
Summary
SOA Implementation with .NET Core
SOA definition
What is SOA?
SOA modeling
SOA Reference Model
Reference model and reference architecture relationship
SOA Reference Architecture
Common reference information architecture
Common reference Infrastructure architecture
SOA features and components
Service Component Architecture
Service types
Service composition
Service orchestration
Service choreography
Common technology standards
Service discovery
Message broker
Enterprise Service Bus (ESB)
ESB Segments
ESB features
Data
Master Data Management (MDM)
Common data model
Live business metrics
Services gateway
SOA services library
Tracking, logging, and error handling in SOA
Notes
Sample SOA implementation
Introduction
Sample enterprise
Departments of a sample enterprise
Sample data models for departments
Sample business processes for departments
Sample database models for departments
Bounded contexts
Services implementation
Solution structure
Sample database
Sample development and system services
Sample information service
Employee information SOA service
Employee Information business logic layer
Repositories in the data access layer
Employee information core data access layer
Entity in an employee information model
Sample adapter service
Sample background service
Sample interaction (notification) service
Sample mediation service
Sample scenario of a service choreography
Summary
Cloud-Based Architecture and Integration with .NET Core
Cloud Computing Models
Infrastructure as a Service (IaaS)
Platform as a Service (PaaS)
Software as a Service (SaaS)
Azure compute
Virtual machines
Cloud services
Worker Role
Web Role
App Services
Azure Service Fabric
Features comparison between virtual machines, cloud services, Azure App Services, and Service Fabric
Rapid application development using Azure App Services
Web Apps
Hosting an ASP.NET Core application on Azure
Deployment slots
API Apps
Configuring Swagger in ASP.NET Core Web API and deploying on Azure
Creating proxy classes using AutoRest in .NET Core
Enable CORS
Mobile Apps
Offline sync
Push notifications
Logic Apps
Connectors
Trigger
Actions
Creating Logic App in Azure
Scaling Azure App Services
Background services and event handling in cloud
WebJobs
Developing WebJob using .NET Core
Developing WebJobs using WebJobs SDK and .NET Framework 4.5
Azure WebJobs versus Azure WorkerRoles
Using WebHooks for event-based scenarios
Using WebHook of WebJob from VSTS
Azure Functions
Creating a basic Azure Function to listen for Queue events
Scalability and performance options in Azure App Services
Increasing storage performance
Command-Query Responsibility Segregation (CQRS) pattern
Denormalization
Azure Table storage
MongoDB
Caching
Local cache
Shared cache
Using Redis Cache in Azure
Creating the Redis Cache
Configuring the .NET Core app to use Redis Cache on Azure
Queuing
Logging and monitoring in Azure
Logging
ASP.NET Core logging in Azure
Web server diagnostics
Application diagnostics
Accessing logs
Accessing logs via FTP
Accessing Logs via Azure PowerShell
Monitoring
SCOM (System Center Operations Manager)
Application Insights
Application hosted on Azure
Application hosted on-premise
Use Application Insights API
Setting up Application Insights in ASP.NET Core Application
Summary
Microservices Architecture
Microservices architecture definition
What is microservices architecture?
Microservices and SOA
Microservices and monolithic applications
Web API and web services
Characteristics of a microservices architecture
Best for microservices architecture
Documentation
Business capabilities
Business processes
Microservice interfaces
Microservice code
Microservice data store
Logging and monitoring
Immutable Infrastructure
Containerization
Stateless
Architectural elements
Bounded Context in Domain Driven Design
DDD (Domain Driven Design)
Guiding principles
Foundational concepts
Bounded context
Microservices come in systems
Service discovery
Client-side service discovery
Server-side service discovery
Service registry
API gateway
Architectural motivations
Agile Manifesto
Reactive Manifesto
Reactive systems
Reactive microservices architecture
Key aspects of Reactive Microservices
Serverless architecture
Backend as a Service (BaaS)
Function as a Service (FaaS)
Key aspects of serverless architecture
Type of code
Stateless
Short-lived
Almost zero administration
Automatic scaling
Event-driven
Let's wrap it up
Azure for microservices
Azure Functions
Azure Service Fabric
Azure Container Service
Bringing it together
Implementation samples
Microservices architecture for our sample enterprise
Problem domains
Publishing team
Marketing team
Sales team
Platform administration team
Other teams
Contexts for the respective teams
Customer Relationship Management system
Document Management System
Understanding the Microservices Bounded Team Contexts
General service information flow
Sales Team Context
Marketing Team Context
Publishing Team Context
Platform Administration Team Context
Enterprise portal mockup
Overall microservices architecture
Common communication mechanismsin microservices
Serverless architecture for a sample application
Our sample application - Home automation
High-level application design
Serverless architecture in Azure
Let's wrap it up
Summary
Security Practices with .NET Core
Authentication and authorization modes
Securing applications with ASP.NET Core Identity
Security architecture in ASP.NET Core
Getting to know the core APIs of the Identity system
HttpContext and AuthenticationManager
Understanding the authentication and authorization process
Authentication
Implementing authentication using ASP.NET Core Identity and customizing the Identity data store
Configuring authentication using Identity in an empty web application project
Configuring Entity Framework Core
Defining data context and user classes
Configuring database connection and application configuration settings
Configuring Entity Framework and Identity services
Enabling authentication using Identity
Creating an identity data store in SQL server
Customizing existing Identity data store and adding new entities
Creating and Signing-in/Signing-out users
Adding claims in ASP.NET Identity membership
How authorization works
Using cookie middleware without ASP.NET Core Identity
Claims transformation
Cookie middleware events
Implementing external authentication in ASP.NET Core applications
Configuring external authentication in ASP.NET Core
Creating a web application project
Configuring apps on Facebook
Enabling Facebook middleware
Two-factor authentication
Setting up an SMS account
Enabling two-factor authentication
Security in an enterprise
Getting started with IdentityServer4
Understanding OAuth
Actors in OAuth
Flows of OAuth 2.0
Client credentials flow
Implicit flow
Authorization code flow
Resource owner password credentials flow
Understanding OpenID Connect
OpenID Connect flows
Authorization code flow
Implicit flow
Hybrid flow
Claims and scopes
Endpoints
Discovery endpoint
Authorize endpoint
Token endpoint
UserInfo endpoint
Developing a Centralized Authorization System using IdentityServer4
Creating a Centralized Authentication Service/Authorization Server
Setting up IdentityServer4
Defining scopes, clients and users
Adding UI to enable authentication using OpenID Connect
Creating an MVC web application project
Adding OIDC and cookie middleware in HTTP pipeline
Enabling MVC and controller
Adding a Web API
Authorization
Declarative authorization techniques
Basic authorization
Authorization filters
Filtering based on authentication schemes
Filtering based on authorization
Filtering based on policy
Custom policies
Imperative authorization techniques
Safe storage
Storing and retrieving safe storage values
Summary
Modern AI Offerings by Microsoft
Virtual machines and containerization
Virtual machine
Simulation
Emulation
Virtual machine implementation base
Containerization
Evolution of containerization concepts
Chroot
FreeBSD Jails
Solaris Zones
OpenVZ
Cgroups
LXC
Lmctfy
Docker
Modern container fundamentals
Docker components
Docker Engine
Docker Compose
Docker Machine
Docker registry
Docker Kitematic
Docker Swarm
Swarm mode
Docker Cloud
Docker containerization in Windows
Docker for Windows
Windows Containers
Modern development
Development editors
Development environment setup
Vagrant
Cloud development and test environment
DevOps
The Culture
Key motivational aspects
Sharing
Automation
Measurement
Software development and delivery process
Continuous Integration
Best practices
Benefits of CI
Improvement in Developer productivity
Quick identification and addressing of bugs
Faster Updates Delivery
Continuous Delivery
Continuous Delivery Pipeline
DevOps toolchain
A sample microservices application based on Docker containers
The sample application
Problem statement
Application architecture
Technical architecture
Setup in Azure Container Service
Architecture diagram
Network architecture
What is visible in this diagram?
Hands-on prerequisites
Why Azure Container Service?
Azure App Service (on) Linux
Creating VM directly on Azure
Azure Service Fabric (ASF)
Azure Container Service (ACS)
Implementing the Math app
Implementation approach
Implementation Steps
Installing the Hypervisor
CentOS virtual machine
CentOS configuration
Container installation and execution
Uploading container images to container registry
Creating Azure Container Service
Container installation and execution on ACS
Big Data and Microsoft
Definition of Schema
Schema free - NoSQL
Fixed vs no schema
NoSQL types
Architectural best practices
Microsoft HDInsight
HDInsight ecosystem
Introduction to Business Intelligence (BI)
Current trend
Road map
Power BI architecture
Power BI layers
Artificial intelligence (AI)
Core components
Machine learning (ML)
Data mining
Interconnectivity
AI at Microsoft
Industry Bots
Microsoft open source strategy
Cognitive Services
Microsoft Bot
Summary
This book contains various topics for the development of enterprise applications architecture for diversified applications. Whether it’s a layered architecture, service-oriented architecture, microservices architecture, or a cloud-specific solution, you will learn best practices in developing enterprise application architecture with .NET Core. It also covers emerging fields, such as DevOps and Big Data, for the broader perspective. This book starts with a brief introduction to enterprise architecture (EA) and the key components in EA practice. It then takes you through the SOLID principles and design patterns in software development and explains the various aspects of distributed computing to keep your applications efficient and scalable. These chapters act as a catalyst to start the practical implementation for the designing and development of applications using various architectural approaches. Gradually, you will explore different approaches to implement security in your applications and explore various authentication models and authorization techniques. In the end, you will learn the concepts of the emerging fields and practices of DevOps, Containerization, Big Data, Artificial Intelligence, and more.
Chapter 1, Enterprise Architecture Concepts, helps you understand the fundamental concepts of enterprise architecture and its related business need and benefits. As the best practice in the industry, enterprise architecture is expected to have the responsibility to perform the strategic steps in alignment with the business vision. An enterprise architecture has few strong fundamental blocks, namely, agility, durability, efficiency, and effectiveness. An enterprise architecture is the discipline of addressing business needs with people, process, and technology, with the definition of purpose, intent, and structure of enterprise applications.
Chapter 2, Principles and Patterns, provides an introduction to SOLID principles and design patterns, but also provides C# .NET Core-based implementations to some of the famous design patterns, including GoF patterns and Dependency Injection.
Chapter 3, Distributed Computing, explains that the reader will get an opportunity to understand the fundamentals of this computing and application in the enterprise world. It starts from the definition, followed by its core characteristics, such as concurrency, scalability, transparency, security, and more. In the modern world, distributed computing plays a vital role.
Chapter 4, Software Development Life Cycle, covers SDLC, which is a term used in systems engineering, information systems, and software engineering as a process. This tutorial elaborates on various methodologies, such as Waterfall, Spiral, Agile, and so on. At the end of this chapter, you will understand the fundamental concepts of Enterprise Architecture and its related business needs and benefits. It has started from the traditional Waterfall model and traversed through multi-iteration Spiral model, trendy Agile model with the specific Scaled Agile Framework (SAFe). On traversing through various timelines and related methodologies, it has been easy to understand the necessity of the improvement and related adoption.
Chapter 5, Enterprise Practices in Software Development, explains the enterprise practices in the software development life cycle with the popular ALM tools and techniques. After reading this chapter, the reader will know different ways to measure the performance of .NET Core applications and see how enterprises can create their own custom project templates using the .NET CLI tool.
Chapter 6, Layered Approach to Solution Architecture, teaches you a few best practices that can be used while designing n-tier architecture. We will implement a few patterns, such as Repository, Unit of Work, and Factory, in the data access layer that decouples the dependencies and uses them in business layer for database manipulation. We will explore certain benefits of keeping entities and other helper classes in the common layer, which can be used throughout the layers and, in the service layer, we will develop few controllers to show how business managers can be developed and injected. We will also learn how logging and exception handling can be implemented and, finally, in the presentation layer, we will use Angular 2 as a frontend framework to bring responsive user experience.
Chapter 7, SOA Implementation with .NET Core, talks about taking the top-down approach, taking you from theoretical aspects to implementation-related information. It introduces how to approach a SOA platform from an enterprise architecture perspective, how to model an architecture in step-by-step approach, and what elements to look for and take care of at the time of implementation of a SOA architecture.
Chapter 8, Cloud-Based Architecture and Integration with .NET Core, teaches you about cloud computing and using Microsoft Azure as the cloud platform. We will focus on Azure App Services and see how simply we can develop and deploy .NET Core applications on the cloud. Scalability is an essential key, and we will learn how easy it is to scale out or scale up our applications running on Azure following with the techniques to increase performance. Finally, you will learn about logging and monitoring options in Azure and see how we can use Application Insights with web applications running on the cloud to monitor application performance.
Chapter 9, Microservices Architecture, builds on SOA concepts and architectural artifacts and utilizes the right information from the cloud-based architecture and fits it to the right level to design the microservices-based architecture. We will design a high-level architecture using microservices and introduce you to some of the key elements from Azure-based offerings in order to design a sample serverless architecture.
Chapter 10, Security Practices with .NET Core, teaches you about the security frameworks ASP.NET Core Identity and IdentityServer4 in order to handle easy and complex scenarios, customize and extend the existing Identity model using Entity Framework Core, and use middleware to authenticate users using Facebook, 2FA, and OpenID Connect. Moreover, we will develop a basic Central Authentication System (CAS) that provides multiple applications to connect using the same protocol and implement single sign-on. You will also learn different techniques of securing Web API and MVC Controllers and Actions using attributes, or imperatively by writing custom code and then, finally, we will discuss how we can store application secrets using user secrets.
Chapter 11, Modern AI Offerings by Microsoft, explains the emerging architecture practices of the industry in a succinct and concise way with .NET Core environment. In the software industry, things can change quickly. You will learn DevOps concepts as well as the implementation of a simple microservices-based architecture in depth using Docker-based containers, and deploy them onto the Azure cloud using the relevant Azure offerings for the multi-container based implementation. The chapter covers virtual machines and containerization, Docker, DevOps, Continuous Integration and Continuous Delivery, sample app based on Docker containers, Big Data in Microsoft, Business Intelligence (BI), and an introduction to Artificial Intelligence (AI).
Development Environment: Visual Studio 2015/2017 Community Edition
Execution Environment: .NET Core
OS Environment: Oracle VM VirtualBox with Windows or Linux
Microsoft Azure Account
This book assumes that the readers are either senior developers or software solution architects who want to design and develop enterprise applications with .NET Core as the development framework and quickly get their hands on enterprise architecture, patterns, SOA, and microservices following the .NET Core in the cloud.
With this book, you will get to know modern architectures and patterns in a summarized form within a short period of time.
In this book, we follow the C# coding style as is followed by the .NET Core community here: https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Logging can be enabled by injecting the ILoggerFactory instance through the Configure method of the Startup class, and then using that to add providers."
A block of code is set as follows:
using System; namespace Chapter2.SRP.Decorator { public class Student { public string Name; public string Id; public DateTime DOB; } }
Any command-line input or output is written as follows:
yum install -y gcc-c++ make
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Logic App can be created by selecting the Web + Mobile option in the search pane and by then selecting the Logic App option."
Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
Log in or register to our website using your e-mail address and password.
Hover the mouse pointer on the
SUPPORT
tab at the top.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box.
Select the book for which you're looking to download the code files.
Choose from the drop-down menu where you purchased this book from.
Click on
Code Download
.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR / 7-Zip for Windows
Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Enterprise-Application-Architecture-with-NET-Core. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/EnterpriseApplicationArchitecturewithNETCore_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at [email protected] with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.
This section starts with the core concepts and frameworks of the industry-wide adopted Enterprise Architecture (EA). EA is an industry framework to align the enterprise with the execution of disruptive and emerging changes. Strategically, it supports the targeted (or) desired vision and outcomes of the business. By design, EA is the fundamental block of the business, domain, and technology vision of an enterprise.
By the end of the chapter, you will understand the fundamental concepts of enterprise architecture, and its related business needs and benefits.
In this chapter, we will cover the following topics:
Understanding the definition of an enterprise architect and their related stakeholders
Knowing the real need of Enterprise Architecture to attain business benefits
Knowing the clear segregation between
Solution Architecture
and Enterprise Architecture
Details of four segregation types of Enterprise Architecture
Understanding the commonly known EA Frameworks--
The Open Group Architecture Framework
(
TOGAF
) and
Zachman
As this book is focused on the enterprise level, it is expected to provide a few core points to understand enterprise architecture easily.
In my personal experience, it was confusing to understand the role of an enterprise architect because people used to refer to so many architectural roles and terms, such as architect, solution architect, enterprise architect, data architect, blueprint, system diagram, and so on. My work experience clarified the underlying concepts and motivated me to write this section.
In general, the industry perception is that an IT architect role is to draw a few boxes with a few suggestions; the rest is with the development community. They feel that the architect role is quite easy, just drawing a diagram and not doing anything else. As said earlier, it is completely a perception of a few associates in the industry. This perception leads me to a different view about the architecture role:
However, my enterprise architect job has cleared this perception and I understand the true value of an enterprise architect.
In simple terms, an enterprise is nothing but human endeavor. The objective of an enterprise is where people are collaborating for a particular purpose supported by a platform. Let me explain with an example of an online e-commerce company. Employees of that company are people who work together to produce the firm's profits using their various platforms, such as infrastructure, software, equipment, building, and so on.
Enterprise has the structure/arrangements of all these pieces/components to build the complete organization. This is the exact place where enterprise architecture plays its key role. Every enterprise has an enterprise architect.
EA is a process of architecting that applies the discipline to produce the prescribed output components. This process needs experience, skill, discipline, and descriptions. Consider the following image, where EA anticipates the system in two key states:
Every enterprise needs an enterprise architect, this is not optional. Let me give a simple example. When you need a car for business activities, you have two choices, either drive yourself or rent a driver. Still, you will need the driving capability to operate the car. EA is pretty similar to this.
As depicted in the preceding diagram, EA anticipates the system in two key states, which are as follows:
How it currently is
How it will be in the future
Basically, they work on options/alternatives to move from the current to a future state of an enterprise system. In this process, Enterprise Architecture does the following:
Creates the frameworks to manage the architecture
Details the descriptions of the architecture
Road maps to lay the best way to change/improve the architecture
Defines constraints/opportunities
Anticipates the costs and benefits
Evaluates the risks and values
In this process of architecting, the system applies the discipline to produce the prescribed output components.
Enterprise Architecture is so special because of its holistic view of management and evolution of an enterprise holistically. It has a unique combination of specialist technologies, such as architecture frameworks and design pattern practices.
Such a special EA has the following key stakeholders/users in its ecosystem:
S.No.
Stakeholders
Organizational actions
1
Strategic planner
Capability planning
Set strategic direction
Impact analysis
2
Decision makers
Investment
Divestment
Approvals for the project
Alignment with strategic direction
3
Analyst
Quality assurance
Compliance
Alignment with business goals
4
Project managers
Solution development
Investigate opportunities
Analysis of existing options
Though many organizations intervened without EAs, every firm has the strong belief that it is better to architect before creating any system. It is integrated in a coherent fashion with a proactively designed system instead of a random ad hoc and inconsistent mode.
In terms of business benefits, cost is the key factor in the meaning of Return on Investment (RoI). That is how the industry business is driven in this highly competitive IT world. EA has the opportunity to prove its value for its own stakeholders with three major benefits, ranging from tactical to strategic positions. They are as follows:
Cost reduction by technology standardization
Business Process Improvement
(
BPI
)
Strategic differentiation
In the grand scheme of cost saving strategy, technology standardization adds a lot of efficiency to create indirect benefits. Let me share my experience in this space. In one of my earlier legacy organizations, it was noticed that the variety of technologies and products were built to serve the business purpose due to historical acquisitions and mergers.
All businesses have processes; a few life examples are credit card processing, employee on-boarding, student enrollment, and so on. In this methodology, there are people involved with few steps for the particular system to get things done. During rapid business growth, the processes become chaotic, which leads to duplicate efforts across departments. In turn, stakeholders do not leverage the collaboration and cross learning.
BPI is an industry approach that is designed to support the enterprise for the realignment of the existing business operational process into the significantly improved process. It helps the enterprise to identify and adopt in a better way using industry tools and techniques.
BPI was originally designed to induce a drastic, game-changing effect on enterprise performance instead of bringing changes in incremental steps.
In the current, highly competitive market, Strategic Differentiation efforts make a firm create the perception in customers minds of receiving something of greater value than is offered by the competition. An effective differentiation strategy is the best tool to highlight a business's unique features and make it stand out from the crowd.
As the outcome of strategic differentiation, the business should realize the benefits of Enterprise Architecture investment. Also, it makes the business institute new ways of thinking to add new customer segments along with new major competitive strategies.
When I planned to switch my career to the architecture track, I had too many questions in mind. People were referring to so many titles in the industry, such as architect, solution architect, enterprise architect, data architect, infra architect, and so on that I didn't know where exactly do I needed to start and end. The industry had so many confusions to opt for. To understand it better, let me give my own work experience as the best use cases.
In the IT industry, two higher-level architects are named as follows:
Solution architect
(
SA
)
Enterprise architect
(
EA
)
In my view, Enterprise Architecture is a much broader discipline than Solution Architecture, with the sum of Business Architecture, Application Architecture, Data Architecture, and Technology Architecture. It will be covered in detail in the subsequent section:
SA is focused on a specific solution and addresses the technological details that are compiled to the standards, roadmaps, and strategic objectives of the business. In comparison with SA, EA is a more senior level. In general, EA takes a strategic, inclusive, and long term view of goals, opportunities, and challenges facing the company. However, SA is assigned to a particular project/program in an enterprise to ensure technical integrity and consistency of the solution at every stage of its life cycle.
Let me explain the working experiences of two different roles--EA and SA. When I played the SA role for an Internet based telephony system, my role was to build tools, such as code generation, automation, and so on around the existing telephony system. It needed the skill set of the Microsoft platform technology and telephony domain to understand the existing system in a better way and then provide better solutions to improve the productivity and performance of the existing ecosystem. I was not really involved in the enterprise-level decision making process. Basically, I was pretty much like an individual contributor to building effective and efficient solutions to improvise the current system.
As the second job, let me share my experience in the EA role for a leading financial company. The job was to build the enterprise data hub using emerging big data technology.
If we plot EA versus SA graphically, EA needs higher degree of strategy focus and technology breath, as depicted in the following image:
In terms of roles and responsibilities, EA and SA differ in their scope. Basically, the SA scope is limited within a project team and the expected delivery is to make the system quality of the solution for the business. At the same time, the EA scope is beyond SA by identifying or envisioning the future state of an organization.
With the degree of experience, expertise, responsibility, and much more. EA is superior to SA. EA has the vision of end-to-end broader system knowledge; but SA is bound to a specific problem statement. In terms of enterprise role, EA role is pretty close to Chief Architect, whereas SA is at the Senior Architect level.
In the real-world scenario, the Enterprise Architecture Framework (EAF) inspires software development processes in the industry. It is essential to fulfill the mission of the associated enterprise.
In a nutshell, EA serves as the blueprint for the system and the project that develops it. An EAF can describe the underlying infrastructure, thus providing the groundwork for the hardware, software, and networks to work together.
With the usage of EAF, the organization will be in a situation to understand and analyze the weaknesses or inconsistencies to be identified and addressed. As per the fundamentals of computing, a framework is often a layered structure indicating what kind of programs can or should be built, and how they will interrelate.
To my knowledge, there are a few established EAFs available in the industry today. Some of them were developed for a very specific area, whereas others have a broader coverage with complete functionality.
In my view, there are two common types of EAFs used in the industry, which are as follows:
General Purpose Framework
Domain Specific Framework
As the name describes, these frameworks are designed by being agnostic to any specific implementation. They have no specific business drivers in terms of an enterprise specific scenario, but rather, they are capability based. Some of the well-known general purpose EA Frameworks are TOGAF and Zachman.
As self-described, these frameworks are derived from the common EA effort, in turn referred to as domain specific. By design, they are derived with a predefined set of business conditions and concerns because they may have originated from an Enterprise Architecture team or process improvement effort. On rolling out to the industry, these frameworks are mostly driven by government agencies or other geographies.
Based on the types of industry of the EA Frameworks, the type charter is depicted as follows:
By design, the EA Framework provides a conceptual framework to explain the following:
How the key terms are related to each other conceptually for architectural description
The following are the number of scenarios for the enterprise architectural activities during the software life cycle:
Evolutionary system
Existing architecture
Architectural evaluation
The role of the stakeholders in the creation and use of an architecture description
In this book, we will cover the foundations of two commonly known, general purpose EA Frameworks, which are as follows:
TOGAF
Zachman Framework
We will look into their details after the layers of Enterprise Architecture section as follows:
In 1992, Steven H. Spewak defined Enterprise Architecture Planning (EAP) as the process of defining architectures for the use of information in support of the business and the plan for implementing those architectures.
In highly distributed computing, a layered architecture is recommended for a simple reason--to allocate the different responsibilities of the system to the respective layers. With the same principle, Enterprise Architecture is built on the same layer design concept. It is inspired with the idea to execute the relevant processes and services of the layer and its related components. Take a look at the following image:
As defined in the preceding image, each layer, namely Business, Data, Application, and Technology, is designed to delegate its execution to the underlying layer. It means that the top layer, Business, is coarse-grained level, whereas the bottom layer, Technology, is a fine-grained level.
Business Architecture is nothing but a blueprint of the enterprise. It helps you understand the organization and supports you to align the long-term strategic objectives and short-term tactical demands. Basically, it is the bridge between enterprise strategy and business functionality, as depicted in the following image:
As shown in the preceding image, Business Architecture has three dimensions at its core--Strategy, Operation, and Technology. The success factors of a Business Architecture are directly proportional to the business transformation, using strategy, a stable platform via technology, and exhibited excellence in the business operation.
In essence, the key aspect of the represented business by Business Architecture is tabulated as follows:
S.No.
Query raised
Target delivery
Sample
1
Who?
Stakeholders
End customers, senior managers.
2
Why?
Strategy
Tactics
Vision, mission, objectives of the business.
3
How?
Initiatives
Projects
Innovative development, operational excellence.
4
When?
Events
Business critical moments.
5
What?
Products
Services
Manufacturing output, customer facing service.
6
Where?
Policies
Regulations
Governing body, corporate policy, company process.
7
How well?
Metric
Measurement
Financial report, revenue trend, profit sharing.
Business Architecture is directly based on business strategy. By design, it is the foundation for subsequent architectures, where it is detailed into various aspects and disciplines of the business.
In my view, an ideal business architect delivers the framework of services and artifacts, which enables customers to rapidly deliver quantifiable business value with realistic, technology enabled, business solutions.
Data Architecture is the key contract between the business and technology in an enterprise. I experienced the value of Data Architecture during my tenure of the Enterprise Data Hub development initiative.
Data Architecture is designed in such a way that the real business data is handled smoothly across the layers of the enterprise architecture. It plays the key role/artifact to develop and implement governance supporting the enterprise data strategy. It collaborates/connects with the various enterprise objects, such as hardware, applications, networks, tools, technology choices, and data.
To support a variety of the commonly used enterprise applications and business improvement activities, the framework/layers of the Data Architecture is designed as follows:
As depicted in the preceding image, Data Architecture has three layers of components based on its operational strategy, namely Strategic, Tactical, and Operational. As self-described, most of the ground-level operations are executed in the lower components--Enterprise Application Integration (EAI), Business Intelligence (BI), and System Rationalization. Data is tactically architecture at the middle layer using the BPI program. The top layer of Data Architecture is getting involved in the Data Strategy of the underlying enterprise.
Let me illustrate with a real life example to easily understand enterprise data architecture. Our business use case is to build the inventory management system of a production factory. Consider the following image:
As depicted in the preceding image, the inventory management workflow is aimed towards the process of supervising and controlling stock items for the production in an efficient way. Let's get into the details of Data Architecture with this example.
In operation level, raw material information is fed into the inventory core system (Warehouse) in different formats/sources. EAI (tools such as Informatica) is the core component to ingest the incoming source data in a clean/expected layout. Rationalization is the process of extraction of the master data from the various systems of record of both internal and external systems. After processing, to produce the cleansed raw data using EAI and Rationalization in Warehouse, the BI layer takes the execution responsibilities. BI analyzes the enterprise's raw data from the various sources of the system.
Therefore, the lower operational layer of Data Architecture deals with the processing of inventory data from end to end, ranging from raw material to shipping the finished products. Thus, the operational layer cuts across the entire phase of the business.
The next tactical layer BPI is used to improve the existing business operation to accomplish significant improvement in production. In our use case, let's say the raw materials are sourced from various locations around the globe. In doing the various analysis methodologies, the BPI system can come up with an efficient way of sourcing the raw materials for the inventory. Of course, the existing raw data is essential for any prediction/analysis. Effective BPI generates promising results operational efficiency and customer focus, which in turn improves the productivity and profitability of the business.
By definition, enterprise data strategy is the comprehensive vision and actionable foundation for an organization's ability to harness data-related or data-dependent capability. To emphasize the importance of Data Strategy, let me share an interesting answer by Bill Gates of Microsoft. When he was asked a question--"What is the most important asset of your company?" he replied--"Data". In our use case, by doing Data Strategy of the inventory system, it drives the business to be a customer-centric data driven culture. In general, legacy systems produce data silos that will get in the way of understanding customers. This is a big challenge; without a Data Strategy, it is next to impossible for any inventory system. Due to the characteristic of relevancy, which is contextual to the organization, evolutionary, and expected to change on a regular basis, enterprise data strategy is essential to build the comprehensive strategies necessary to make a real difference for the organization.
In general, software application is designed to meet an organizational need in reality mode. As the business model is quite common in a similar industry, it obviously expects the software application to build with the common architecture to satisfy the business requirements of an enterprise. As a result, Application Architecture is built in a generic way to create the business system, which is required to meet the specific requirements of the business.
By definition, Application Architecture specifies the leveraging technologies. Technologies are easily used to implement information systems, such as data, processes, and interfaces. On top of that, Application Architecture describes the details of the internal components and the way they interact to build the complete information system.
In terms of the engineering principle, Application Architecture exhibits the execution steps and methods in the model of the system blueprint into the reality of the leveraging enterprise.
Applications are generally categorized in the following listed types, along with their related characteristics. The categorization is based on the nature of the business process:
S.No.
Application processing type
Characteristics
Sample
1
Data
It is completely data-centric without explicit user manual intervention
Customer store
Payroll application
2
Transaction
On the receipt of user requests, system-centric data is updated with the received information in a system database
E-commerce application
Financial trade app
3
Event
This system is based on the receipt of the interested events from the system environment; it is not necessary to process non-interested data points
Traffic control system
Real-time dashboard
4
Language
Users' interventions are specified in a formal language to be processed by the underlying system. It is mostly involved in system programming
Compilers and interpreter
Command processor
Irrespective of the preceding types of application, Application Architecture is designed into the logical groupings of the software components. These logical layers help you differentiate between the different kinds of tasks performed by the components. In turn, the system is easier to support the design principle of reusability across the platform.
Each layer can be implemented as a large scale component running on a separate server. It is the most commonly used web-based architectural model in the industry. As a common practice, six layers are designed in the Application Architecture of the industry, which are as follows:
End User Layer
: This is an individual who uses the product after it is fully developed and marketed. This layer is around the usage pattern of the end user. As a result of rapid technology growth in recent times, the End User Layer is essential to build for desktop, web, mobile, pad, and so on.
Presentation Layer
: This contains the end user oriented functionality responsible for managing user interaction with the core system. In general, it consists of components that provide a common bridge between the end user and core business logic encapsulated in the business layer. Presentation Layer consists of UI components to render the user output and UI processor for local processing.
Server Layer
: This implements the core functionality of the target system by encapsulating the relevant business logic. In modern design, this layer consists of components, some of which may expose service interfaces that other callers can use. It is termed as the heart of the system.
Access Layer
: This layer is a bridge between the core business/server layer and the persisted store layer. It is designed using the best access pattern and practices of the enterprise architecture. It has two key components, namely the
Data Access Component
(
DAC
) and
Service Gateway
(
SG
). DAC allows programmers to have a uniform and comprehensive way of developing applications that can access almost any data store. The SG component encapsulates the low-level details of communicating with a service by means of service interfaces. Moreover, SG provides an ideal location to provide common features, such as asynchronous invocation, caching, and error handling.
Persistence Layer
: As the application data is persisted in this layer, it provides access to data hosted within the boundaries of the system and data exposed by other networked systems. By design, data is accessed through services in modern Application Architecture.
External Layer
: This layer is designed to expose the functionality of the application as the services to the external customer. API is the popular term in the industry, through which business services are exposed externally to earn the profit by sharing the best services.
In conclusion, Applications Architecture is the art and science of ensuring the suite of enterprise applications to create the composite architecture with the characteristics of scalability, reliability, availability, and manageability.
Technology/Infrastructure architecture principles are defined in collaboration with operational staff. It is the duty of the application architect to correct any wrong assumptions that the team might make with regard to enterprise infra architecture. Traditionally, it covers the servers, desktops, storage, network, and so on.
In the current distortive and emerging technology world, collaboration is the key for success. On connecting and cooperating with various groups, it is easy to adapt into the latest trends instead of reinventing the wheel again on our own. Technology Architecture is highly influenced by this principle.
On playing the enterprise architect role, my experience educated me to insist on a high degree of collaboration with other types of architects in the system. It is expected to have a closer working experience with a solution architect to roll out the implementation of the specific technology and platform as part of the role. In fact, architecture is not at all specifically associated with a particular release of the software. If so, then it is probably not considered architecture:
As depicted in the preceding image, Technology Architecture layers start from the Network layers of LAN, WAN, or Remote Access. On top of the Network layer, the Security principles are laid with Identity, Isolation, and Permission models. Storage layer is designed on top of Network and Security
