![]() | CYQ.Data componentsCYQ.Data support multi-database application [Txt,Xml,Access, MSSQL, Oracle,SQLite,MySql], help easily and quickly to develop your project |
CYQ.Data 数据框架 版本发布 V1.1
Platform for dynamic |
|
|
| #TopicOwner |
在上一篇: CYQ.Data 数据框架 版本发布 V1.0 中,我们介绍了基本的类库与使用介绍。 上篇留言中虽然感觉好像很平静,不过不难想象,大伙仅勿勿一眼一扫而过的那种情景: 一个很沉重的心结,一直在很多开发人员的心里挥之不去:实体类。 大伙似乎都很排拆没有实体类的数据层框架,仅因早于习惯了ORM? 其实,我记得我第一次毕设的时候,也是有实体类的: 还记得很久前,毕设做的是仿QQ空间的CQ-Space空间,借用了CodeSmith生成实体类[里面集合了增删改查],来操作数据库, 也感受到了实体类带来的智能提示的开发快感! 这里顺路上几张遥远的图吧,怀念一下: 1:空间主站Logo
2:空间主站集合、用户排名和天气预报
3:后台管理界面
4:用户空间主界面: 5:用户相册和相片浏览效果
6:用户日志、发布日志
7:用户音乐 8:用户聊天室
上的图有点多,怀念多了一点^-^!回到正题先: 后来,进了第一家公司,一个老程序员带着我用纯SqlHelper+存储过程+代码生成工具做项目,完全忘记实体类的存在了! 再后来,新的技术总监加入,开发博客系列时,开发了这个框架,并将这个框架应用于项目中,中间也没有实体类的存在! 也许没有先入为主的概念,所以,没有实体类,并没对我造成多大的习惯干扰,反而有点排拆实体类了; 中间呢有一同事,大概离不开实体类了,于是,在此框架的基础上,又加多一层实体类调用,然后在界面层快乐的调用着它的实体类! 而我呢,早已经习惯此框架的开发,就连后来技术总监开发新的ORM框架时,我也小小排斥了一下,毕竟先入为主的观念那时还是很强烈的。 过了些年,我也不排拆实体类了,同时也写了好几个ORM型的框架,有实体+一堆存储过程的,也有实体+反射组合的;目前在用的也是ORM型的。 一路回想回去,其实,哪种都无所谓了,简单好用才是正理! 所以,此框架在重新面世时,我重写了很多代码,为的就是简单好用,配置简单! 其实,大伙纠结的,只是因为实体类”打点“的时候,有属性的智能提示,还是为了ORM而ORM呢? 我当初纠结的就只有“实体类的打点提示”功能了; 在上一节的里,虽然经过我精心的改造,加入了枚举来实现“打点”的智能提示,不过看起来仍没那么友善,大伙还是排拆多一点啊。 于是,今天又为它“插上两双翅膀”,让它从外层使用上脱离索引型的赋值,走上光明的不归路! 结果,代码又简洁了一番,见不着索引与枚举了: 1:添加 MAction action = new MAction(TableNames.CQ_Album);//参数:枚举表名
action.GetFrom(txtUserId); action.GetFrom(txtAlbumType); action.GetFrom(txtAlbumName); action.Insert(); action.Close(); 2:更新: MAction action = new MAction(TableNames.CQ_Album); action.GetFrom(txtAlbumName); action.Update("id=1"); action.Close(); 3:读取数据: MAction action = new MAction(TableNames.CQ_Album); if (action.Fill(1)) { action.SetTo(lblAlbumName); action.SetTo(lblAlbumType); action.Close(); } 4:删除与查询,基本不涉及实体了,和上节一样,就不另贴代码了。 看到以上的操作,是否还觉得不方便呢?如果是,欢迎提供更为方便的操作方式,和大伙分享分享! 好了,本文点到为止了,欢迎下载使用:点击下载 ![]() |
Post Comment
Bulletin
Article Search
Categories
- Platform for dynamic (20)
- Feedback (9)
- Guide (33)
- Principles (19)
- Project-Case (8)
- Business & Buy (2)
- Technology exchange (45)
New Article
- CYQ.Data Components Getting Started Guide [Part 5]-[MProc Execute Stored Procedures or SQL]
- CYQ.Data Components Getting Started Guide [Part 4]-[MAction Insert Delete Update]
- CYQ.Data Components Getting Started Guide [Part 3]-[MAction Get And Set Value]
- CYQ.Data Components Getting Started Guide [Part 2]-[MAction Data Query- Fill And Select]
- CYQ.Data Components Getting Started Guide [Part 1]
New Comment
- When some one searches for his necessary thing, therefore he/she wishes to be available that in detail, so that thing is maintained over here.
- This is my first time pay a quick visit at here and i am in fact happy to read everthing at alone place.
- I truly appreciate this blog article.Really thank you! Cool.
- please pay a visit to the web sites we follow, like this one particular, as it represents our picks in the web
- Really enjoyed this post.Really thank you!
- Really enjoyed this article.Really looking forward to read more. Great.
- poker bonuses What are the norms of copyright of web content? How as it different from Patent?
- Wow! Thank you! I permanently needed to write on my blog something like that. Can I implement a fragment of your post to my site?
- This website was how do I say it? Relevant!! Finally I ave found something that helped me. Cheers!
- I was reading through some of your content on this internet site and I believe this web site is very informative ! Continue posting.