Enterprise Objects Framework Developer's Guide

Transcription

KEnterprise ObjectsFrameworkDeveloper’s Guide

Apple, NeXT, and the publishers have tried to make the information contained inthis manual as accurate and reliable as possible, but assume no responsibility forerrors or omissions. They disclaim any warranty of any kind, whether express orimplied, as to any matter whatsoever relating to this manual, including withoutlimitation the merchantability or fitness for any particular purpose. In no event shallthey be liable for any indirect, special, incidental, or consequential damages arisingout of purchase or use of this manual or the information contained herein. NeXT orApple will from time to time revise the software described in this manual andreserves the right to make such changes without obligation to notify the purchaser.Copyright 1998 by Apple Computer, Inc., 1 Infinite Loop, Cupertino, CA 95014.All rights reserved.No part of this publication may be reproduced, stored in a retrieval system, ortransmitted, in any form or by any means, electronic, mechanical, photocopying,recording, or otherwise, without the prior written permission of the publisher orcopyright owner. Printed in the United States of America. Published simultaneouslyin Canada.NeXT, the NeXT logo, OPENSTEP, Enterprise Objects, Enterprise ObjectsFramework, Objective-C, WEBSCRIPT, and WEBOBJECTS are trademarks ofNeXT Software, Inc. Apple is a trademark of Apple Computer, Inc., registered in theUnited States and other countries. PostScript is a registered trademark of AdobeSystems, Incorporated. Windows NT is a trademark of Microsoft Corporation. UNIXis a registered trademark in the United States and other countries, licensedexclusively through X/Open Company Limited. ORACLE is a registered trademarkof Oracle Corporation, Inc. SYBASE is a registered trademark of Sybase, Inc. Allother trademarks mentioned belong to their respective owners.Restricted Rights Legend: Use, duplication, or disclosure by the Government issubject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights inTechnical Data and Computer Software clause at DFARS 252.227-7013 [or, ifapplicable, similar clauses at FAR 52.227-19 or NASA FAR Supp. 52.227-86].This manual describes EOF 3.0.Writing: Kelly ToshachWith help from: Bruce Arthur, Nancy Craighill, Craig Federighi, Patrick Gates,Stan Jirman, Kenny Leung, Mai Nguyen, Eric Noyau, Steve Miner, and Greg WilsonDesign and Illustration: Karin StroudProduction: Gerri Gray

Contents

Table of ContentsIntroduction 11About This Book 14Part IEnterprise Objects Frameworks EssentialsWhat Is Enterprise Objects Framework? 19The Enterprise Objects Framework Difference 21Where Does Business Logic Go? 22What Doesn’t Go in an Enterprise Object 23From Database to Objects 25Uniquing 27Resolution of Relationships and Faulting 29From Objects to Interface 31From Objects to Database 31Validation 31Referential Integrity Enforcement 32Automatic Primary and Foreign Key Generation 32Transaction Management 33Locking 33Ingredients of an Enterprise Objects Framework Application 34Enterprise Objects Framework Layers 36A Command-Line Program 37An Application Kit Client/Server Application 37An HTML WebObjects Application 39Enterprise Objects 42Enterprise Objects Framework Viewed Through Its Classes 43Classes in a Command-Line Program 45The Access Layer 46The Control Layer 51Classes in an Application Kit Client/Server Application 52User Interface Objects 53The Interface Layer 54Access and Control Layers 54Classes in an HTML WebObjects Application 555

Classes in a Web Application with a Java Client 57The Distribution Layer 59Client-Side APIs 59Framework Dependencies 60Part IIEnterprise Object DesignDesigning Enterprise Objects 65Designing Your Schema 67Defining the Model 68EOGenericRecord or Custom Class? 68Which Attributes Should Be Class Properties? 69What Data Types Should Your Properties Be? 70How Should Your Enterprise Object Manage Relationships with Other Objects? 72What about Inheritance? 75Implementing an Enterprise Object 75Generating Source Files 76Superclass 77Instance Variables 77Writing Accessor Methods 78Writing Derived Methods 86Performing Validation 87Creating and Inserting Objects 93Setting Defaults for New Enterprise Objects 98Writing Business Logic 100Gotchas 101Constructor for Creating Enterprise Objects 101Numeric Values and NULL 102Cautions in Implementing Accessor Methods 102Don’t Override equals 103Advanced Enterprise Object Modeling 105Modeling Complex Attributes 107RTF Text 108Images 110Custom Data Types 111Modeling Relationships 114Modeling Optional To-One Relationships 114Modeling Many-To-Many Relationships 1226

