Module 6: Business Logic for Connected Components

42 336 0
Module 6: Business Logic for Connected Components

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Contents Overview 1 Introduction to Connected Business Logic 2 Technologies 5 Logical Design of Connected Business Logic 16 Physical Design of Connected Business Logic 20 Market Purchasing 25 Best Practices 28 Lab 6: Business Logic for Connected Components 29 Review 35 Module 6: Business Logic for Connected Components 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 6: Business Logic for Connected Components 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. Business logic can either be connected or disconnected in terms of time and space. In this module, you will be introduced to connected business logic. Disconnected business logic will be presented in Module 7, “Business Logic for Disconnected Components.” After completing this module, students will be able to: ! Describe the logical design of the connected business logic 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 ! Module 6: Business Logic for Connected Components ! Lab 6: Business Logic for Connected Components 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 Module 6: Business Logic for Connected Components Module Strategy Use the following strategy to present this module: ! Introduction to Connected Business Logic The purpose of this section is to introduce students to the business logic 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 business logic layer. In general, there are two types of physical designs for a business logic layer, depending on whether the physical design allows the business logic layer components to send messages to each other directly or not: connected physical design and disconnected physical design. Connectivity between business logic components 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 Connected Business Logic 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 Connected Business Logic The purpose of this section is to introduce students to the two important challenges in the physical design of connected business 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 connected business logic 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 Business Logic COM+ application. ! Best Practices The main messages in the best practices for the business logic 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. Module 6: Business Logic for Connected Components v Lab Strategy ! Lab 6: Business Logic for Connected Components The purpose of Lab 6 is for students to learn to design business logic 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. Module 6: Business Logic for Connected Components 1 # ## # Overview ! Introduction to Connected Business Logic ! Technologies ! Logical Design of Connected Business Logic ! Physical Design of Connected Business Logic ! 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 business logic layer. In general, there are two types of physical designs for a business logic layer, depending on whether the physical design allows the business logic layer components to send messages to each other directly: connected physical design or disconnected physical design. Connectivity between business logic components is defined in terms of both space (spatial) and time (temporal). In this module, you will be introduced to the connected business logic. The disconnected business logic will be presented in Module 7, “Business Logic for Disconnected Components.” After completing this module, you will be able to: ! Describe the logical design of the connected business logic 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 business logic layer and how to create a logical design and a physical design for it. 2 Module 6: Business Logic for Connected Components # ## # Introduction to Connected Business Logic ! The Business Problem ! Business Requirements Connected business logic is implemented to operate in a synchronous manner. When a client request is processed, the client waits until the business logic completes the request. Disconnected business logic 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 connected business logic. In this module, you will explore how to create a logical and a physical design for the business logic layer. In the logical design, you will examine what business logic 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 business logic layer, and in particular, a connected business logic layer. Module 6: Business Logic for Connected Components 3 The Business Problem Data Access Layer Connected Business Logic Layer Disconnected Business Logic Layer Facade Layer Web Services Facade Business Facade Transactional DAL Nontransactional DAL User Services Business logic (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. Business logic is therefore all of the rules, constraints, and policies that manage a business system and keep it in working order. The problem with business logic 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 business logic 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 business logic 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 business logic changes. The key functions of the business logic 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 business logic layer. 4 Module 6: Business Logic for Connected Components Business Requirements ! Connected vs. Disconnected Business Logic ! ACID Test Business logic components can exist in other applications. The application you are working on can interact with the business logic of other applications. The interaction between business logic components of different applications can be separated in both space and time. Connected vs. Disconnected Business Logic Connected business components interact both synchronously and spatially. Disconnected business components are those whose interactions are separated by space (running on other nodes) and time. This module will focus on the connected business logic 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 for business logic. [...]... to business logic and business rules 27 28 Module 6: Business Logic for Connected Components 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.” Module 6: Business Logic for Connected Components 9 Granting Access to Facades Only the facades are allowed to access the business logic 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 business logic components 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 Module 6: Business Logic for Connected Components However, not all business rules must be implemented in the business logic 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 for business logic for connected components ! 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, Business Logic for Connected Components. ” ! Complete Lab 5, “The Facade Layer.” Note The solution for this lab is in the install... writing your business logic components 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 Module 6: Business Logic for Connected Components Using Visual C++ If you are writing your business logic components. .. design the business logic components appropriately The following approach is recommended for identifying the transactional nature of your business logic components and for configuring those components for transactions Identify Transactional Business Logic The first step is to separate transactional classes from nontransactional classes Transactional classes contain business logic that performs work... still succeed independently of the original transaction 8 Module 6: 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 Business Logic $ $ The business logic layer should only be accessed by facades Business logic components 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 connected business logic layer of Market Purchasing 25 26 Module 6: 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 business components should trust each other As long as the business components reside in the same COM+ application, calls between business components will not be checked Consequently, using just one COM+ application for the business logic 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

Ngày đăng: 18/10/2013, 18:15

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan