Tải bản đầy đủ (.pdf) (34 trang)

Module 2: Architecture and Structural Design Patterns

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.22 MB, 34 trang )









Contents
Overview 1
Introduction to Architecture Templates 2
Design Patterns Used in Architecture 6
The Enterprise Template 11
Other Architecture Templates 17
MSF Enterprise Architecture 20
Best Practices 23
Lab 2: Architecture and Structural
Design Patterns 24
Review 28

Module 2: Architecture
and Structural Design
Patterns

Information in this document is subject to change without notice. The names of companies,
products, people, characters, and/or data mentioned herein are fictitious and are in no way intended
to represent any real individual, company, product, or event, unless otherwise noted. Complying
with all applicable copyright laws is the responsibility of the user. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Microsoft Corporation. If, however, your only
means of access is electronic, permission to print one copy is hereby granted.



Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.

 2000 Microsoft Corporation. All rights reserved.

Microsoft, Active Directory, ActiveX, BackOffice, FrontPage, Microsoft Press, MSDN, MS-DOS,
PowerPoint, Visio, Visual Basic, Visual C++, Visual InterDev, Visual J++, Visual Studio, Win32,
Windows, and Windows NT are either registered trademarks or trademarks of Microsoft
Corporation in the U.S.A. and/or other countries.

Other product and company names mentioned herein may be the trademarks of their respective
owners.

Program Managers: Rhy Mednick, Susie Parrent
Instructional Designer: Susie Parrent
Subject Matter Experts: David Chesnut, Sam Gill (TechnoWiz), Michel Pahud
Media Management: David Mahlmann
Editing Manager: Lynette Skinner
Editor: Mick Alberts, Jennifer Linn
Production Manager: Miracle Davis
Print Coordinators: Linda Lu Cannon (Write Stuff), Marlene Lambert (Online Training
Solutions, Inc.)
Build Coordinator: Eric Wagoner
Graphic Artist: Scott Serna
Test Lead: Eric Myers
Manufacturing Manager: John Williams
Group Product Manager: Juan Fernando Rivera

Lead Product Manager, System Services and Infrastructure: Edward Dudenhoefer
Manufacturing Manager: Rick Terek
Operations Coordinator: John Williams
Manufacturing Support: Laura King; Kathy Hershey
Lead Product Manager, Release Management: Bo Galford
Group Manager, Courseware Infrastructure: David Bramble
General Manager: Robert Stewart

Module 2: Architecture and Structural Design Patterns iii


Instructor Notes
This module provides students with a detailed presentation about architecture
templates, which describe the building blocks of an application. To use a
building—or architecture—analogy, consider the structure of a building: a
foundation, pillars, walls, and an exterior shell. In this module, you will be
introduced to the structure of an application.
After completing this module, students will be able to:
!
Describe architecture templates.
!
Describe the creational design patterns.
!
Describe the structural design patterns.
!
Describe the Enterprise template.
!
Describe Enterprise Architecture and how it relates to an Enterprise
template.


Materials and Preparation
This section provides the materials and preparation tasks that you need to teach
this module.
Required Materials
To teach this module, you need the following materials:
!
Microsoft
®
PowerPoint
®
file 1910A_02.ppt
!
Module 2: Architecture and Structural Design Patterns
!
Lab 2: Architecture and Structural Design Patterns

Preparation Tasks
To prepare for this module, you should:
!
Read all of the materials for this module.
!
Complete the lab.

Presentation:
60 Minutes

Lab:
45 Minutes
iv Module 2: Architecture and Structural Design Patterns



Module Strategy
Use the following strategy to present this module:
!
Introduction to Architecture Templates
The purpose of this topic is to introduce students to the need for a model of
the “real world” in the logical design. The architecture template represents
the structure of the logical design model. This is only an introduction. Avoid
providing the details that will be provided in subsequent sections.
In the topic “Transition from Conceptual to Logical Design,” focus on the
first step in the transition from conceptual design to logical design, which is
to identify the creational and structural design patterns that can be used in
the architecture of the desired solution.
In the topic “What Are Architecture Templates?” emphasize that the
architecture template defines how to create a Microsoft Windows
®
2000
solution.
!
Design Patterns Used in Architecture
The purpose of this section is to introduce students to creational and
structural design patterns that can be used to create a logical architecture.
In the topic “Creational,” focus on the sample of the Abstract Factory and
its implementation as a Remote Data Service (RDS) in the Microsoft Data
Access Components (MDAC). Mention that creational design patterns are
now implemented as Windows 2000 capabilities and emphasize the need to
continue to create additional creational patterns that might evolve into
additional operating system services.
In the topic “Structural,” focus on the sample of the Composite design
pattern and its implementation as a Component Object Model (COM)