Modeling Inheritance 124Types of Inheritance 125Vertical Mapping 127Horizontal Mapping 129Single Table Mapping 131Data Access Patterns for Inheritance 133Fetching and Inheritance 133Delegation Hooks for Optimizing Inheritance 134Java Limitation With Ambiguous To-One Relationships 135Designing Database-Savvy Enterprise Objects 135Part IIIApplication DesignApplication Configurations 141Graphical User Interface Applications 143Loading a User Interface 145Unarchiving an Editing Context 147Unarchiving a Database Data Source 147Sharing Editing Contexts and Coordinators 150Database Context Rendezvousing 151Setting Up Channels 152Non-Graphical User Interface Applications 153Creating an Editing Context 154Inside EOObjectStoreCoordinator 156Inside EODatabaseContext 157Substituting a Custom EOCooperatingObjectStore 158Editing Context Configurations 159Using One Editing Context for Multiple Nibs 160Using Nested Editing Contexts 161Object Store Coordinator Configurations 165Setting Up Multiple Coordinators Programmatically 167Setting Up Multiple Coordinators Using Nibs 167Accessing Multiple Databases 168Getting By Without Two-Phase Commit 169Preventing Database Context Rendezvousing 1697

Connecting to a Database 173When Database Connections Are Opened and Closed 175Logging into a Database 176Storing the Connection Information in a Model File 177Running the Adaptor’s Login Panel 177Setting the Connection Dictionary Programmatically 179Limiting the Number of Database Connections 180Closing Database Connections 182Using Multiple EODatabaseChannels 184Character Encodings 185Choosing an Encoding 185Setting an Adaptor’s Character Encoding 186Setting the Database Character Encoding 186Behind the Scenes 187Fetching Objects 189EODisplayGroup Receives a fetch Message 191Inside EODatabaseContext 192Inside EODatabaseChannel 195Flow of Data During a Fetch 198Uniquing, Snapshots, and Faults 201How Changes are Distributed and Applied 207How an EOEditingContext Manages Changes to Its Objects 210Saving Changes 212Locking and Update Strategies 217Transactions 219Transactions and Optimistic Locking 219Transactions and Pessimistic Locking 220Transactions and On-Demand Locking 220Answers to Common Design Questions 221How Can I Improve Performance? 223Controlling the Number of Objects Fetched 224Faulting 224Caching an Entity’s Objects 226Creating an EOModel for Optimal Performance 227Updating the User Interface Display 2288

How Do I Generate Primary Keys? 229Defining a Primary Key 230Generating Primary Key Values 231Why Can’t I Use Identity Columns? 236Why is EOF Generating Primary Key Values for Number Objects Set to Zero? 237Summary 238How Do I Use My Database Server’s Integrity-Checking Features? 238Defaults 239Rules That Validate Values 240Constraints for Enforcing Relational Integrity Rules 241How Do I Invoke a Stored Procedure? 242Invoking a Stored Procedure Automatically 242Invoking a Stored Procedure Explicitly 245How Do I Order Database Operations? 248How Are Enterprise Objects Cleaned Up? 250Who Owns an Enterprise Object? 251How Does an Enterprise Object Get Deallocated? 251How Are an Object’s Snapshots Deallocated? 252What Happens If You Have Retain Cycles? 253Should I Make Foreign Key Attributes Class Properties? 254How Do I Share Models Across Applications? 255Entity-Relationship Modeling 257Modeling Objects 259Entities and Attributes 260Names and the Data Dictionary 262Attribute Data 262The Primary Key 264Relationships 265Relationship Directionality 266Naming Relationships 266Relationship Keys 267Relationship Cardinality 271Bidirectional Relationships 272Reflexive Relationships 276Flattened Attributes 277Index 2819

Introduction

