SharePoint O365 Hybrid Future & Roadmap Sesha Mani [email protected] Jeffrey Zhu [email protected].
Enterprise Solution Patterns Jose Antonio Silva [email protected] [email protected] Lisboa...
-
date post
19-Dec-2015 -
Category
Documents
-
view
223 -
download
2
Transcript of Enterprise Solution Patterns Jose Antonio Silva [email protected] [email protected] Lisboa...
Enterprise Solution PatternsEnterprise Solution PatternsJose Antonio [email protected]
Lisboa9.12.2003
22
AgendaAgenda
What are patterns?Where do they fit?What are pattern clusters?
Web presentation patterns Deployment patterns Distributed systems patterns Services patterns
Conclusion Resources
33
What Is A Pattern?What Is A Pattern?
ContextContext
ProblemProblem SolutionSolution
44
Singleton PatternSingleton Pattern
Context: Control access to a class by controlling
its instantiation process Problem:
Certain types of data need to be globally accessed and maintained
This data is often unique in the system E.G. counter class
55
Singleton PatternSingleton Pattern Solution:/// <summary>/// Counter Class (Singleton)./// </summary>public class Counter{
private static Counter _instance = null;private Counter() {}public static Counter getInstance() {
if (_instance==null) {
_instance = new Counter();}return _instance;
}
//... functions provided by Counter }
/// <summary>/// Class Counter (Singleton)/// </summary>public sealed class Counter{
private static readonly Counter instance = new Counter();
private Counter(){}
public static Counter Instance{
get {
return instance; }
}//....
}
/// <summary>/// Class Counter (Singleton)/// </summary>public sealed class Counter{
private static readonly Counter instance = new Counter();
private Counter(){}
public static Counter Instance{
get {
return instance; }
}//....
}
66
Layered Architecture PatternLayered Architecture Pattern
Context: You are designing a complex enterprise
application composed of a large number of components across multiple levels of abstraction
Problem: How do you structure an application to
support such operational requirements such as maintainability, reusability, scalability, robustness and security?
77
Layered Architecture PatternLayered Architecture Pattern
EMEAEMEA
88
Enterprise Solution PatternsEnterprise Solution PatternsUsing Microsoft .NETUsing Microsoft .NETVersion 2.0Version 2.0
David Trowbridge
99
Pattern Description FormatPattern Description Format
What to read next?Related Patterns
Benefits and LiabilitiesResulting Context
Refers to associated Impl. PatternExample
Solution Description & Picture How does it solve the problem? What else do I have to think about?
Solution
What issues do I need to consider?
What alternatives are there?
Forces
What problem does it solve?Problem
Is this pattern relevant to my work?Context
1010
What are Patterns?What are Patterns?
Description Dimension Recurring problem Context Solution
Tool Integration Dimension Collection of atomic elements Description of relationships Transformations
1111
Pattern Descriptions Help Pattern Descriptions Help Architects And Designers By…Architects And Designers By…
Documenting simple mechanisms that work
Providing a common vocabulary and taxonomy
Enabling solutions to be described concisely as combinations of patterns
Enabling reuse of architecture, design, and implementation decisions
1212
Integrating Patterns into ToolsIntegrating Patterns into Tools
1313
Tool Integration Helps Tool Integration Helps Architects and Designers by …Architects and Designers by …
Providing prepackaged “chunks” of design experience
Automated transformation result in: Enhanced reliability Reduced coding time Simplified testing Flexibility from interchangeable components
EMEAEMEA
1414
Where do they fit?Where do they fit?
1515
Where Do Patterns Fit?Where Do Patterns Fit?
Provide distilled design knowledgeThey describe transformationsPatterns are not source code filesPatterns are not distributable
componentsPatterns are not data structuresPatterns do not have a thread of
execution
1616
Building a House Analogy …….Building a House Analogy …….
GuidelinesGuidelines BlueprintsBlueprints
MaterialsMaterials
PatternsPatterns
ProcessProcess
Fir, #2 2”x4”x8’ boards412
ASTM4’x8’x ½” sheet rk120
20 psf load48’ Trusses24NM 12-212 Ga. Elec. Wire350’DWV½ “ copper pipe200’
SpecDescriptionQty.
Bill of Materials
PeoplePeople
TaxonomyTaxonomyTaxonomyTaxonomy
PeoplePeopleFoundation
Roofing
Flooring
Walls Electrical
Plumbing Heating
TrussTrussCeilingCeiling
JoistsJoistsCoveriCoveri
ngng
RebaRebarr
ConcreConcretete
High-rise
Tilt-up
Pole BuildingCape Cod
Stick Frame
Pre-hung doors
Truss Frame
Log Home
Post and Beam
Pre-fab trussesFraming patternsWiring patterns
Patterns
1717
Building an Application …….Building an Application …….
TaxonomyTaxonomy
GuidelinesGuidelines BlueprintsBlueprints
ElementsElements
PatternsPatterns
PeoplePeopleProcessProcess
Guidelines
Local – within enterpriseIndustry - principles Elements
Application Controller (Custom)1
PAG Data Access Component1Microsoft SQL Server1
Microsoft Windows Server 20033Microsoft ASP.NET1DescriptionQty.
Layered Application
BrokerObserver
Implementing Singleton with C#
Model-View-ControllerFacade
Implementing MVC with ASP.NET
Patterns
Tiered Distribution
Gateway
1818
Patterns Do Not Live In IsolationPatterns Do Not Live In Isolation
1919
Organizing Our ThinkingOrganizing Our Thinking
DesignDesign
ArchitectureArchitecture
Impl.Impl.
DataData AppApp DeployDeploy InfrastructureInfrastructure
2020
ArchitectureArchitecture
DesignDesign
ImplementatiImplementationon
InfrastructurInfrastructuree
DeploymentDeploymentApplicationApplicationDataData
The Pattern GraphThe Pattern Graph
2121
ArchitectureArchitecture
DesignDesign
ImplementatiImplementationon
InfrastructurInfrastructuree
DeploymentDeploymentApplicationApplicationDataData
Patterns – Solutions LanguagePatterns – Solutions Language
ThreeThreeLayeredLayered
ApplicationApplication
Layered Layered ApplicationApplication
Simple Simple WebWeb
Complex Complex WebWeb
Rich ClientRich Client
Ext. EnterpriseExt. Enterprise
4-Tier4-Tier3-Tier3-Tier
TieredTieredDistributionDistribution
LayeredLayeredServicesServices
ApplicationApplication
2222
ArchitectureArchitectureApplication InfrastructureDeploymentDeployment
Tiered Distribution
• Scalability• Availability• Performance• Secure
Discrete Logical Layers Data & Functional Analysis
• Design Flexibility • Maintainability• Loose Coupling
Complex Web App
• Security• Component Reuse• Manageability• Performance Tradeoff
Complex Web App
• Security• Component Reuse• Manageability• Performance Tradeoff
D A D I
A
D
I
2323
DesignDesignApplication InfrastructureDeploymentDeployment
• Clusters• Zones• Policies • Protocols• Links
Design Classes & Mechanisms – eg:
• Security• Communication• Data Access• Exception Handling• Logging
Runtime Dependencies
Map Processes to Processors
Runtime Dependencies
Map Processes to Processors
D A D I
A
D
I
2424
ImplementationImplementation
Application InfrastructureDeploymentDeployment
• Hardware Spec & Configuration
• IP Addressees • Ports • Server & Files Names
Implementation Classes & Mechanisms
Product usage – eg: .NET remoting
Configuration Dependencies
Distribution Manifest – Components, Machines, Files…
Configuration Dependencies
Distribution Manifest – Components, Machines, Files…
D A D I
A
D
I
EMEAEMEA
2525
What are patterns clusters?What are patterns clusters?
2626
ArchitectureArchitecture
DesignDesign
ImplementatiImplementationon
InfrastructurInfrastructuree
DeploymentDeploymentApplicationApplicationDataData
The Pattern Graph - ClustersThe Pattern Graph - Clusters
ComponentsComponents
PresentationPresentation
FrameworkFramework
SecuritySecurity
Smart ClientSmart Client
2727
Current Area Of FocusCurrent Area Of Focus
Cluster Problem
Web Presentation How do you create dynamic Web applications?
Deployment How do you divide an application into layers and then deploy them onto a multi-tiered hardware infrastructure?
Distributed Systems How do you communicate with objects that reside in different processes or different computers?
Services How do you use functionality available remotely?How do you expose your application’s functionality over a network?
Performance and Reliability How do you create a systems infrastructure that can meet critical operational requirements?
ClustersClusters
OLTP No embedded systems, data warehouse
Object-Oriented Application No procedural or AOP Layered Application No monoliths Tiered Distribution No stand-alone desktop apps
Root ConstraintsRoot Constraints
2828
Web Presentation ClusterWeb Presentation Cluster
Model-View-Controller
Front Controller
Page Cache Intercepting Filter
ImplementingMVC
with ASP.Net ImplementingFront Controller with ASP.Net
ImplementingIntercepting Filter
with ASP.Net
ImplementingPage Cache
with ASP.Net
ImplementationImplementation
DesignDesign
Page Controller
ImplementingPage Controller with ASP.Net
2929
Model-View-ControllerModel-View-Controller How do you modularize the user interface
functionality of a Web application so that you can easily modify the individual parts? User Interface changes more frequently Same data displayed different ways Different skill sets required for UI design and App dev
Separate the modeling of the domain, the presentation, and the actions based on user input into separate classes
Model - manages the behavior and data of the application domain
View - display of information Controller - interprets the
mouse and keyboard inputs
3030
Implementing MVC InImplementing MVC InASP .NETASP .NET
public class DatabaseGateway{ public static DataSet GetRecordings() {…} public static DataSet GetTracks(…) {…}}
public class DatabaseGateway{ public static DataSet GetRecordings() {…} public static DataSet GetTracks(…) {…}}
public class Solution : System.Web.UI.Page{private void Page_Load(…) {…} void SubmitBtn_Click(Object sender, EventArgs e) { DataSet ds = DatabaseGateway.GetTracks (…) MyDataGrid.DataSource = ds; MyDataGrid.DataBind … }}
public class Solution : System.Web.UI.Page{private void Page_Load(…) {…} void SubmitBtn_Click(Object sender, EventArgs e) { DataSet ds = DatabaseGateway.GetTracks (…) MyDataGrid.DataSource = ds; MyDataGrid.DataBind … }}
ModelModel
ControllerController
<%@ Page language="c#" Codebehind="Solution.aspx.cs"
AutoEventWireup="false" Inherits="Solution" %>
<html>
<body>
<form id="Solution" method="post" runat="server">
<asp:dropdownlist id="recordingSelect“… />
<asp:button id="submit" … />
<asp:datagrid id="MyDataGrid" … />
</form>
</body>
</html>
<%@ Page language="c#" Codebehind="Solution.aspx.cs"
AutoEventWireup="false" Inherits="Solution" %>
<html>
<body>
<form id="Solution" method="post" runat="server">
<asp:dropdownlist id="recordingSelect“… />
<asp:button id="submit" … />
<asp:datagrid id="MyDataGrid" … />
</form>
</body>
</html>ViewView
3131
Page ControllerPage Controller
How do you best structure the controller for moderately complex Web applications so that you can achieve reuse and flexibility while avoiding code duplication? MVC focuses primarily on the separation between the
model and the view Many dynamic Web pages involve similar steps: verifying
user authentication, extracting query string parameters etc. Testing user interface code is time-consuming
Use the Page Controller pattern to accept input from the page request, invoke the requested actions on the model, and determine the correct view to use for the resulting page
3232
Implementing Page Controller Implementing Page Controller in ASP.NETin ASP.NET
public class BasePage : Page{ virtual protected void PageLoadEvent(object
sender, System.EventArgs e) {} protected void Page_Load(…) { … string name = Context.User.Identity.Name; eMail.Text = DBGateway.RetrieveAddress(name); siteName.Text = "Micro-site"; … PageLoadEvent(sender, e); }}
BenefitsBenefits SimplicitySimplicity Leverages Framework featuresLeverages Framework features Increased reuseIncreased reuse
LiabilitiesLiabilities One controller per pageOne controller per page Deep inheritance treesDeep inheritance trees
3333
Front ControllerFront Controller
How do you best structure the controller for very complex Web applications so that you can achieve reuse and flexibility while avoiding code duplication? Page controller can lead to overburdened base classes Inheritance hierarchy is static Might need to coordinate processes across pages Might deal with dynamic navigation paths,
e.g. a ‘Wizard’ that includes optional pages
Front Controller solves the decentralization problem present in Page Controller by channeling all requests through a single controller
3434
Implementing Front Controller In Implementing Front Controller In ASP .NET Using HTTP HandlerASP .NET Using HTTP Handler
public class Handler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
Command command =
CommandFactory.Make(context.Request.Params);
command.Execute(context);
}
…
}
public class CommandFactory
{
public static Command Make(NameValueCollection parms)
{
string siteName = parms["site"];
Command command = new UnknownCommand();
if (siteName == null || siteName.Equals("micro"))
command = new MicroSite();
else if(siteName.Equals("macro"))
command = new MacroSite();
return command;
}
}
3535
Implementing Front Controller In Implementing Front Controller In ASP .NET Using HTTP HandlerASP .NET Using HTTP Handler
Benefits Flexibility Simplified Views Open for extension, but
closed to modification (open-closed principle)
Supports URL mapping Thread-safety
Liabilities Performance Implications
(object creation) Additional complexity
3636
Deployment ClusterDeployment Cluster
Key Points Layers – Logical application structure Tiers – Physical distribution onto
server infrastructure Deployment – Application and
infrastructure teams map components to tiers
Pattern Problem
Layered Application
How do you structure an application to support such operational requirements as maintainability, reusability, scalability, robustness, and security?
Three-Layered Services Application
How do you layer a service-oriented application and then determine the components in each layer?
Tiered Distribution How should you structure your servers and distribute functionality across them to efficiently meet the operational requirements of the solution?
Three-Tiered Distribution
How many tiers should you have, and what should be in each tier?
Deployment Plan How do you determine which tier you should deploy each of your components to?
3737
Layered ApplicationLayered Application
Problem How do you structure an application to support such operational
requirements as maintainability, reusability, scalability, robustness, and security?
Forces Impact of change Separation of concerns Independent components Operational requirements
Solution Separate the components of your solution into layers. The
components in each layer should be cohesive and at roughly the same level of abstraction; Each layer should be loosely coupled to the layers underneath
3838
Layered ApplicationLayered Application
Discussion Points Dependency management Strict versus relaxed Top down versus bottom up Custom Reuse existing scheme Testing considerations
Benefits Easier maintenance and
enhancement Reuse Support for distributed dev Enables tiered distribution Testability
Liabilities Layer overhead Bound data Complexity Custom Change propagation
3939
Three Layered Services Three Layered Services ApplicationApplication
Problem How do you layer a service-oriented application
and then determine the components in each layer?
Forces Minimize impact of adding service to an application Differing operational requirements by
component type Separation of concerns
Solution Base your layered architecture on three layers –
presentation, business, and data
4040
4-Layered Services Application4-Layered Services Application
Discussion Points Presentation layer Business layer Data layer Foundation services
Benefits Separation of concerns Minimal layers Liabilities
Complex business logic may require more business layers
Complex UI apps may require additional UI layers
4141
Tiered DistributionTiered Distribution
Problem How should you structure your servers and distribute functionality
across them to efficiently meet the operational requirements of the solution?
Forces Resource Consumption Server Optimization Security Requirements Geographic and licensing constraints
Solution Structure your servers and client computers into a set of physical
tiers; A tier is composed of one or more computers that share one or more of the following characteristics System resource consumption profile Operational requirements Design constraints
4242
Tiered DistributionTiered Distribution
Benefits Tiers optimized for
specific task Different security needs Operational
requirements Admin and deployment
overhead
Liabilities Performance Admin overhead Complexity
4343
Three-Tiered DistributionThree-Tiered Distribution
Problem How many tiers should you have, and what should be in
each tier?
Forces Database load Security policies Reuse Scalability
Solution Structure your application around three physical tiers:
Client, application, and database
4444
Three-Tiered DistributionThree-Tiered Distribution
Benefits Scalability and fault
Tolerance Support thin client
solutions Security Collocated app & web
server performance
Liabilities Business logic exposed
to client tier Incremental cost of
adding web server
Discussion Points Server optimization Security Server farms Clustering
4545
Deployment PlanDeployment Plan
Problem How do you determine which tier you should deploy each of
your components to?
Forces Layers != Tiers Different Skill Sets Impact of adding tiers Resource Consumption Constraints, security and operational requirements Performance Impact of distribution
Solution The application architects must meet with the system
architects to create a deployment plan that describes which tier each of the application's components will be deployed to
4646
Deployment PlanDeployment Plan
Discussion Points Importance of testable
requirements Define Tiers and Components Map Components to tiers Models
Simple Web App Complex Web App Extended Enterprise App Smart Client App
Benefits Equal emphasis on both
operational and functional requirements
Increased communication
4747
Distributed Systems ClusterDistributed Systems Cluster
Key Points Distributed Computing Challenges Layered Applications Coarse Grained Interfaces Client versus Server Activation
Pattern Problem
Broker How can you structure a distributed system so that application developers don’t have to concern themselves with the details of
remote communication? Implementing Broker with .Net Remoting (Server Activated)
How do you Implement Broker in .Net?
Singleton How do you make an instance of an object globally available and guarantee that only one instance of the class is created?
Implementing Singleton in .Net
How do you Implement Singleton in .Net
5454
Services PatternsServices Patterns
Pattern Problem
Service Interface How do you make pieces of your application's functionality available to other applications, while ensuring that the interface mechanics are decoupled from the application logic?
Implementing Service Interface using .NET
How do you Implement Service Interface in .Net?
Service Gateway How do you decouple the details of fulfilling the contract responsibilities defined by the service from the rest of your application?
Implementing ServiceGateway with .NET
How do you Implement Service Gateway in .Net
Key Points Service vs. Instance interfaces Far Links Web Services are About Interop
5555
Service InterfaceService Interface
Problem How do you expose your application’s functionality over a
network so it can be consumed by disparate applications?
Forces Separation of concerns – business logic and service contract
issues Consuming applications may require different channels for
optimization
Solution Design your application as a collection of software
services, each with a service interface through which consumers of the application may interact with the service.
5656
Service InterfaceService Interface
Discussion Points Service vs. instance Specialized kind of
Remote Façade May want to aggregate
in to Service Layer
Benefits Application flexibility Optimized performance Interoperable
Liabilities Adds complexity
5757
Implementing Service InterfaceImplementing Service Interfaceusing .NETusing .NET
5858
Service GatewayService Gateway Context
You are designing an application that consumes services provided by another application. The use of this service is governed by a contract indicating communication protocols, msg formats, etc.
Problem How do you decouple the contract implementation
responsibility from the rest of your application?
Forces Communication and message details often change at a
different rate than business logic Your application may use a different data format than an
external service, therefore the data may need transformation
If the contract changes, you want to localize the impact of the change within your application
Solution Encapsulate contract implementation code in to a Service
Gateway component
5959
Implementing Service GatewayImplementing Service Gatewaywith .NETwith .NET
Key Points RecordingCatalog is
the Gateway
Recording and Trackare Data Transfer
Objects
6060
Implementing Service GatewayImplementing Service GatewayIn .NETIn .NET
EMEAEMEA
6161
Enterprise Solution PatternsEnterprise Solution PatternsUsing Microsoft .NETUsing Microsoft .NETVersion 2.0Version 2.0
David Trowbridge
6262
ConclusionConclusion
Patterns contain atomic chunks of design information
They enable reuse of architecture, design and implementation decisions
Provide a common vocabulary and taxonomy
Strong potential for tool integration
EMEAEMEA
6363
E S Patterns at TechEd 2003E S Patterns at TechEd 2003By David Trowbridgehttp://microsoft.sitestream.com/DEV/DEV361_files/default.htm
Last year’s EMEA Architect Tour Last year’s EMEA Architect Tour (Finland)(Finland)http://www.dotnetmaailma.com/dotnetmaailma/seminaarit/online/EMEA+Architects+Tour.htm
6464
Patterns catalog online (Patterns catalog online (complete complete listlist))Enterprise Solution Patterns (book;
v2.0)http://msdn.microsoft.com/practices/type/Patterns/Enterprise/
27+5
Data Patterns (book)http://msdn.microsoft.com/practices/type/Patterns/Data/ 12
Patterns community: http://www.gotdotnet.com/team/archticture
6565
Longhorn Developer PreviewLonghorn Developer PreviewLisboa, 9 FevereiroLisboa, 9 Fevereiro
The road to “Longhorn” David Chappell
“Avalon”: The Longhorn User Experience Lester Madden, Microsoft EMEA
“Indigo”: The Longhorn Communications Clemens Vasters, newtelligence AG
“WinFS”: The Longhorn File System Hans Verbeeck, Microsoft EMEA
“Whidbey”: Get ready for Longhorn Nigel Watling, Microsoft EMEA
6666
Connected Applications TourConnected Applications TourApril 2004April 2004
Web Services, Biztalk & Indigo
EMEAEMEA
6767
Obrigado
José António [email protected]://canoas.com/blog/
Obrigado
José António [email protected]://canoas.com/blog/