eIT.com.cn 2022/11/26 23:24:37 阅读 52 次
Tiny Code Generatorfrom: http://weblogs.asp.net/firoz/archive/2007/09/13/tiny-code-generator.aspx Tiny is small and handy script which can quickly generate consistent code snippet that you can paste in your project. It basically operates by reading schema of provided table and applying template to each column of table in order to generate code snippet. With Tiny, you can create complete or specific portion of busis class, busis service, or data access layer. You can also generate repetitive code snippet like storing all DataReader columns into respective property of busis object, or passing all object properties to Pmeter in data access layer, or creating stored procedures for a table or creating simple update or insert statement in stored procedure etc. Tiny is part of my daily development practice. I am using early version of Tiny for 2 years and found myself more productive with this tool. I usually keep Management Stu open (like most Microsoft application developers) all the time with a dedicated query pane for Tiny. Whenever I need to write any repetitive code based on schema of any table, I simply provide table name, tweak template per my requirement and execute the script. I then y and paste generated code in my project. Yes, I do require making mi changes sometime in generated code to make it usable in my project but still Tiny serves its purpose. Tiny is definitely not a replacement of sophisticated code generation tools like CodeSmith, TierDeveloper, LLBLGen etc. Those tools are very advance and can generate code for whole project including user interface, busis layer, data access layers and even store procedures. Tiny can only generate basic code snippet that you can use in your existing code or project. Download Link: Implementation of Tiny is very simple and straight forward. It reads schema den of all columns of provided table and template; it then render code by rotating loop for each column. Variable you have to take care in Tiny are: @TableName: table name for which you want to generate code Open Tiny in Management Stu, provide table name and template, press F5 to execute Tiny and you will have generated code in result pane. you just have to y generated code from result pane and paste in your project. To make customization of template more flexible, I have used few tags as placeholder for rendering respective entity. These tags are:
Suppose I want to generate snippet which has list of all columns of provided table. So value of Tiny variables will be:
It will generate code something like this:
Note: ft line of template is comment portion which can be used as template description, author, template version, additional comment etc. You can play with Tiny to explorer more about this tool. Ok, so here are some practical examples of templates which explain the basic usage of Tiny: 1. Listing all fields of provided table.
This template will generate list of field in septe li. 2. Creating Simple SELECT statement:
As I mentioned before, you may require mi modification sometime in generated code to use it in your project. above case, you have to manual remove last comma from SELECT. 3. Creating UPDATE statement
Again, you require removing last comma from generated code. 4. Creating Update Stored Procedure:
5. Creating simple insert statement:
6. , let’s use Tiny to generate code snippet in C# (or VB.NET) which assign entity values to respective pmeters of stored procedure.
7. And as last example, here is template to generate busis entity in C#. ** generate basic busis entity/v1.0<br> Like last example, you can even create complete busis service or data access layer using Tiny. I hope you will find this tool useful. Please post your comment and back . |
• 如何在运行 SQL Server 的计算机之间移动数据库 (2022/11/26 23:24:39)
• IDENTITY列的检查指定表的当前标识值 (2022/11/26 23:24:39)
• SQL Server 字符串函数速查 (2022/11/26 23:24:39)
• 微软发SQL Server 2008第二个CTP预览版,微软新版开发工具VS 2008 beta2功能定案 (2022/11/26 23:24:39)
• SQL Server PRB:联机丛书中的“孤立用户疑难解答”主题不完整 (2022/11/26 23:24:39)
• SQL Server Error: No Process is on the Other End of the Pipe (2022/11/26 23:24:38)
• SQL Sever 问题集锦 (2022/11/26 23:24:38)
• SQL Server 2005 的各种版本所支持的功能 (2022/11/26 23:24:38)
• SQL Server, 对于指定的缓冲区大小而言,源列的数据太大 (2022/11/26 23:24:38)
• SQL Server 清空或删除所有数据库表中的数据 (2022/11/26 23:24:37)
IMail Server | 防火墙技术专题 | Debian | TestNG | OSPF协议 | DAX函数 | Angular 4 | SAP C4C | Cisco 路由配置 | 漏洞补丁 | matlab | qTest | EasyMock | Apache Kafka | 手机QQ | Vista优化 | Oracle 体系架构 | 综合布线 | 网吧游戏服务器 | 面向对象的Python
合作媒体与友情链接 |
生活常识小贴士 | 软件开发教程 | 智慧城市生活网 | 息县通生活服务[移动版] | 息县商圈[移动版] | 美食菜谱 |
健康养生 | 法律知识 | 科技频道 | 电影影讯 | 留学考研学习 | 星座生肖|解梦说梦 |
关于我们 | 联系我们 | 合作媒体 | 使用条款 | 隐私权声明 | 版权声明 |
Copyright © 2023 eIT.com.cn. All Rights Reserved. | 豫ICP备2022012332号 |