What is the architecture? Architecture is innovation (3)
Author: Yangtze River Tributary
Key words: Architecture, three-layer architecture, multi-layer architecture
Date: 2007-04-12
Abstr
Use an instance Code to bring out non-compiled programs for upgrade purposes.
Body
As mentioned in the previous article, architecture is practice, which is a summary. The architecture is innovation.
Let's take a look at the Code mentioned in the previous article.
Public class entitytest: webmis. Data. entityaccess. dbentity
{
Private int _ id =-1;
Private string _ name = "test ";
Public int ID
{
Get {return _ id ;}
Set {_ id = value ;}
}
Public string name
{
Get {return _ name ;}
Set {_ name = value ;}
}
Public entitytest (): Base ("tablenameofentitytest", "ID "){}
Public override ilist getfields ()
{
Return New String [] {"ID", "name "};
}
Public override ilist getfieldvalues ()
{
Return new object [] {_ id, _ name };
}
Public override ilist getprimarykeyvalues ()
{
Return New String [] {"ID "};
}
Public override void loadfrom (system. Data. datarow entitydatarow)
{
_ Id = int. parse (entitydatarow ["ID"]. tostring ());
_ Name = entitydatarow ["name"]. tostring ();
}
}
Public class entitytestmanagement: webmis. Data. entityaccess. entityaccess
{
Public entitytestmanagement (entitytest entity): Base (entity ){}
Protected override webmis. Data. entityaccess. iexesql doreturndataaccessinstance ()
{
Return NULL; // you can complete cross-database operations by implementing iexesql and returning it
}
}
Implement the ientitymap interface in entitytest to provide required data access information for entitytestmanagement. What should I do if the database structure changes?
You must say that the data structure has changed. Add a field and recompile it.
That's good! Is there a good way to modify the data structure, so you don't have to modify the proxy here, so you don't have to re-compile it, and the program upgrade is flexible.
Also, if there are 100 tables, do you want to define the entity implementing the ientitymap interface of table 100? How can we avoid writing such entity classes?
If there are methods, constant innovation is required. The webmis B/S quick development platform adopts the XML description, which is parsed and executed by the program. Therefore, to change the structure, you only need to manually or automatically update the XML. Webmis c/s quick development platform. The document-based quick development and management system also uses configurations and then installs these configurations to the database, you only need to upgrade the configuration file to upgrade the program. For details, seeOpen-source: the enterprise management information system is completely DIY, short and fast, and the. NET source code is widely released.
XML based on webmis. Data. entityaccess. ientitymap/ientityaccess has not yet been developed. Currently, I have been busy with the Olympic project that the company has made for Netcom. After this time, I am ready to do this. If you are interested, you can join us.
Any architecture, under certain conditions, may be a good and outstanding architecture. In another condition and application, it may be a very defective architecture. Do not trust others' architecture. It has reference value, but it will never be static.
For data processing, if it is based on a transaction system, that is, data is always processed in a single or batch, the above architecture model is very convenient and practical. However, if it is based on the query system, that is, the data batch processing system, this model is not so superior in data processing. If you have the opportunity, I will discuss the architecture model of mass data processing later.
The architecture mentioned above is applied to the enterprise-level customer relationship management of a Network Communication Bureau. The development is fast and easy to maintain. In a company project, this project is at least a project in a department project that completes development tasks a long time in advance.
In short, architecture is practice, architecture is summary, architecture is innovation, and only development is suitable for your own applications, even if there is no architecture, it is also a good architecture.
Source: blog of the Yangtze River on csdn:
Http://blog.csdn.net/flygoldfish
Disclaimer: This article is copyrighted by Zhou fangyong. If you need to reprint it, please keep the complete content and source.
Related search: