Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Custom Classes

The first step in implementing business logic in an enterprise object is assigning a custom class to an entity and generating a Java class file for that entity that will contain the custom business logic. As described in “Implementing an Enterprise Object,” by default all enterprise objects are assigned to the class com.webobjects.eocontrol.EOGenericRecord. For many enterprise objects, this is sufficient. However, if you want to implement business logic in an enterprise object, you must assign that enterprise object to a custom subclass of EOGenericRecord or EOCustomObject.

The assignment of classes to enterprise objects happens in EOModeler. You assign entities class names by selecting the root of the entity tree while in table mode and editing class names in the table.

It’s recommended that you supply fully qualified class names but this isn’t strictly required. So while you could specify Document as the class name for the Document entity, it’s best to specify a fully-qualified name such as com.mycompany.Document instead.

Once you assign a class to an entity, you need to generate a Java class file for that entity. To do this, simply select the entity in the tree view and choose Generate Java Files from the Property menu. Class file generation is discussed in more detail in “Generating Source Files.” In the save dialog that appears, choose your project directory or the directory of a business logic framework. See “Building a Reusable Framework” for more information on building a framework that you can use to share the same business logic classes among many applications.



< Previous PageNext Page > Hide TOC


Last updated: 2007-07-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice