Development Patterns and Best Practices: Page 1 of 6

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

______

___

Development Patterns and Best Practices

Page 1 of 6 OnX Enterprise Solutions Inc. All Rights Reserved. OnX.com

______

___

Development Patterns and Best Practices


OnX implements and strongly supports Microsofts Patterns and Best Practices. They are a set of guidelines that identify key design decisions that are made, during the early phases of development and provide design-level guidance to help choose appropriate design options, where applicable. These guidelines help to develop an overall design by presenting a consistent architecture built of different types of components that will help achieve a good design, taking full advantage of the Microsoft platform. In addition, these guidelines serve as a roadmap of the most important distributed application design issues encountered when using the Microsoft platform. They also simplify application readiness, towards a serviceoriented architecture (SOA). This by its very nature forces the solution to be loosely coupled. Thus, allowing the solution to be transferable and portable, from one business premises to another. These guidelines are becoming an industry standard, allowing for consistent design patterns that are shared across different business verticals development teams.

Component Types
Every software solution contains similar kinds of components, regardless of the specific business need it addresses. For example, most applications contain components that access data, encapsulate business rules, handles user interaction and external services. Identifying the kinds of components commonly found in distributed software solutions will help you build a blueprint for an application or service design.

Page 2 of 6 OnX Enterprise Solutions Inc. All Rights Reserved. OnX.com

______
purpose.

___

Below is a diagram depicting commonly found components and a brief description of their

1 2

UI Components UI Process Components

External Services Layer

Service Interfaces Business Workflows


4

Business Components
5 6 8

Business Entities

Data Access Components

Service Agents

Data Layer

Services Layer
Other External Services

Component Types Diagram

Component descriptions:
1. User interface (UI) components: Most solutions need to provide a way for users to interact with the application. User interfaces are implemented using Windows Forms, Microsoft ASP.NET pages, controls, or any other technology you use to render and format data for users and to acquire and validate data coming in from them. 2. User Process Components: In many cases, a user interaction with the system follows a predictable process. For example, in a retail application you could implement a procedure for viewing product data that has a user select a category from a list of available product categories and then select an individual product to view more detail. Processes of this nature are common no matter what user interface a user may be presented. User Process Components may be viewed as business logic from a user interface perspective. In some case, authenticating the user may also occur at this level. However, authentication is usually done within the Service interface layer.

Page 3 of 6 OnX Enterprise Solutions Inc. All Rights Reserved. OnX.com

______
interfaces that support the communication contracts (message-based

___

3. Service interfaces: To expose business logic as a service, you must create service communication, formats, protocols, security, exceptions, and so on) that consumers require. Service interfaces are sometimes referred to as business facades. In addition, they provide the ability to separate layers across physical tiers. Typically, authenticating users and/or incoming services occur at this level. 4. Business workflows: After the required data is collected by a user process, the data can be used to perform a business process. Many business processes involve multiple steps that must be performed in the correct order and orchestrated. Business workflows define and coordinate long-running, multi-step business processes, and they can be implemented using business process management tools such as BizTalk Server Orchestration. 5. Business components: Regardless of whether a business process consists of a single step or an orchestrated workflow, your application will probably require components that implement business rules and perform business tasks. Business components implement the business logic of the application. 6. Business entity components: Most applications require data to be passed between components. The data is used to represent real-world business entities, such as products or orders. The business entities that are used internally in the application are usually data structures, such as DataSets, DataReaders, or Extensible Markup Language (XML) streams. 7. Data access logic components: Most applications and services will need to access a data store at some point during a business process. It makes sense to abstract the logic necessary to access data in a separate layer of data access logic components. Doing so centralizes data access functionality and makes it easier to configure and maintain. 8. Service agents: When a business component needs to use functionality provided by external service, you may need to provide some code to manage the semantics of communicating with that particular service. Service agents isolate the idiosyncrasies of calling diverse services from your application, and can provide additional services, such as basic mapping between the format of the data exposed by the service and the format your application requires. 9. Components for security, operational management and communication: Your application will probably also use components to authorize users to perform certain tasks, and to communicate with other services and applications.

Component Interaction Diagram


The diagram below depicts an interaction model between components and the layers they reside in. A brief description of how they interact is also provided.

Page 4 of 6 OnX Enterprise Solutions Inc. All Rights Reserved. OnX.com

______
Presentation Layers UI Process Component

___

UI Components
1

Service Interface
2

Business Component
3 3 4

Service Agent Component

Business Component

Data Access Components

Component Interaction Diagram

Component Interaction:
1. UI Process Components initiate a call to a Business component via the Service Interface component. Business Entities such as Datasets or XML streams, many be used to send or receive data between layers. There are however, exceptions to this rule (not shown in the diagram). There are times when read-only access to data are required, and bypass the business components and calling the data access components directly is more desirable. This aids in the efficiency and simplicity of the overall design. 2. UI Process Components as well as external services will make calls directly to the Service Interface component. Typically, Service Interface components are thin wrappers that authenticate and authorize the caller, prior to delegating the call to a Business Workflow, Business, Data Access or Service Agent component, responsible for the actual work. Service Interface components are typically designed using Web Services or .NET Remoting. 3. Data Access components are typically called by Business Workflows or Business components. Although not shown, Service Interface components may call read-only Data Access components directly, where business rules do not apply. 4. Similar to Data Access components, Service Agents are typically called by Business Workflows or Business components. Although not shown, Service Interface

Page 5 of 6 OnX Enterprise Solutions Inc. All Rights Reserved. OnX.com

______
rules do not apply.

___

components may call read-only Service Agent components directly, where business

Workflow Component Interaction Diagram


The diagram below depicts an interaction model between workflow components and the layers they reside in. A brief description of how they interact is also provided.

Workflow Component Interaction Diagram

Workflow Component Interaction:


1. UI Process components as well as external services will make calls directly to the Service Interface component. Typically, Service Interface components are thin wrappers that authenticate and authorize the caller, prior to delegating the call to a Business Workflow, Business, Data Access or Service Agent component, responsible for the actual work. Service Interface components are typically designed using Web Services or .NET Remoting. 2. Business Workflow components are typically called via the Services Interface layer. Within the business workflow process, calls to Business, Data Access and Service Agent components may be called upon for processing requests. In addition, Business Workflow components can call other Business Workflow components.

Page 6 of 6 OnX Enterprise Solutions Inc. All Rights Reserved. OnX.com

You might also like