Table of Contents Previous Section
Changing an Attribute's Characteristics
EOModeler provides three mechanisms for viewing and modifying an entity's attributes: the table mode of the Model Editor, the diagram view of the Model Editor, and the Attribute Inspector. You can use any of the mechanisms to examine the characteristics of your model's attributes and to make refinements. Each has advantages over the others and is useful in different circumstances.
- The Model Editor in table mode is most convenient for most attribute editing, because you have access to all of but a few of the possible attribute characteristics.
- Use the diagram view of the Model Editor for very limited attribute editing when you're already using the diagram view. Because you can modify only a few of an attribute's characteristics in diagram view, you have to switch to another mechanism for many tasks.
- Use the Attribute Inspector for editing attribute characteristics that you can't access in the Model Editor's table mode. Additionally, some attribute characteristics are easier to set in the inspector.
Using Table Mode
To display an entity's attributes in table mode, select the entity in the tree view.
Figure 19. Displaying an Entity's Attributes
Each table column corresponds to a single characteristic of the attribute, such as its name or its external type (that is, the type by which it's represented in the database). By default, the columns included in this view only represent a subset of the possible characteristics you can set for a given attribute. To add columns for additional characteristics, you use the Add Column menu in the lower left corner of the table.
The following table describes the characteristics you can set for an attribute. Unless otherwise specified, the instructions are for editing the characteristic in the Model Editor's table mode.
Using the Attribute Inspector
The Attribute Inspector is most useful for setting characteristics of an attribute that are related to how the attribute is represented inside your application. These characteristics are:
- Precision
- Scale
- Value Class (Java)
- Value Class (Obj-C)
- Value Type
- Width
The Attribute Inspector helps you keep track of these dependencies by changing its user interface to match whatever internal data type you choose (shown in Figure 20).
Figure 20. Setting Internal Data Type Characteristics with he Attribute Inspector
Using Custom Data Types
Some attributes, such as TalentPhoto's photo attribute, use custom value classes to represent them inside your application. When you use a custom data type, you are responsible for specifying how the data is read from and written to the database. You can use the Attribute Inspector to specify a custom data type. For a description of how to do this, see the chapter Advanced Enterprise Object Modeling in the book Enterprise Objects Framework Developer's Guide. See the class specification for EOAttribute in the Enterprise Objects Framework Reference for more discussion of custom data types. Using the Advanced Attribute Inspector
The main reason you use the Advanced Attribute Inspector is to set an attribute's Read Only characteristic. By default, and attribute is read-write. You only need to set it if you want it to be read-only. To do this, you have to use the Advanced Attribute Inspector. Open the inspector panel, and select the Advanced Attribute Inspector as shown in Figure 21.
Figure 21. Displaying the Advanced Attribute Inspector
Table of Contents Next Section