|
|
Application customization
The RISE Editor uses a set of rules, called a convention, when auto-generating application interfaces and when generating application source code. You may customize how method names et c are created based on the model's entity and view names. Unlike the database conventions, some of the application conventions are visible directly in during modeling, such as method names, whereas others, such as the return value naming, doesn't have any meaning outside of the application code generator. Names that are available during modeling may, of course, be manually edited.
In the below example we've changed the naming convention from Get, Set, New et c to a style better reflecting what database operation is actually used, i.e. Select, Update, Insert et c.
Expression logicsNames are assembled using the rules specified in application tab property grid. These rules are executed in sequences, for instance the method name is a function of the type of method to name and the rule for that particular type. The rule syntax includes a way to tie a rule to model data as well as to the output of other rules. This is done by using a marker, <name>, that is replaced with the appropriate value during execution.
The following set of variables are available to extract information from the RISE model. Model variable | Valid in | Description | <entity>* | Entity methods | The model entity name. | <view> | View methods | The model view name. | <attribute> | Arguments, Entity methods, View methods | The model attribute name. | <pknode> | Arguments, Entity methods, View methods | The model relation node name. Normally, the name of the entity being referred to. |
* Methods operating on relation tables currently use the same set of rules as methods operating entities.
The following markers are available to refer to the output of other rules. These markers selects the appropriate rule and returns its value.
Rule alias | Valid in | Description | <typedargument> | Argument | Determined by the type of argument to name. It's either equal to the "Attribute argument" property, the "Fk argument" property or the "Pk argument" property. | <typedmethod> | Method | Determined by the type of method to name. It's either equal to the "List view" property or to one of the properties under "Entity methods". |
Here's a small, but colorful, example illustrating how RISE evaluates the naming conventions.
Suppose we've modeled an entity, Banana, having an attribute, Brand, and then tell RISE to generate an interface for Banana. This will cause RISE to define the set of basic methods need to operate on Banana. For clarity, we restrict this example to a one of them "get Banana by its primary key".
The naming conventions in the snapshot above would then result in following sequences: Argument name = <typedargument> = Pk argument = PK Method name = <typedmethod> = Get entity = Select<entity>ByID = SelectBananaByID
Thus, the method a method named SelectBananaByID is created having an argument named PK. Using the RISE default convention this would have been GetBanana with argument ID. |
Argument properties
Argument name | Rule for argument naming; all types | Attribute argument | Rule for naming an argument based on an model entity or view attribute. | Fk argument | Rule for naming argument based on model relation nodes (foreign keys). | Pk argument | Rule for arguments based on an entity primary key. |
Entity methods properties
Delete entity | Rule for naming delete methods. | Download blob | Rule for naming methods for downloading BLOB attributes. | Get entity | Rule for naming get methods. | List entity | Rule for naming list methods. | List entity by FK | Rule for naming list methods based on a foreign key. | New entity | Rule for naming new methods. | Set entity | Rule for naming set methods. | Upload blob | Rule for naming methods to upload a BLOB value to an attribute. |
Method properties
Method name | Rule for naming methods regardless of type. | Return value type | Rule for naming the return value type (structure) of a method. |
View methods properties
List view | Rule for naming list methods based on views.
|
|
|
|
|
|