ArticleDirectory
- The application model runs through the entire architecture layer.
- Model follow what
- ApplicationModel
- Command Model
The system architecture of openexpressapp.Application ModelIt is used as a metadata throughout the entire architecture, and the application model runs on the openexpressapp framework. The application model is the core of OEA. Only by understanding the application model can OEA be better used.
The application model runs through the entire architecture layer.
OEA wants to get rid of repeated technical work, abstract some common functions, organize and summarize some common models based on a large number of practices. Under the model-based description,We are more concerned with what, not how. Openexpressapp platform modeling tool Plan supports Enterprise Architecture Modeling (EA), interface modeling (UI), command extension (command), Domain Modeling (domain), Rule modeling (rule) report and workflow ).Currently, OEA's application models mainly include the UI model and command model.
Models can be defined in multiple ways, suchCode, Attribute identifier and ModelingCurrently, OEA supports class attribute identifiers to generate application models. This is generally used in simple applications.In the software, we plan to add modeling tools, so we do not need to identify the UI model in the class library.
ApplicationModel
Since we use models for development, there must be a place to store models. In OEA, both the UI model and command model are placed in the ApplicationModel static class.
Code
/// ApplicationProgramModel
Public Static Class ApplicationModel
{
/// All command objects in the Application
Public Static Readonly Commandcollection commands = New Commandcollection ();
/// Default set of all business object models Public Static Readonly Observablecollection < Businessobjectinfo > Defaultbusinessobjectinfos = New Observablecollection < Businessobjectinfo > ();
/// Search for the metadata of the Business Object Model corresponding to the specified type , If not found, a new one is generated and stored.
Public Static Businessobjectinfo addbusinessobject (type botype)
{
Businessobjectinfo info = Null ;
Businessobjectinfodict. trygetvalue (botype, Out Info );
If (Info = Null )
{
Info = New Businessobjectinfo (botype );
Businessobjectinfodict. Add (botype, Info );
If (Info. isdefaultobject)
{
Defaultbusinessobjectinfos. Add (Info );
}
}
Return Info;
}
Public Static Businessobjectinfo getbusinessobjectinfo (type botype)
{
Businessobjectinfo info = Null ;
Businessobjectinfodict. trygetvalue (botype, Out Info );
If ( Null = Info)
{
Info = Addbusinessobject (botype );
}
Return Info;
}
}
There are three important classes in the application model:
- Businessobjectinfo: Business Object Information, called through ApplicationModel. addbusinessobject
- Businessobjectpropertyinfo: Property Information, generated in the businessobjectinfo Constructor
- Businessobjectspropertyinfo: Sub-Object Property Information, generated in the businessobjectinfo Constructor
Code
Public Businessobjectinfo(TypeBotype)
{
...
Foreach (Propertyinfo item In Botype. getproperties ())
{
If (Item. hasmarked < Entitypropertyattribute > ())
{
Bopropertyinfos. Add ( New Businessobjectpropertyinfo (item, This ));
}
If (Item. hasmarked < Associationattribute > ())
{
Associationattribute ATTR = Item. getsingleattribute < Associationattribute > ();
Bospropertyinfos. Add ( New Businessobjectspropertyinfo (item, ATTR, This ));
If (ATTR. showintree)
{
Treechildpropertyinfo = Item;
}
}
}
} Ui Model
Openexpressapp-Built-in support for Attribute editing
Openexpressapp-Built-in list editing
Openexpressapp, information system development platform-understanding the core element objectview
Information System Development Platform openexpressapp-autoui Automatic Generation Interface
Command Model
Openexpressapp-command Extension Mechanism of Information System Development Platform
More information:Openexpressappframework for open source information system development platform
Welcome to reprint, reprint Please note: Reprinted from Zhou jingen [http://zhoujg.cnblogs.com/]