collection object. Mention that another structural design pattern that is going
to be heavily used in an architecture template is the Facade.
!
The Enterprise Template
The purpose of this section is to introduce students to the components of the
Enterprise template and to emphasize the new additions: facade, data access
layer (DAL), and system services.
In the topic “Facade Sequence Diagram,” point out the sequence in which
the Web services facade layer is used.
In the topic “System Services,” review briefly the Decorator structural
design pattern and the use of authenticate and audit as examples of system
services.
!
Other Architecture Templates
The purpose of this section is to introduce students to the possibility of
using other architecture templates and in particular to introduce two others:
the Web template and the Business template.
!
MSF Enterprise Architecture
The purpose of this section is to introduce students to the Microsoft
Solutions Framework (MSF) Enterprise Architecture and to differentiate it
from the Enterprise template. You can use the following analogy to explain
the difference: Enterprise Architecture is like a master plan for the
continued development of a village, whereas the architecture template is the
building code for all of the buildings that will be constructed in the village.
Module 2: Architecture and Structural Design Patterns v


In the topic “MSF Enterprise Architecture Overview,” explain that the
primary purpose of Enterprise Architecture is to position all applications on

an information technology (IT) landscape, and focus on the applications that
have fallen into the abyss.
!
Best Practices
Use the village analogy to emphasize that you can’t build a village without a
building code. You also want the code to reflect good practices. Finally, you
want the code to incorporate enough flexibility to allow people to be
creative in designing their homes.

Lab Strategy
!
Lab 2: Architecture and Structural Design Patterns
The purpose of this lab is to help students become more familiar with
structural design patterns and architecture templates. Consider discussing
the scenario and problem statement from the lab before letting students
work on the lab. Make sure all students understand the scenario. Don’t
embellish the scenario; keep it simple. Discuss with students their answers
to Lab 2.


Module 2: Architecture and Structural Design Patterns 1


#
##
#

Overview
!
Introduction to Architecture Templates

!
Design Patterns Used in Architecture
!
The Enterprise Template
!
Other Architecture Templates
!
MSF Enterprise Architecture
!
Best Practices


In this module, you will be introduced to architecture templates. Architecture
templates describe the building blocks of an application. To use a building or
architecture analogy, consider the structure of the building. This structure
consists of a foundation, pillars, walls, and an exterior shell. In this module, you
will be introduced to the structure of an application.
After completing this module, you will be able to:
!
Describe architecture templates.
!
Describe the creational design patterns.
!
Describe the structural design patterns.
!
Describe the Enterprise template.
!
Describe Enterprise Architecture and how it relates to an Enterprise
template.


Topic Objective
To provide an overview of
the module topics and
objectives.
Lead-in
In this module, you will learn
about architecture and
Enterprise templates and
about design patterns that
are used in the architecture
template.
2 Module 2: Architecture and Structural Design Patterns


#
##
#

Introduction to Architecture Templates
!
The Problem
!
Transition from Conceptual to Logical Design
!
What Are Architecture Templates?


Architecture templates describe the structure of an application. They tell you
the layers that an application should have, and the type of objects (logical
design) and components (physical design) that should be included in each layer.

In this section, the architecture template will be placed in the proper context of
the problem that is being addressed. This will be followed by a presentation
about the process of transitioning from conceptual design to logical design. The
section concludes with a precise definition of what makes up an architecture
template.
Topic Objective
To provide an overview of
the section topics and
objectives.
Lead-in
In this section, you will learn
what makes up an
architecture template.
Module 2: Architecture and Structural Design Patterns 3


The Problem
Real World
User Services
Business Services
Data Services


In the preceding slide, the cloud represents the “real world.” The applications
that you design are representations of the real world. While at times you night
come to believe that a computer-based application is the real world, it is still
only a view of the real world. In other words, activities take place in the real
world but are recorded in a view—the computer application.
To create a precise and concise representation of the real world, it is necessary
to abstract from the complexities of the real world; this abstraction is the model.

The model is built from pieces that interact that are called components. The
interactions between the components and the behavior of each of the
components define the salient features of the real world as they are represented
in the model.
Another way of phrasing this is to say that the model imposes structure on the
real world in order to be able to represent it.
The first question that comes up is “What shape should this structure be?” That
is the issue that the architecture template addresses.
The representation of the real world in a computer-based application model is
an art rather than a science. Having said that, there are techniques that improve
the quality of the design of the model. In particular, object oriented design
methodology offers a systematic approach for designing computer applications
that successfully model the real world.
Topic Objective
To provide a background
about the business problem.
Lead-in
In this topic, you will learn
about the business problem
facing application designers
that leads to the need for a
system services layer.
4 Module 2: Architecture and Structural Design Patterns


