The agileeas. NET platform provides independent configuration files, which mainly involve general configuration information, IOC object configuration information, SL service configuration information, and winservice plug-in configuration information:
The system configuration file contains the following configuration items:
<Configsections>
<Section name = "EAS. configurations" type = "EAS. configuration. confighandler, EAS. kernel"/>
<Section name = "EAS. winservices" type = "EAS. winservice. confighandler, EAS. winservice. kernel"/>
<Section name = "EAS. Objects" type = "EAS. Objects. confighandler, EAS. ioccontainer"/>
<Section name = "EAS. Services" type = "EAS. servicelocators. serviceconfighandler, EAS. servicelocator"/>
</Configsections>
EAS. configurations: general configuration information
EAS. winservices: Win services plug-in configuration information
EAS. Objects: IOC container object configuration information
EAS. Services: service discovery and locating configuration information
General configuration information
General configuration information can also be referred to as the definition of public configuration information, that is, information other than other proprietary configuration information can be written in this way, general configuration information definition using the key-Value Method For Configuration:
<EAS. Deployments>
<Configurationitem name = "dbconnectstring" value = ""/>
<Configurationitem name = "workstationuser" value = "Administrator; James"/>
<Configurationitem name = "lastuser" value = "James"/>
<Configurationitem name = "smartlogin" value = "true"/>
<Configurationitem name = "Startup" value = ""/>
<Configurationitem name = "systemstyle" value = "devstyle"/>
<Configurationitem name = "navigationstyle" value = "treestyle"/>
<Configurationitem name = "navigationexpand" value = "true"/>
<Configurationitem name = "desktop" value = "enabled"/>
<Configurationitem name = "multiinstance" value = "enabled"/>
</EAS. configurations>
The agileeas. NET platform provides the EAS. configuration. config class to read and write general configuration information:
Public static string getvalue (string key)
Public static void setvalue (string key, string value ).
Container object Configuration
The IOC container object configuration file mainly configures the object definition, survival method, lifecycle information, and the object's storage dependency. The configuration information is as follows:
<Object name = "masterdbconnection" type = "EAS. Data. Access. oledbconnection"
Assembly = "EAS. Data" lifestyletype = "pooled: initialsize = 1 | maxsize = 10">
<Property name = "connectionstring" type = "string" value = "..."/>
</Object>
<Object name = "ormaccessor" assembly = "EAS. Data"
Type = "EAS. Data. Orm. ormaccessor" lifestyletype = "Thread">
<Property name = "dbconnection" type = "object" value = "masterdbconnection"/>
</Object>
<Object name = "cacheaccessor" assembly = "EAS. Data"
Type = "EAS. Data. Orm. cacheaccessor" lifestyletype = "Singleton">
</Object>
<Object name = "masterdataaccessor" assembly = "EAS. Data"
Type = "EAS. Data. Access. oledbaccessor" lifestyletype = "Thread">
<Property name = "connection" type = "object" value = "masterdbconnection"/>
</Object>
<Object name = "mothodinvoker" assembly = "EAS. Data"
Type = "EAS. Business. localmothodinvoker. localmothodinvoker"/>
The preceding configuration file defines five objects and their lifecycles and relationships between objects. For example, the attribute dbconnection of the ormaccessor object is an instance of the masterdbconnection object.
In IOC configuration, You need to define the object type information:ProgramSet and type. You also need to define the object's life type lifestyletype. Currently, the agileeas. NET platform provides the following survival methods:
/// <Summary> /// Enumerate the survival mode of the lifestyletype component, that is, the survival cycle of the component in the container. /// </Summary> Public Enum Lifestyletype { /// <Summary> /// Transient, which is created and destroyed when used. /// </Summary> Transient = 0x00000000,/// <Summary> /// Singleton. Once a component is comfortable, it is shared among all clients. /// </Summary> Singleton = 0x00000001, /// <Summary> /// Thread. Each client thread has a separate instance. /// </Summary> Thread = 0x00000002, /// <Summary> /// Pooled, component pool. A certain number of components are allocated at the initial stage. An idle component is allocated when the customer requests the component and the component is handed over to the pool after use. /// </Summary> Pooled = 0x00000003}
Service positioning configuration information
The configuration information of service positioning and discovery mainly defines the discovery and positioning configuration of distributed technical services, as defined by the developer. net remoting technology service, how does the client dynamically activate this service, let's look at the service write bit configuration file:
<EAS. Services>
<Services>
<Service name = "EAS. dataaccessservice. Service" service-type = "dotnetremoting"
Component = "TCP: // localhost: 8000/EAS. dataaccessservice"/>
<Service name = "EAS. rmiservice. Service" service-type = "dotnetremoting"
Singleton = "true" url = "TCP: // localhost: 8000/EAS. rmiservice"/>
<Service name = "EAS. cached. Service" service-type = "dotnetremoting"
Singleton = "true" url = "TCP: // localhost: 8000/EAS. cached"/>
<Service name = "filetransservice"
Service-type = "WebService" Component = "filetransservice"/>
<Service name = "helloworldwebservice" service-type = "WebService"
Singleton = "true" url = "http: // localhost/webservicetest/Hello. asmx"/>
</Services>
</EAS. Services>
In the services configuration section, you can set the parameters according to the actual situation. the service locator on the net platform supports localcomponent, WebService, and dotnetremoting. The service component definition of localcomponent must be defined as a component implementation name in the IOC container as follows:
<Service name = "helloworld" service-type = "localcomponent" Component = "helloworld"/>
The WebService and dotnetremoting components can be customized to a component in the IOC container:
<Service name = "filetransservice" service-type = "WebService" Component = "filetransservice"/>
You can also dynamically generate a Service proxy (client) directly from the SL ):
<Service name = "EAS. cached. Service" service-type = "dotnetremoting" Singleton = "true"
Url = "TCP: // localhost: 8000/EAS. cached"/>
<Service name = "helloworldwebservice" service-type = "WebService" Singleton = "true"
Url = "http: // localhost/webservicetest/Hello. asmx"/>
Win service configuration file
Agileeas. NET provides plug-in-based win service development and provides the following configuration files:
<EAS. winservices>
<Config Port = "8000"/>
<Winservices>
<Winservice name = "EAS. cached" Key = "EAS. cached. Service"/>
<Winservice name = "EAS. rmiservice"
Key = "EAS. Distributed. remoting. rmiserviceaddin"/>
<Winservice name = "EAS. dataaccessservice"
Key = "EAS. Distributed. remoting. dataaccessserviceaddin"/>
</Winservices>
</EAS. winservices>
In the port parameter, configure the TCP port for running the server. In the winservices configuration section, define the running winservice plug-in:
<Winservice name = "EAS. cached" Key = "EAS. cached. Service"/>
Here we define a cache service. The service name configured in the configuration information is EAS. cached, which will be used at the client call time:
<Service name = "EAS. cached. Service" service-type = "dotnetremoting"
Singleton = "true" url = "TCP: // localhost: 8000/EAS. cached"/>
The value of the key property points to the component configuration in the IOC container:
<Object name = "EAS. cached. Service" assembly = "EAS. cached. serviceaddin"
Type = "EAS. cached. serviceaddin" lifestyletype = "Singleton">
<Property name = "maxmemory" type = "int" value = "512"/>
</Object>
Link
Agileeas. NET platform development guide-series Directories
Introduction to agileeas. NET application development platform-Index
Official website of agileeas. net
Agile Software Engineering Lab
QQ: 116773358