SpringBird Erp系統快速開發平台之利器-SpringBird代碼產生器

來源:互聯網
上載者:User

  SpringBird Erp系統快速開發平台基於通用的三層架構,資料訪問層採用了無Sql注入風險的IBatis.net,表現層採用了微軟最新的Asp.net mvc3 Razor模板解析引擎和輕量級的Jquery easyui,服務層採用了介面編程,整體使用成熟可靠的Ioc、Aop架構Spring.net進行服務層、資料訪問層和表現層之間的整合。討論qq:2262366309

  工欲善其事,必先利其器。而SpringBird代碼產生工具就是必不可少的利器。

  1、SpringBird代碼產生器的分層架構。Contract目錄中放服務介面,Dao目錄中放資料訪問Dao,Entity目錄中放資料實體,Impl目錄中放服務實作類別

  2、擷取資料庫伺服器使用OleDb的GetOleDbSchemaTable方法

 1 /// <summary>
2 /// 擷取架構
3 /// </summary>
4 /// <param name="connectionString">串連串</param>
5 /// <param name="type">類型</param>
6 /// <param name="restrictions">限制集合</param>
7 /// <returns>架構</returns>
8   public DataTable GetSchema(string connectionString, Guid type, object[] restrictions)
9 {
10 DataTable result = null;
11 using (OleDbConnection connection = new OleDbConnection(connectionString))
12 {
13 connection.Open();
14 result = connection.GetOleDbSchemaTable(type, restrictions);
15 }
16
17 return result;
18 }

  3、模板定義使用NVelocity模板引擎,為服務介面ITableService.cs.vm

 1 using System.Collections;
2 using System.Collections.Generic;
3 using ${solution}.Entity;
4
5 namespace ${solution}.Contract
6 {
7 /// <summary>
8 /// ${table.Description}服務
9 /// </summary>
10 public interface I${table.Alias}Service
11 {
12 /// <summary>
13 /// 擷取${table.Description}集合
14 /// </summary>
15 /// <param name="parameters">參數集合</param>
16 /// <returns>${table.Description}集合</returns>
17 IList<${table.Alias}> Get${table.Alias}s(IDictionary parameters);
18
19 /// <summary>
20 /// 移除${table.Description}
21 /// </summary>
22 /// <param name="${key.CamelAlias}">${key.Description}</param>
23 void Remove${table.Alias}(${key.Type} ${key.CamelAlias});
24
25 /// <summary>
26 /// 儲存${table.Description}
27 /// </summary>
28 /// <param name="${table.CamelAlias}">${table.Description}</param>
29 void Save${table.Alias}(${table.Alias} ${table.CamelAlias});
30 }
31 }

  4、表現層使用WinForm開發,編輯時使用了PropertyGrid,運行效果如下

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.