|
4.2 How to Model a Dataview Dataviews are entered as stereotyped classes. You can do this by selecting a stereotyped class from the pallet by clicking on the Class Diagram Drawer in the palette to open it, finding the class creation section, clicking on the arrow on the right, which will bring up a menu allowing you to select a stereotyped class. Then pick "Create New dataview Class" when placing it on the diagram.
Alternatively you can create a standard class from the same place in the palette and add a dataview stereotype using the Add Stereotype button in the stereotype tab of the properties view. Completing the dataview is done by adding fields and relationships, linking it to the underlying entity and tailoring how the data is to be used. Connecting the dataview to an initial entity is by setting the initial entity property.
This is the default entity.
It is also possible to connect specific fields to attributes of related entities or no entity at all.
Tailoring of data can achieved in several ways. In terms of data retrieval or queries, the dataview will normally interrogate the database using an SQL statement constructed from the model. This can be modified by altering the query directly, adding where clauses and order by clauses. The fields available to query on can be limited as can those returned. The data in any field can be calculated. In terms of data storage, filters can be applied both as the data is first sent back from the screen and also prior to storing the data in the database. And if all the options to tweak the how the data is linked and used are insufficient, three hooks can be made available to application programmers which fire on data retrieval and data storage, including one that completely replaces the data retrieval mechanism. To make this available set the dataviewTriggers property to true. Only one style is available out of the box, "tab", which creates a different style of maintenance pages more suited to higher volumes of related data, are generated. To-many relationships are displayed on their own tabbed pages not cluttering up the main screen with large grids. Links:
Copyright © 2001-2006 New Technology / enterprise Ltd. | |||||||||||||||||||||