Enterprise Objects Framework brings the benefits of object-orientedprogramming to database application development. You can use theFramework to build feature-rich, database applications with reusablesoftware components that tightly couple business information with thebusiness processes managing that information.One of the most significant problems developers face when usingobject-oriented programming languages with SQL databases is thedifficulty of matching static, two-dimensional data structures withthe extensive flexibility afforded by objects. The features ofobject-oriented programming—such as encapsulation andpolymorphism—and their benefits—like fewer lines of code andgreater code reusability—are often negated by the programmingrestrictions that come with accessing SQL databases within anobject-oriented application.Enterprise Objects Framework solves this problem by providingtools for defining an object model and mapping it to a data model.This allows you to create objects that encapsulate both data and themethods for operating on that data, while taking advantage of the dataaccess services provided by the Framework that make it possible forthese objects to persist in a relational database.The flexible, three-tier architecture provided by the Frameworkallows you to build robust, scalable, client/server applications. Objectsat each of the three tiers (user interface, enterprise objects, and datastore) can be deployed to take advantage of network resources.For example, data might be stored in a relational database runningon a fault-tolerant database server with gigabytes of disk storage, whileenterprise objects run on high-end compute servers. Partitioning theapplication to make best use of available resources allows complexapplications to achieve maximum performance.The components of Enterprise Objects Framework fully embrace thethree-tier architecture, which means that portions of the Frameworkcan be used selectively to meet specific application requirements.For example, the components that provide users with the abilityto interactively manipulate enterprise objects can be used by anon-database application to handle user interface refresh and undo.You can use a custom data store (such as a flat-file system) in placeof a relational database to store data for enterprise objects. Or you can13

Introductionmake use of the database adaptors separate from the rest of theFramework components to provide direct access to relational databasesfor your applications.Enterprise Objects Framework offers these additional benefits: Flexibility. An enterprise object isn’t constrained by the physicallocation of data. Its mapping can extend across tables, and itsdata isn’t confined to the object’s mapping to a physical database.Further, the mapping of an enterprise object to the database can bedynamically controlled at run time. Modularity. Depending on the needs of your application, you cancreate simple applications that require little or no code, programselected components while accepting the default behavior of othercomponents, or use selected components independent of the restof the Framework. Extensibility. Enterprise Objects Framework’s classes are public andextensible. For example, you can provide your own data source, oradd support for a new user interface object.About This BookThis book describes concepts that you’ll need to know when writing aEnterprise Objects Framework application. To help you find what youare looking for, this book is organized into three parts: 14Part 1, “Enterprise Objects Frameworks Essentials” on page 17,provides an overview of how Enterprise Objects Framework worksand the different types of applications you can build with it.The first chapter, “What Is Enterprise Objects Framework?” onpage 19, describes what Enterprise Objects Framework is, howit’s different from other products, and what features it offers.The second chapter, “Enterprise Objects Framework ViewedThrough Its Classes” on page 43, provides a description of theclasses used in Enterprise Objects Framework applications andhow they fit into different types of applications.

About This Book Part 2, “Enterprise Object Design” on page 63, describes howto implement business logic for your application. With EnterpriseObjects Framework, you put business logic in business objects,called enterprise objects. The two chapters in Part 2, “DesigningEnterprise Objects” on page 65 and “Advanced Enterprise ObjectModeling” on page 105, describe the tasks you perform in definingthe enterprise objects for your application. Part 3, “Application Design” on page 139, describes how toimplement application-level logic for your application. EnterpriseObjects Framework provides a basic structure for all applicationsthat use it. The chapters in this section— “ApplicationConfigurations” on page 141, “Connecting to a Database” onpage 173, “Behind the Scenes” on page 187, and “Answers toCommon Design Questions” on page 221—describe that structure,how it’s established at runtime, and how to intervene in its defaultbehaviors.There are no prerequisites for learning Enterprise Objects Framework;however, it does help if you understand something about relationaldatabases and Entity-Relationship modeling. If you aren’t familiar withthese topics, read the Appendix, “Entity-Relationship Modeling” onpage 257. While Enterprise Objects Framework largely encapsulatesthe programmer from having to know about relational databases, youstill need to understand Entity-Relationship Modeling to mapyour enterprise objects into a relational database for storage.Entity-Relationship Modeling terminology is used by the EnterpriseObjects Framework classes and documentation to describe this mapping.15

Part IEnterprise ObjectsFrameworks Essentials

Chapter 1What Is Enterprise ObjectsFramework?