Transition from Conceptual to Logical Design
Requestor
Enter New Requisition
Vendor
Requestor VendorRequisition

Design
Patterns


Object oriented analysis and design methodology begins with a conceptual
representation of an application that consists of actors and use cases, as
described in Module 1, “Designing Distributed Applications for Windows
2000.”
The next step in the design process is to map the conceptual design to a logical
design. In this step, you must determine the solution characteristics, which are
the restrictions on the representation of the real world in the model. Using
creational and structural design patterns, you map the solution characteristics to
the template architecture. In general, solution characteristics include
consistency, reduction, reusability, the ability to integrate, maintainability, and
flexibility.
Creational design patterns abstract the instantiation process. A client becomes
independent of how its objects are created or composed. For example,
creational design patterns include a Factory Method that allows you to create
objects at run time. An example of a Factory Method implementation is the
CreateObject method in VBScript (a script written in the Microsoft Visual
Basic
®
Scripting Edition).
Structural patterns, on the other hand, are concerned with how logical objects
are composed to create larger structures. For example, structural patterns
include a Composite pattern that allows you to represent part/whole hierarchies.
An example of a Composite implementation is a collection. For example, a
Recordset has a Fields collection, which is a grouping of Field objects.
Topic Objective
To provide a background

about the logical design.
Lead-in
In this topic, you will learn
about the transition from
conceptual design to logical
design and the use of
creational and structural
design patterns in this
process.
Module 2: Architecture and Structural Design Patterns 5


What Are Architecture Templates?
!
Microsoft Enterprise Strategy
!
Architecture Template


Based on the creational and structural pattern choices that are made in the
logical design, an architecture template can be derived. An architecture
template is a layered model of the “real world” that segregates functionality into
the various layers.
Microsoft Enterprise Strategy
The Microsoft
®
Enterprise strategy for building applications is to separate the
application into three types of services: user, business logic, and data. This
strategy, however, does not define how objects should be aggregated into these
three services.

Architecture Template
The use of an architecture template defines how to create a Microsoft
Windows
®
2000 distributed solution. It defines a map based on the desired
characteristics necessary for placing objects within layers in the solution.
There can be several different ways in which an architecture template can be
laid out, as you will see in the following sections.
Topic Objective
To provide a background
about architecture
templates.
Lead-in
In this topic, you will learn
about architecture
templates.
6 Module 2: Architecture and Structural Design Patterns


#
##
#

Design Patterns Used in Architecture
!
Creational
!
Structural



As has been noted, creational and structural design patterns can be used to
define an architectural template.
This section discusses creational and structural design patterns and their uses.
Topic Objective
To provide an overview of
the section topics and
objectives.
Lead-in
In this section, you will learn
how design patterns are
used in defining an
architecture template.
Module 2: Architecture and Structural Design Patterns 7


Creational
DataSpace
Client
Server
RDS
Custom
Object


As has been noted, creational design patterns generally define how an instance
of a class is created. “Factory” is the term used for the facility to create objects.
Abstract Factory is an interesting creational design pattern that allows a client
to choose the class to instantiate, depending on the requirements specified at
run time.
The preceding slide shows an illustration of an implementation of an Abstract

Factory—the Remote Data Service (RDS). RDS is a component that ships with
the Microsoft Data Access Components (MDAC), version 2.0 and later. RDS
allows client applications (using the RDS.DataSpace object) to instantiate
components on the server at run time.
Operating systems in general, and Windows 2000 in particular, offer
component services. The component service, which in the case of Windows
2000 is COM+, provides the capabilities associated with creational design
patterns.
Five creational design patterns have been proposed in the design pattern
literature:
!
Abstract Factory
The Abstract Factory design pattern allows the creation of related dependent
objects without the specification of their concrete classes.
!
Builder
The Builder design pattern allows the construction of a complex object from
its representation.
!
Factory Method
The Factory Method design pattern allows the creation of an object, but
allows subclasses decide which class to instantiate.
!
Prototype
The Prototype design pattern specifies the kinds of objects to create by
using a prototypical instance, and creates objects by using this prototype.
Topic Objective
To provide a background
about creational design
patterns.

Lead-in
In this topic, you will learn
about the creational design
patterns.

×