当前位置 > 首页 > Asp.net

Object Hydrator fills your objects with random data...on purpose!

2009-9-15 1:50:00来源:Asp.net

First off...long time since I've last written...yeah I guess frequent blogging isn't my thing.

But I wanted to post this to solicit feedback from the community about something I've been thinking about lately.

Call it DDD, BDD, TDD or a bananna there is a lot of merit in approaching a new application, from an angle other than the database and how you're going to persist the data.  If you've been building applications long enough, you know that data access (in any form) is one of the most repetitive and code heavy features of your application.  I called it a feature because it really is...and with all features, you're smart to delay the building of the feature until last responsible moment.  This allows you to garner the maximum knowledge of said feature.

What if we could build 'working' applications, that demonstrates the solution to the particular business challenge we are trying to solve...*without* a database at all.  Well at least until it makes sense to.

Rob Conery's SubSonic has a fantastic feature called the SimpleRepository.  This allows you to save any object into a database without having previously created a table and without having done the alphabetical gymnastics of mapping said object to the database.  It just saves it.  This mimic's closely the concept of the object centric database functionality of db4O etc...  I think it's brilliant but what if we could delay that decision even longer still.

What if we could design our object, and pass it through a ''generator" that returned us that object filled with data that mimicked real world data.  What if it could return a collection of these objects?  Theoretically we could be repositories that acted like databases, but since we hadn't yet commited to a database structure we have the flexibility of tweaking those objects at will.

What we end up with is an interface and business objects that behave like they should, that demonstrate the intent of the application without having to commit to a persistence strategy until nearly the end of the project.

I didn't have any luck finding this out there already...so to that end I started Object Hydrator...it's free and up on CodePlex in source form.  It will allow you to create data filled objects during runtime. I think it could have a lot promise when it comes to TDD and DDD/BDD/R2-D2.  It currently works with two methods...you can add attributes to your object's properties, or you can use a mapping collection.

So if it interests you, feel free to go check it out and look at the tests to see it in action.  It's still a veritable infant, so keep that in mind, but please let me know what you think about its usefulness and the code itself.



  • 浅谈.NET编译时注入(C#-->IL)

    2011-7-26 21:17:00

      .NET是一门多语言平台,这是我们所众所周知的,其实现原理在于因为了MSIL(微软中间语言)的一种代码指令平台。所以.NET语言的编译就分为了两部分,从语言到MSIL的编译(我喜欢

  • Office/SharePoint技术沙龙系列讲座!

    2007-1-25 13:19:00

    做个广告:重出江湖的 ZDNet中文社区 将在2月4日下午两点在北京银网中心举行Office技术沙龙系列讲座的第一讲,我和 Kaneboy 也会参加这次活动,与其他参会者分享2007 Office

  • asp.net成员管理系统membership详解教程(一)

    2011-8-5 17:00:00

    大家好! 前端时间说要录制一个membership的教程,但是不料电脑麦克风坏了(其实是在视频聊QQ的时候发现的)。那只好写一个教程了。 首先声明,该教程适合membership的初学者

  • C# 4.0 新对象ExpandoObject

    2009-10-19 17:54:00

    摘要: .net 4.0,dynamic 作者资料: Forrest Liu 我的主页 个人资料 我的闪存 与我联系 ----------------------

  • C#进行MapX二次开发之图层操作

    2009-6-27 2:08:00

    特别说明,本文整理自一篇网络的文章《MapX从数据库读取数据形成新图层(C#)》 在C#中实现MapX从数据库读取数据形成新图层分为两个问题: 1. MapX从数据库读取数据形成新图层;

  • .NET实现之(套打解决方案(支持B/S和C/S))

    2011-5-4 14:36:00

    打印想必大家都遇到过这样的问题,不想用那些太过强大的打印控件,在我开发的过程中也遇到了这样的情况我想要实现基本的纸面套打也就是将不同的纸面合同协议之类的A4纸打印上规定好的文字;上网搜了搜没有合适的

  • T4MVC 2.6.10: fluent route value API, shorter way to refer to action, and more

    2010-1-5 21:33:00

    To get the latest build of T4MVC: Go to T4MVC page on CodePlex   I just posted build 2.6.10.&#

  • Silverlight 实现 A* 寻径算法

    2009-9-18 20:25:00

    摘要: 建议在新窗口中查看:http://www.dotnet.pp.ru/silverlight/SilverlightAStar.html花了几天的时间研究A*算法,总算是搞出来了。放上来给大伙

  • The core WPF classes

    2009-11-11 23:38:00

    Jeremy Alles proposes a nice tour of the core WPF classes . It comes with a class diagram and quic

  • Why you need to learn async in .NET

    2012-4-14 5:35:00

    I had an opportunity to teach a quick class yesterday about what’s new in .NET 4.0.  One of th