Enterprise Objects Framework is a set of tools and resources thathelp you create applications that work with the most popular relationaldatabases—or with your own custom data store. These tools don’t helpyou build a complete database system from the ground up—the tasksof data storage and retrieval are left to a database server supplied bya third party. Rather, Enterprise Objects Framework lets you designobject-oriented database applications that are easy to build and maintainand that draw upon standard user interface features.This chapter describes how Enterprise Objects Framework is differentfrom other database access products, the features it offers, and how youcan use it. The chapter is divided into the following sections: “The Enterprise Objects Framework Difference” on page 21 “From Database to Objects” on page 25 “From Objects to Interface” on page 31 “From Objects to Database” on page 31 “Ingredients of an Enterprise Objects Framework Application”on page 34 “Enterprise Objects Framework Layers” on page 36 “Enterprise Objects” on page 42The Enterprise Objects Framework DifferenceToday’s business applications must embody complex rules of thebusiness, access heterogeneous corporate data in database systemsfrom multiple vendors, and offer different front ends to meet the needsof users in all different parts of the business. This is a tall order to fill,but Enterprise Objects Framework meets all these needs. It providesdatabase independence, transparently maps custom business objectsto database tables, and binds business objects to user interfaces.21

Chapter 1What Is Enterprise Objects Framework?Where Does Business Logic Go?The biggest difference between Enterprise Objects Framework andother solutions is where you put business logic. One approach is toimplement business rules in the user interface, as you do with 4GL tools.Problems with this approach include: It offers limited reuse. You have to code your business logic intoeach application that accesses your database. In fact, within anapplication, you have to code your business logic into each screen.Consequently, you wind up duplicating your code. It’s not maintainable. Since you have to duplicate your businesslogic, even small modifications to your rules are difficult toimplement. Finding and fixing every affected screen in everyaffected application is slow and error prone. Modifications to yourdatabase schema are equally problematic. Different user interfaces require different implementations. For example,if you have a client/server application that you want to put on theweb, you have to rewrite the application and maintain bothversions. It provides poor data integrity. You have to rely on all applicationdevelopers to implement the business rules correctly. If any screenof any application has an error, the data in your database can becorrupted, impacting all applications. It doesn’t scale well. To improve your application’s performance, youhave to provide your users with faster systems. Contrast this with asolution in which you can move some computation-intensiveprocessing to fast server machines.Another approach is to implement your business rules in the database—with stored procedures, rules, constraints, and triggers, for example.This approach also has problems: 22It offers limited interactivity. To provide immediate feedback to auser, you have to make a round trip to the database every time theuser performs an action, which can be very slow and inefficient.On the other hand, you can batch up changes, but then the userdoesn’t receive immediate feedback.

The Enterprise Objects Framework Difference No back-end portability. Database vendors all have different ways toimplement logic. If you have to support more than one database,you’ll have to implement the logic multiple times, resulting inmore maintenance problems. SQL is a poor development language.A third approach—the one that Enterprise Objects Framework takes—isto put business rules in business objects, called enterprise objects. Byapplying good object-oriented design principles, this approach providesthe advantages of encapsulation, reuse, and a more natural model of thereal world. For example, suppose you’re writing an application formanaging a video rental store. The business logic for such an applicationmight include the rules: A late fee is generated automatically when a rental becomesoverdue.A customer can’t rent more videos if they have any overdue rentals.The total replacement value of a customer’s rentals can’t exceedthe amount of the customer’s deposit.With Enterprise Objects Framework, you would implement these rulesin enterprise objects such as Customer, VideoTape, Rental, and Fee.What Doesn’t Go in an Enterprise ObjectDeciding what code to leave out of your business objects is just asimportant as deciding what code you leave in. To maximize thereusability and extensibility of your objects, they shouldn’t embedknowledge of the user interface or database alongside the business logic.For example, if you embed knowledge of your user interface, you can’treuse the objects because each application’s user interface is different;and if you embed knowledge of your database, you have to update yourobjects every time you modify the database.If not in the business objects, then where does this knowledge go?It’s handled by Enterprise Objects Framework as shown in Figure 1.23

Chapter 1What Is Enterprise Objects Framework?RelationalDatabaseFigure 1. The Enterprise Objects Framework ApproachThe Framework provides a database-to-objects mapping so yourobjects are encapsulated from the database, and it provides anobjects-to-interface mapping so they are encapsulated from the userinterface. This approach enables you to create libraries of enterpriseobjects that can be used in as many applications as you need, with anyuser interface, and with any database server. You’re able to concentrateon coding the logic of your business while the Framework takes careof the rest.24

