Enterprise-level agile software development platform based on DOTNET component technology-agileeas. NET platform development guide-help for object designer

Source: Internet
Author: User

 

Introduction

 

Agileeas. as a fast application development platform, the net platform aims to improve the production efficiency of application software. There are many methods to improve the production efficiency of software development; it can be an effective way to use work to simplify low-and mid-level technical repetitive work in development.

On the agileeas. NET platform, we provide a set database design,CodeGenerate, DDL definition, and an integrated data Entity Designer.

In the early stages of agileeas. the Net version contains a code generator used to generate ORM code based on the current database. Later, the idea was to intervene in the database design stage of the project. Therefore, such a data object designer was designed, provides a data table definition tool to define both the database and data entity model at the database design stage (stage) of the project, the object designer generates database design documents, data definition languages, and hierarchical data access layer code.

In database-based application development projects, database design is a very important process, and writing database design files is a link. In many software companies, both use Word, WPS, and other text table tools to write database documents,ProgramThe compilation process is out of touch.

Agileeas. the object design work of the. NET platform tries to integrate in this aspect. That is, the model definition generated by the designer can generate database documents, database definition statements, and code of the development process.

Data Model

Agileeas.. NET platform defines a data object structure model definition file for the data object definition, storage, and communication in application development. The project definition established by the Data designer is finally stored in. SDM is a data model definition file with the extension.

Introduction

The model definition on the agileeas. NET platform is a navigation definition designed for objects:

The organizational structure of the object consists of two types: entity and model. The relationship between the model and the data object is stored (not supported currently). The definition of the object is stored as a data object. The object can be organized by directory, that is, if there are many objects in the project, you can create a directory and create an object in the directory for the convenience of vision and organization. Only the first-level directory is supported.

System Main Interface

The main window consists of five different work zones: System menu, toolbar, function navigation bar, business work area, and system status bar. All business functions in the system can be accessed through the system function navigation bar.

System Menu

The object designer adopts a navigation interface style. The system function consists of navigation and menu, and provides menus such as files, editing, tools, windows, and help.

Toolbar

The toolbar related to the system menu is placed on the Work bar. You can use the toolbar to quickly access relevant functional modules.

Navigation Bar

The System navigation bar lists the Data Object organizations in the project. You can add new data objects, delete existing data objects, and set project properties in the navigation bar.

The navigation bar is displayed on the left of the interface by default. If you want to increase the business workspace so that you can have a larger interface space to process business functions, you can enter the relevant business function module, hide or display the function navigation bar by using the navigation commands in the system menu or toolbar.

Work Zone

A workspace is a work area of the system. Different functional modules are loaded in the Workspace Based on the selection and operations of the navigation and menu to complete the necessary tasks.

Status Bar

The system status bar displays the current processing task and task processing status of the system, which is used to notify users so that they can know the operating status of the system in a timely manner.

About

Describes the current application. Including the product name, version, developer, and authorization information.

Data Solutions Overview

Before designing a data object, you need to plan your own project and project organization in the project, and save the defined data object project on the hard disk, so as to facilitate communication between developers and subsequent modifications.

Create a project

Open the new button in the File menu or on the toolbar. The object designer creates a Data Model Project and resets the navigation bar and tool area.

Save Project

Use the Save button in the File menu or the Save button in the toolbar. If the project file already exists in the file system, save the file directly, open the Save As dialog box to keep the file.

The File menu also provides a function to save the design model to other files.

Open a project

Use the OPEN button in the File menu or in the toolbar to bring up the file opening dialog box:

Select an existing project file in the file system and open it. The system resets the navigation bar and clears the workspace according to the model file:

Project Settings

Some project namespaces, names, titles, development languages, and databases are defined in the data model. You can modify project parameters during model design.

Right-click the solution node in the navigation bar and choose "parameter settings" to open the parameter settings module:

Solution parameter design is divided into project parameters and database connection parameters, which are project parameters and database connection settings:

Project name, Project Standard, program language, namespace, and other parameters are used to generate data access layer code, the output directory is the output root directory of generated code, documents, and SQL scripts.

Database Connection parameters are used to connect to the database server when data objects are generated from the database. Currently, SQL2000/2005/2008/Oracle databases are supported.

Data Object Definition Overview

