Blue Sky. Net Code Generator
Home Automation Development Products Products Process & Quality Contact Us About Us Site Map DownLoads
Automation Development Products
Blue. Net Code Generator
BlueSky Global and Localization Tool
Azure Web Component Library
Online support
Blue. Net code generator data model design guidelines
Blue. Net code generator Help
Blue. Net code generator follow-up development guidelines
BlueSky Global and Localization Tool
Buy Products
Blue. Net Code Generator
BlueSky Global and Localization Tool
Azure Web Component Library
Download trial
Blue. Net Code Generator
BlueSky Global and Localization Tool
Azure Web Component Library
Blue. Net code generator database design guidelines

Because the code generator is designed based on the database, a well-designed, full design of the database structure that generates high-quality code base. At the same time, the generator generated the code have a certain structure, the structural design of the database also have certain requirements.

1.1.1. Selection of a suitable design database
As the code generator needs from the database design from the corresponding data structure for the formation of the code, therefore, use the code generator before, be prepared to have created the database structure of the database.

   If the design is the use of rose, Visio, Power design, ERWin, and other design tools to design the database. In the design stage and not in the corresponding database creation of the corresponding data structure, then click the appropriate documents to design a database, the establishment of a database structure. This additional work will not increase, this is only part of the work ahead. Whether you use the database type used by what is still the need to support multi-database, we have recommended to SqlServer code generator for the model data sources. If you have other types of databases to create a database structure, then please use the code generator transplant database functions will migrate to sqlserver data structure database. Although this will increase the workload, but is absolutely worth it. Sqlserver because the most abundant type of data, data types and dotnet closest to the same time sqlserver naming rules for Pascal support is the best. All of these are the basis for generating high-quality code.

1.1.2. Primary key design

Table structure of the main keys is the most important attribute. We recommend for each table to set up a primary key, in fact, form a database of the main keys is the paradigm of the second request. If no primary key table, then automatically generate the code can not generate the corresponding object amend, delete operations need sequel, but also can not automatically generate UI interface code.

        We recommend using a single column to the table as a primary key. The code generator requirements as a foreign key father of the table form the main keys to a single column.

        We recommend the use of no operational significance as shown in the table primary key. Do not use a business sense are the only key to master. Although the table more than one, the database will increase the storage requirements. However, due to the use of business are not as a primary key to the future expansion of the functions, maintenance will bring obvious advantages. As the main keys to be used as often quoted out of key, if you use a business listed as the main significance of the bond, at the beginning of the design when the data appear to create a future will not be changed. In fact, is not the case. If the value of the future need to change, the code will be great trouble.

        If the database does not need more data to consider the merger, we recommend the use of growth since the series as the primary key. Since the growth shown in a performance advantage, there will not be complicated by the issue. If you need to consider more than the combined database, the type recommended identified as a primary key to the type.

1.1.3. Button design,
Foreign key entities of the link between the keys can be mapped to the relationship between the categories. And the realization of a complete category is the relationship between the important characteristics of the object-oriented. At the same time, the key is to create high-quality UI interface code base. Therefore, we recommend the establishment of the database structure, good integrity of the foreign key relationship. Although no foreign key relationship, the database can work. At the same time, the code generation does not support a foreign key out by a number of forms. Does not support one of a number of key father of the table.
1.1.4. Designs unique index
If a separate frivolous out as the main key, the general in the table there will be only some of the key out. Requests for these out to create the only key. The only value in the database access classes and UI interface code to be supported.
1.1.5. Clear definition of good listed Nullable, Comments, default value, name, data Type, and other attributes.
Nullable, in the category of valid interface code to be supported. Comment will be deemed to control the importation of the UI Caption.default Value will be the founders of the category is reflected. The name will be listed almost the same map to attribute name, the name will be table after a certain transformation mapped to the class name. All database objects best use of the name Pascal naming rules, which can improve the quality of code generated.
1.1.6. Definition of a good name out
Code generator for each database table with the type of entity to generate a displayname attributes, as an object's name.
       Code generator will choose the first non-primary key mapping out a character attribute for displayname. Therefore, this name also rules out the best table in order.

1.1.7. For statements and for the design view.
In addition to view the database table, another important target. As the database tables to the database design is based on theoretical paradigm for the design, general norms to the third paradigm. In this way, the database can not be good form for the mapping of the business class or object. Can view to solve the problem. The code generator will also view maps for business class. At the same time, some documents and statements have complex sources of data, interface developers do not necessarily clear the relationship between them. This is, we can design the system or database engineer for the first of these documents and statements to create view, UI developers can no longer to study the source of the data, do not have to write complex sentences sequel to the handling of documents in line with statements Data.
1.1.8. The code generator for the special requirements of the database structure


Father of the keys of the main keys to form a single column

At the same time there does not allow a number of foreign key relationship

Do not use the word dotnet and databases reservations for tables (including the possible transformation and retain the same character as T_Class)

If the database is not running sqlserver, then do not use the word as to retain the database listing, or generate data access code may not work properly.

Not all the tables are not the main keys

1.1.9. Static code form of treatment

Static code table is not through the code to modify the code table, code tables allow more out, the first of which rounded out the types of attributes as a code. The first character listed as a name attribute. In code generation, please fill out the appropriate form for these values, and code generator for static code tags in the table. Code generator for static code will be generated by a enum target, as well as generate a enum quoted out of the attributes to strong types of ways to facilitate the development of follow-up.

1.2.0 appropriate in the table for additional investigation and statistics for the redundancy out
With the database continuously enhance the database with the support of the increasing capacity at the same time, such as using ORM completely object-oriented mechanism, the same data can be kind of package to be guaranteed, therefore, in order to improve query speed, Reduce the database table and the difference between business objects automatically generate the code to improve the quality, can be in the database used to increase the number of redundant for the out. These columns of data consistency through in the Bll of rewriting the corresponding attribute to be guaranteed.