From Database to ObjectsFrom Database to ObjectsEnterprise Objects Framework’s database-to-objects mapping sets up acorrespondence between database tables and enterprise objects classes sothat database rows map to instances of the appropriate class as shown inFigure 2.lastName "Federighi"firstName "Craig"TalentTALENTEFIRST NAMTALENT IDLAST NAME1028FederighiC r a igFeldmanCorey1132Figure 2. Mapping Between an Enterprise Object Class and a Single TableThe mapping is flexible. For example: You can map an enterprise object to a single table, a subset of atable, or to more than one table. For instance, a Person object canget its first and last names from a PERSON table but get its streetaddress, city, state and zip code from an ADDRESS table. Generally an enterprise object instance variable maps to a singlecolumn, but the column-to-instance variable correspondence issimilarly flexible. You can map an instance variable to a derivedcolumn, such as “price * discount” or “salary * 12”. You can map an enterprise object inheritance hierarchy to one ormore database tables.25

Chapter 1What Is Enterprise Objects Framework?In addition to mapping tables to enterprise object classes and databasecolumns to instance variables, the Framework maps database primary andforeign keys to relationships between objects. The Framework definestwo types of relationships—to-ones and to-manys—which are bothillustrated in Figure 3. The relationship a MovieRole has to its Movie is ato-one relationship, while the relationship a Movie has to its MovieRolesis a ENMovieRoleMO V I EM O VIE R O L ET ID1 0281132M O V IE R O LEM O V I E IDR iple y501A sh5 01Figure 3. Mapping Relationships26MovieRoleMOVIE ID501703TITLEAlienrToy Stoy

From Database to ObjectsFor more information on database-to-objects mappings, see the chapter“Designing Enterprise Objects” on page 65, and to learn how to definethis mapping with the EOModeler application, see the book EnterpriseObjects Framework Tools and Techniques.UniquingIn marrying relational databases to object-oriented programming, one ofthe key requirements is that a row in the database be associated with onlyone enterprise object in a given context in your application. EnterpriseObjects Framework maintains the mapping of each enterprise object toits corresponding database row, and uses this information to ensure thatyour object graph does not have two (possibly inconsistent) objects forthe same database row. Uniquing of enterprise objects, as this process iscalled, limits memory usage and allows you to know with confidence thatthe object you’re interacting with represents the true state of itsassociated row as it was last fetched into the object graph.Without uniquing, you’d get a new enterprise object every time you fetchits corresponding row, whether explicitly or through resolution ofrelationships. This is illustrated in Figure 4.27

Chapter 1What Is Enterprise Objects Framework?Without UniquingKaimanagerKaiKaimanagerJohnCaryUsing uniquing results in onlyone object ever being created forKai. In this case, even thoughKai’s row can be changed, yourapplication has a single view ofKai’s data. The data may not reflectwhat’s in the database if anotheruser changes it, but there’s noambiguity within your application.With UniquingKaiCaryJohnmanagerFigure 4. Uniquing of Enterprise Objects28This shows the enterprise objectsthat would exist after fetchingthree employee objects withoutuniquing. Kai is Cary’s and John’smanager. On fetching an objectfor Cary, an object representingKai is created to resolve themanager relationship. If you thenfetch an object for Kai, a separateobject is created. Fetching anobject for John then causes yetanother object representing Kaito be created. Kai’s row in thedatabase can be altered betweenany of these individual fetches,resulting in objects representingthe same row, but with different data.

From Database to ObjectsResolution of Relationships and FaultingWhen the Framework fetches an object, it creates objects representingthe destinations of the fetched object’s relationships. For example, if youfetch an employee object, you can ask for its manager and immediatelyreceive an object; you don’t have to get the manager’s employee ID fromthe object you just fetched and fetch the manager yourself.The Framework doesn’t immediately fetch data for the destinationobjects of relationships, however. Fetching is fairly expensive, andfurther, if the Framework fetched objects related to the one explicitlyasked for, it would also have to fetch the objects related to those, and soon, until all of the interrelated rows in the database had been retrieved.To avoid this waste of time and resources, the destination objects createdare stand-ins, called faults, that fetch their data the first time they’reaccessed. Figure 5 illustrates this process.The framework allows you to tune relationship resolution by prefetchingrelationships and batch faulting. For more information on these features,see the chapter “Answers to Common Design Questions” on page 221.For more information on the general faulting mechanism, see the chapter“Behind the Scenes” on page 187.29

