Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 42 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
42
Dung lượng
829,92 KB
Nội dung
Contents Overview 1 Introduction to ConnectedBusinessLogic 2 Technologies 5 Logical Design of ConnectedBusinessLogic 16 Physical Design of ConnectedBusinessLogic 20 Market Purchasing 25 Best Practices 28 Lab 6:BusinessLogicforConnectedComponents 29 Review 35 Module6:BusinessLogicforConnectedComponents 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 Module6:BusinessLogicforConnectedComponents iii Instructor Notes This module provides students with an introduction to business logic. Every enterprise has a set of business rules that define the way the business performs data entry and modifications. These rules are embedded into the business logic. Businesslogic can either be connected or disconnected in terms of time and space. In this module, you will be introduced to connectedbusiness logic. Disconnected businesslogic will be presented in Module 7, “Business Logicfor Disconnected Components.” After completing this module, students will be able to: ! Describe the logical design of the connectedbusinesslogic layer and how to use design patterns. ! Describe how to design and configure COM+ components in the physical design for transactions, security, activation, synchronization, and state management. ! Describe how the Market Purchasing application uses design patterns and COM+ technology in its logical and physical designs. 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_06.ppt ! Module6:BusinessLogicforConnectedComponents ! Lab 6:BusinessLogicforConnectedComponents Preparation Tasks To prepare for this module, you should: ! Read all of the materials for this module. ! Complete the lab. Presentation: 75 Minutes Lab: 60 Minutes iv Module6:BusinessLogicforConnectedComponentsModule Strategy Use the following strategy to present this module: ! Introduction to ConnectedBusinessLogic The purpose of this section is to introduce students to the businesslogic layer. Every enterprise has a set of business rules that define the way a business performs data entry and modifications. For example, an enterprise might have a business rule that would allow a manager to approve requisitions up to a predefined dollar amount. The business rules that govern data transformation—creation, retrieval, update, and delete (CRUD)—are embedded in the businesslogic layer. In general, there are two types of physical designs for a businesslogic layer, depending on whether the physical design allows the businesslogic layer components to send messages to each other directly or not: connected physical design and disconnected physical design. Connectivity between businesslogiccomponents is defined in terms of both space (spatial) and time (temporal). ! Technologies The purpose of this section is to introduce students to COM+ transaction technologies, and in particular to security, synchronization, activation, and state. ! Logical Design of ConnectedBusinessLogic The purpose of this section is to introduce students to the two important challenges in the logical design of business logic: business rules and design patterns. In the topic “Business Rules,” review the CRUD elements and emphasize that it is the only mechanism that exists for discovering business rules in a systematic fashion. ! Physical Design of ConnectedBusinessLogic The purpose of this section is to introduce students to the two important challenges in the physical design of connectedbusiness logic: packaging and deployment and managing state. ! Market Purchasing The purpose of this section is to review the logical and physical designs of Market Purchasing and to explain the justification for the choices made. The logical design of connectedbusinesslogic classes is based on the entities derived for the application. You can show how Market Purchasing is implemented by starting Component Services and presenting the Market Purchasing BusinessLogic COM+ application. ! Best Practices The main messages in the best practices for the businesslogic are that you need to have a fail-safe mechanism for discovering the business rules and that you need to package these rules into COM+ components and COM+ applications that enhance reusability. Module6:BusinessLogicforConnectedComponents v Lab Strategy ! Lab 6:BusinessLogicforConnectedComponents The purpose of Lab 6 is for students to learn to design businesslogic and apply the State behavioral design pattern. Students probably will not derive answers that correspond exactly to the Market Purchasing design. This is acceptable as long as the student answers are justified and reflect the principles discussed in the module. Discuss with students their answers to Lab 6. Module6:BusinessLogicforConnectedComponents 1 # ## # Overview ! Introduction to ConnectedBusinessLogic ! Technologies ! Logical Design of ConnectedBusinessLogic ! Physical Design of ConnectedBusinessLogic ! Market Purchasing ! Best Practices Every enterprise has a set of business rules that define the way a business performs data entry and modifications. For example, an enterprise can have a business rule that would allow a manager to approve requisitions up to a predefined dollar amount. The business rules that govern data transformation— creation, retrieval, update, and delete (CRUD)—are embedded in the businesslogic layer. In general, there are two types of physical designs for a businesslogic layer, depending on whether the physical design allows the businesslogic layer components to send messages to each other directly: connected physical design or disconnected physical design. Connectivity between businesslogiccomponents is defined in terms of both space (spatial) and time (temporal). In this module, you will be introduced to the connectedbusiness logic. The disconnected businesslogic will be presented in Module 7, “Business Logicfor Disconnected Components.” After completing this module, you will be able to: ! Describe the logical design of the connectedbusinesslogic layer and how to take advantage of design patterns. ! Describe how to design and configure COM+ components in the physical design for transactions, security, activation, synchronization, and state management. ! Describe how the Market Purchasing application uses design patterns and COM+ technology in its logical and physical designs. Topic Objective To provide an overview of the module topics and objectives. Lead-in In this module, you will learn about the businesslogic layer and how to create a logical design and a physical design for it. 2 Module6:BusinessLogicforConnectedComponents # ## # Introduction to ConnectedBusinessLogic ! The Business Problem ! Business Requirements Connectedbusinesslogic is implemented to operate in a synchronous manner. When a client request is processed, the client waits until the businesslogic completes the request. Disconnected businesslogic is implemented to operate in an asynchronous manner. A client request may be queued until a later time when it can be processed. This module deals specifically with connectedbusiness logic. In this module, you will explore how to create a logical and a physical design for the businesslogic layer. In the logical design, you will examine what businesslogic is and how to capture it in design by using design patterns. You will also learn how to evaluate the technologies that you will use while creating the logical design. In the physical design, you will examine the technology used to implement the business logic. You will also explore techniques and recommendations that will allow you to take advantage of those technologies. The technologies you will cover in this module include COM+ transactions, security, activation, synchronization, and the Shared Property Manager. In this section, you will learn about the business problem and the business requirements. Topic Objective To provide an overview of the section topics and objectives. Lead-in In this section, you will learn about what makes up a businesslogic layer, and in particular, a connectedbusinesslogic layer. Module6:BusinessLogicforConnectedComponents 3 The Business Problem Data Access Layer ConnectedBusinessLogic Layer Disconnected BusinessLogic Layer Facade Layer Web Services Facade Business Facade Transactional DAL Nontransactional DAL User Services Businesslogic (also called business rules) captures the rules, constraints, and policies of the business. Rules and constraints are best expressed as simple statements. For example, a requestor does not need manager approval for requisitions of less than $1,000. Also, a requisition can only apply to a single vendor. Policy is the order in which work must be processed, or how the work should be structured. For example, a requisition must first obtain funds approval before obtaining manager approval. Also, a requisition must consist of one or more line items each containing certain fields of information. Businesslogic is therefore all of the rules, constraints, and policies that manage a business system and keep it in working order. The problem with businesslogic is that it is strongly tied to the business itself, which is constantly changing. What would happen if requisitions could have multiple vendors? Or what would happen if the amount for which a manager must approve a requisition were increased to $2,000? You should not have to rewrite the entire application every time a business rule changes. For that reason, the businesslogic must be decoupled as much as possible from the rest of the system. As a result, facades are used in the enterprise architecture. A facade isolates the user services from changes in the business logic. In a similar fashion, the data access layer (DAL) also prevents changes in the businesslogic from propagating to the data services. The DAL also prevents changes in the data services from propagating to the business logic. This approach minimizes the amount of rework involved when businesslogic changes. The key functions of the businesslogic layer are to: ! Receive requests from the business or Web services facade layer. ! Process the requests according to the coded business logic. ! Use the DAL to fetch or send data to the data services layer. ! Pass the results of the processing back to the facade layer. Topic Objective To provide background about the business problem. Lead-in In this topic, you will learn about the business problem facing designers who have to implement a businesslogic layer. 4 Module6:BusinessLogicforConnectedComponentsBusiness Requirements ! Connected vs. Disconnected BusinessLogic ! ACID Test Businesslogiccomponents can exist in other applications. The application you are working on can interact with the businesslogic of other applications. The interaction between businesslogiccomponents of different applications can be separated in both space and time. Connected vs. Disconnected BusinessLogicConnectedbusinesscomponents interact both synchronously and spatially. Disconnected businesscomponents are those whose interactions are separated by space (running on other nodes) and time. This module will focus on the connectedbusinesslogic components. ACID Test “ACID” is an acronym that stands for atomicity, consistency, isolation, and durability. The ACID properties are considered a standard that any transactional system must meet to ensure the integrity and semantics of transactional changes to data. ! Atomicity means that all the work inside the transaction is performed as one unit. Either all of it succeeds or all of it fails. ! Consistency means that the transaction will not violate business rules or data integrity, and that the data is left in a consistent state after the transaction is complete. ! Isolation means that temporary changes made during the transaction are not visible to other clients or transactions. Isolation imposes severe restrictions on the concurrency of transactions. When a transaction begins, no other transaction can start until the current transaction finishes. ! Durability means that the changes made by the transaction persist in a manner to survive system failures. Topic Objective To provide background about the business requirements. Lead-in In this topic, you will learn about the business requirements forbusiness logic. [...]... to businesslogic and business rules 27 28 Module6:BusinessLogicforConnectedComponents Best Practices Topic Objective To provide a discussion of the best practices for the logical and physical designs of the business facade layer ! ! In this topic, you will learn the three best practices for the design of the business facade layer ACID properties are the key for the logical design of the business. .. Layer.” Module6:BusinessLogicforConnectedComponents 9 Granting Access to Facades Only the facades are allowed to access the businesslogic layer For this reason, you will need to create a role for each facade and add that role to the COM+ application For example, in the Market Purchasing application, the businesslogiccomponents reside in a COM+ application called Market Purchasing Business Logic. .. update your business rules without having to change the database You can also choose languages other than SQL for implementing business rules 18 Module6:BusinessLogicforConnectedComponents However, not all business rules must be implemented in the businesslogic layer If a business rule is strongly tied to data, it might be more efficient to implement the business rule in the database For a complete... will be able to: ! Implement logical and physical designs forbusinesslogicforconnectedcomponents ! Make decisions about how to implement components by using COM+ transactions and object pooling Prerequisites Before working on this lab, you must: ! Complete Module 6, BusinessLogicforConnected Components. ” ! Complete Lab 5, “The Facade Layer.” Note The solution for this lab is in the install... writing your businesslogiccomponents in Microsoft Visual Basic®, you should compile them as apartment-threaded components Then you should configure their classes in the COM+ application as requiring synchronization You do not need to write any special synchronization code for this purpose 12 Module6:Business Logic for Connected Components Using Visual C++ If you are writing your businesslogic components. .. design the businesslogiccomponents appropriately The following approach is recommended for identifying the transactional nature of your businesslogiccomponents and for configuring those componentsfor transactions Identify Transactional BusinessLogic The first step is to separate transactional classes from nontransactional classes Transactional classes contain businesslogic that performs work... still succeed independently of the original transaction 8 Module6:Business Logic for Connected Components Security Topic Objective To provide background about security Lead-in ! In this topic, you will learn about security in COM+ Securing the BusinessLogic $ $ The businesslogic layer should only be accessed by facades Businesslogiccomponents should trust each other ! Granting Access to Facades... Purchasing Logical Design Lead-in ! Market Purchasing Physical Design In this section, you will learn about how the logical and physical designs were applied to the Market Purchasing business facade layer In this section, you will learn how the logical and physical design guidelines were applied to the connectedbusinesslogic layer of Market Purchasing 25 26 Module6:Business Logic for Connected Components. .. configured to enforce security by enabling the Enforce access checks for this application check box in the COM+ application properties dialog box For simplicity, all businesscomponents should trust each other As long as the businesscomponents reside in the same COM+ application, calls between businesscomponents will not be checked Consequently, using just one COM+ application for the businesslogic components. .. solution is the packaging of COM+ applications and their deployment Module 6:Business Logic for Connected Components Lab 6:Business Logic for Connected Components Topic Objective To introduce the lab Lead-in In this lab, you will apply the State behavioral design pattern to the use cases involving requisitions You will then determine how the components in the physical design should be configured Explain . Best Practices 28 Lab 6: Business Logic for Connected Components 29 Review 35 Module 6: Business Logic for Connected Components Information in this document. Module 6: Business Logic for Connected Components Business Requirements ! Connected vs. Disconnected Business Logic ! ACID Test Business logic components