Defining data objects is the most important task in the object designer. In the object definition information, the object attributes required by the ORM object in the program are stored in the field ing information of the database table, the definition information of the database table is also stored.

The model designed by the object designer is used to generate the project's database definition files, database DDL scripts, and program code at the data access layer.

Object Organization

The object designer provides a directory concept, that is, for solutions with many data objects, we can choose to create a directory in the solution based on the application, and the data objects are organized by directory.

Add directory

Right-click the object node in the navigation bar and choose "New directory" from the shortcut menu. The system opens the directory properties Christmas box:

Enter the Directory Name and description, and click "OK". The dialog box is closed. The newly created directory is loaded into the navigation bar. Click "cancel" to discard directory addition.

Note: The directory name cannot be empty or duplicate with the existing directory name.

Directory Properties

Right-click a directory node in the navigation bar and choose "directory properties" from the shortcut menu. The system opens the directory properties Christmas box:

In the "directory properties" dialog box, you can modify the Directory Name and description, click "OK" to complete the attribute modification, and click "cancel" to discard the directory modification.

Delete directory

Right-click a directory node in the navigation bar and select "delete directory" from the shortcut menu. The system will prompt you whether to delete the Directory and click "yes" to delete the directory.

Note: deleting a directory is to delete the directory information in the system. The data object definitions in the directory are not deleted. The data objects in the original directory are transferred to the solution entity node.

Object Management

The data objects in the designer have two existing models that are directly located in the solution. They can also be attached to the solution directory. The two different solutions can be used together, build a project based on the project scale.

Add object

Right-click the object node or directory node in the navigation bar and choose "New object" from the shortcut menu. The system workspace opens a new object definition tab page:

On the object definition tab page, you can define the database table information (data table name and field information) and ORM object (ing between attributes and data words) that the data object directs ).

Delete entity

Right-click a directory node in the navigation bar and select "delete directory" from the shortcut menu. The system will prompt you whether to delete the Directory and click "yes" to delete the directory.

Note: deleting a directory is to delete the directory information in the system. The data object definitions in the directory are not deleted. The data objects in the original directory are transferred to the solution entity node.

Define entity

In daily applications, 90% of the work of the object designer is performed on the interface. In this interface, we define data objects, indirectly completed the database design and ORM object design.

The object contains the name, data table, description, and 1-N attribute records, Object Name, and database. The description is directly entered in the text box.

The attribute set of an object is filled in by the following table. New Attributes/columns are added and written directly in the * marked row. When deleting a record, select a record, press the delete key.

In the attribute definition, the property type (program type) is associated with the data type, that is, if you select one of the two types of tasks, the other type will get a corresponding type based on the type converter, because the types in the program are relatively wide, and the type of the database is more rigorous, so we recommend that you set the data type more accurately.

The UI of the object definition module contains seven tabs. The most important is the entity definition tab page, which also includes four code tabs, a database script, and a document tab.

Four types of code

Because agileeas. the object and table are defined separately in the orm system of the net platform. Therefore, four code files are generated for each data object definition, table Interface, table implementation, object interface, and entity implementation.

In the designer environment, directly copy the code to the IDE environment, right-click the menu to select and copy all, or use Ctrl + A and CTRL + C.

DDL script

For each data object definition, the tool will generate an SQL script to define the creation and field of a data table, and write the user description information such as the table and field viewing.

Similarly, like the program code, you can select and copy all from the right-click menu, or press Ctrl + A and CTRL + C.

Document Definition

For each data object definition, the tool generates a database definition document, including the data table name, description, owner, name of each data column, data type, whether it is blank, primary key, and other information.

Solution output Overview

The object designer provides solution-based code output, document output, and DDL script output, which can be used to generate data-layer projects and solutions opened on vs2005 in one step.

Output code

Use the generate code function in the tool menu to open the code output dialog box:

In the dialog box, select the input directory. The default directory is the output directory designed in Solution Properties. Click "generate" to generate the solution. Enter the following directory structure:

Open the agilepm solution in the vs environment:

Model Modification

The code generated by the object designer adopts the technical solution of the Division class, that is, the same data object splits the four generated code files into eight code files, the generation of four code files is related to the Data Object Property definition. We recommend that you do not modify the file name. generator. CS, and all are organized in the project's generat folder. The program code has the following comments:

//------------------------------------------------------------------------------

// <Auto-generated>

// This code is generated by the smarteas. Net/agileeas. NET data model design tool.

// Runtime version: 2.0.50727.3053

//

// Changes to this file may lead to incorrect behavior, and if

// Re-generate the Code. These changes will be lost.

// </Auto-generated>

//------------------------------------------------------------------------------

The other four files are used to store user-defined data access code. The file name does not contain. generator. cs. The generated code is located in the root directory of the project.

Why do we need to set this? Thanks to long-term development practices, there are many code generation tools on the market. Although generator tools can accelerate development, the generated code will never meet the needs of complex applications, the programmer must add new functions or modifications to the generated code. When the data definition model changes, the re-generated code overwrites the modifications made by the programmer.

After the Division class scheme is used for decomposition, we separate the data model definition from the programmer's special business code. When the model changes, the re-generated Code retains the programmer's modifications and only overwrites the code files in the generat folder.

Interface-Driven Data access layer

Agileeas. NET platform has been practicing the idea of interface-driven, and it is also recommended that application development based on interface-driven, agileeas. NET platform implements a set of practical and simple Orm. The data access layer for application development is also the data access layer based on ORM technology.

During application development, we often encounter the same product needs to run on different database systems, compared with other versions that require running on sqlserver and those that require running on oraclr.

In this case, the interface-Driven Data access layer is a good choice; define a set of data access layer interface components and the data access layer implementation components of different database types, business implementation depends on the data interface layer and is decoupled from the data Implementation Layer. You only need to modify the system configuration file for different database types during runtime.

For details about the configuration of the data interface layer, see agileeas. NET platform development guide.

By default, the code generated by the object designer is an interface-driven data layer. That is, the solution contains two projects, one of which is the data access interface layer, the other is the database implementation based on the current design environment.

In the real environment, we know from the very beginning that some applications can only be applied to a single database environment. For such applications, if an interface-Driven Data access layer is used, the modification cost will be slightly higher, agileeas. NET platform also supports this non-interface-driven data layer, that is, to generate a single data layer project.

In the solution property of the object designer, there is an option "whether to generate an interface layer". This option is selected by default. If it is only based on a single database, cancel the selection, the project output scheme is changed:

DDL script

Use the generate Script Function in the tool menu to open the Script output dialog box:

In the dialog box, select the input file. The default value is sqlscript \ tablecreate under the output directory designed in Solution Properties. SQL: Click Generate to generate the DDL script. use SQL Server Management studio to open the generated script file:

Document Browsing

By clicking document browsing in the Tools menu, you can open a solution Document Browsing window in the workspace to display all data objects/data table definitions in the solution:

Developers can directly copy to word, WPS and other word processing software for editing, or directly use the output files (RTF, Excel, HTML) in the "Tools" menu to directly output the database definition documents:

Output document

Open the Document Output dialog box through "output file (RTF)", "output file (Excel)", and "output file (HTML)" in the "Tools" menu:

Click Browse... to select the output file or use the default file path, and then click Generate to output the database file:

Excel format:

HTML format:

RTF format:

Generate from database Overview

The object designer not only provides the ability to generate database table Objects Based on the native data object definition model, it also provides the ability to reverse generate data object definitions (reverse generate) from the current database objects ).

Procedure

Use the "generate from database" function in the "Tools" menu to open the database connection dialog box:

Select the source database type generated in the reverse direction, enter the server, user name, password, and other information (the database connection information of the solution by default), and click "Next" to open the database table and view selection dialog box:

Databases and views in databases are organized based on the user/Architecture and Data Tables/views. First, select the corresponding user/architecture, and then select the database tables and views to be imported, click Start to import the data object to the current model definition:

The reverse generation tool reads the metadata definition information of the database, such as the field name, data type, length, primary key, whether it is empty, and comment, and generates the corresponding data definition model, developers need to modify the attribute names of Data Objects in Case sensitivity. By default, the generated attributes are capitalized first letters, and the titles and comments of Data Objects and database table fields are supplemented.

Download the PDF version of this article: tutorial on using agileeas. NET platform object designer

QQ: 15118502

Agileeas. NET application development platform-series directory

Official website of agileeas. net

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.