Codesmith & nettiers step by step

Source: Internet
Author: User
Codesmith & nettiers step by step

Speaker & document writing: Jacob. Huang  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Final coordination of the document: Jimmy. Ke  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Time: 2007-11-07 Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Participants: Diapers team & enterprise product team  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
I. Technical Background  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
In suryani. in China projects, genclaims, warehouse, and other projects use Microsoft Enterprise Library as the basic technical architecture, including dataaccess block, logger, exception, encryption, and cache, use mygeneration of open sourceCode Generator. The overall technical architecture follows a three-tier model, including the entity package (entity package, one-to-one ing with the database), the data package (access to database, interaction with the database), and the core package (business logic package, simple proxy, extension, and transaction implementation for data packets) and web presentation layer. Most of the code of entity, data package, and core package is automatically generated by mygeneration, and supports custom extension through partial class. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Similar Solutions to this stored procedure and data-driven architecture are: Codesmith + Nettiers combination. Codesmith, as a famous code generation tool, also provides template-based generation of C # and VB. net, tsql and other language code functions, and support ASP. net syntax custom templates; nettiers provides a mature codesmith-based template, which is encapsulated and re-organized on the basis of Microsoft Enterprise Library, it helps developers to quickly develop code that follows the three-tier architecture, so as to unify and simplify El operations on a certain basis, avoid repetitive work, and reduce the burden on developers. This article is a summary and extension of this tea session, and a brief introduction to codesmith and nettiers. He also shared his development experience at the tea conference. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
2. Environment installation and configuration  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Download the latest version of the Code Smith Installation File (Professional version, with a 30-day trial) from www.codesmithtools.com ). Code Smith has two versions: Standard and risk sion. We use the risk sion version to edit the template. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Second, from www. Nettiers Download the latest net tiers package from. com. nettiers is free of charge. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Three-code Smith step by step  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Download nettiers2.2, decompress it to the directory, right-click and select excute to open the codesmith Configuration window. \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Edit the configuration attributes in the codesmith Configuration window, such as the data source, code output directory, data source table, and view. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Click generategeneration project package and code after configuration. As shown in, generategeneration report report.html is included. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
The custom templates of codesmith support ASP. NET syntax, including introduction of namespaces and reading of attributes. You can define the namespace to be introduced in the template and the attributes that will be presented on the codesmith configuration interface, as shown in. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Four nettiers step by step  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Is a solution generated using nettiers and codesmith, including the Web View (automatically generated maintenance interface for a single table), entities entity package, services business logic package, and so on. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Using nettiers, you can also generate custom stored procedures and views. You can configure attributes such as the prefix of the generated stored procedure on the codesmith configuration page. As shown in. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
If you want to extend the code generated by the nettiers framework, you can modify the processor and add the corresponding extension code. As shown in. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
V. Comparison with existing technical architecture  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Compared with the existing custom mygeneration template, codesmith + nettiers basically follows the structure customized by nettiers. Every time you modify the database table structure, you need to regenerate the code, and copy it to the corresponding location of the solution. The same is true for custom stored procedures generated using codesmith. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
In addition, nettiers is a relatively complete framework, which generates many files and has high hardware requirements, especially for large systems. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
 \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Sat. Technical Reference  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Reference: http://www.cnblogs.com/iCaca/category/80950.html  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Net tiers Series Study Notes of bloggers \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
For more information about El, see msdn related webcast. Â \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Http://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/consyscourse/EntLib.aspx  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Codesmith: http://www.codesmithtools.com  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~
Nettiers Official Website: http://www.nettiers.com selected automatic upload  \ c-P baiyunn BBS .51aspx.com baif (@ ú ~~~

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.