Chapter 1What Is Enterprise Objects Framework?ployeeEmmanagerLast NameM acAsk illV e a seyFirst Name astNameLast NameM acAsk illV e a seyFirst Name ProjIDJane507Kai512lastM acAsk illProjDateVeaseyV e a seyFirst Name ProjIDJane507Kai512Figure 5. Resolution of a Fault30The fault receives a messageit can’t cover for (lastName).2Nov-19-199Apr-05-1988meNaLast NameThe Employee Object“Jane MacAskill” is fetched fromthe database. Instead of fetchingthe data for Jane’s manager(Kai Veasey) right away, theFramework creates a faultcontaining the value of theforeign key for Jane’s managerrelationship. The graphic forthe fault has an empty centerwith a key in it, indicating that itcontains no real values yet.The bottom half of the objectshows the messages the faultcan respond to without firsthaving to fetch its data.The fault fetches its data fromthe database and invokesits lastName method.The string “Veasey” is returned.ProjDate2Nov-19-1998Apr-05-198

From Objects to InterfaceFrom Objects to InterfaceThe objects-to-interface mapping takes care of automaticallysynchronizing the user interface with your enterprise objects. If auser changes a value in the user interface, the Framework updatesthe corresponding enterprise objects. Similarly, if an enterprise objectis changed programmatically, the Framework automatically updates theuser interface.From Objects to DatabaseAfter your program has accumulated changes to enterprise objects, itneeds to push those changes back to the database. Enterprise ObjectsFramework manages this process, too, analyzing the objects for changes,generating corresponding database operations, and executing thoseoperations to synchronize the database with in-memory enterpriseobjects. The Framework has mechanisms for ensuring that the integrityof your data is maintained between your application and the database: ValidationReferential integrity enforcementAutomatic primary and foreign key generationTransaction managementLockingEach of these is described in the following sections.ValidationA good part of your application’s business logic is usually validation—forexample, verifying that customers don’t exceed their credit limits, thatreturn dates don’t come before their corresponding check out dates, andso on. In your enterprise object classes, you implement methods thatcheck for invalid data, and the framework automatically invokes thembefore saving anything to the database.31

Chapter 1What Is Enterprise Objects Framework?Referential Integrity EnforcementEnterprise Objects Framework allows you to specify rules governingthe relationships between objects. You can specify whether a to-onerelationship is optional or mandatory. For example, you can require thatall departments have a location (mandatory), but not require that everyemployee have a manager (optional).You can also specify delete rules for relationships. For example, when youdelete a department object, you can specify that: All the employees in that department are also deleted (a cascadingdelete).All the employees in that department are updated to have nodepartment (nullify).The department deletion is rejected if it has any employees (deny).For more information on Framework’s referential integrity enforcement,see the chapter “Designing Enterprise Objects” on page 65. To learnhow to define these rules in the EOModeler application, see the bookEnterprise Objects Framework Tools and Techniques.Automatic Primary and Foreign Key GenerationWith Enterprise Objects Framework, you don’t have to maintaindatabase artifacts such as database primary and foreign key valuesinto your application. Database primary and foreign keys aren’t usuallymeaningful parts of a business model; rather, they’re attributes createdin a relational database to express relationships between entities.For example, the primary key (MOVIE ID) for a movie doesn’thave any meaning to users. Users identify movies by their titles.Enterprise Objects Framework keeps track of primary and foreignkey data for you. You don’t have to represent that information in yourenterprise objects, and you don’t have to worry about generating andpropagating key values.For information on eliminating database artifacts from your objectmodel, see the chapter “Designing Enterprise Objects” on page 65.For information on how the Framework generates primary key values,see the chapter “Answers to Common Design Questions” on page 221.32

From Objects to DatabaseTransaction ManagementFor the most part, Enterprise Objects F

Objects Framework, you put business logic in business objects, called enterprise objects. The two chapters in Part 2, "Designing Enterprise Objects" on page 65 and "Advanced Enterprise Object Modeling" on page 105, describe the tasks you perform in defining the enterprise objects for your application.