Bumbler: NHibernate Dynamic / Interactive Shell
After reading a bit about Jasper, I decided that I would like to see what it would take to build it with NHibernate and Boo. I am going to implement it and write the post at the same time, so you would get near real time documentation of the process.
- 18:05, decided that I want this syntax:
import Bumbler
conStr = "Data Source=localhost;Initial Catalog=Northwind;Integrated Security=True;";
bumble = Bumble.Through(conStr)
for customer in bumble.Customers:
print "Customer ${customer.ContactName}"
c
= bumble.GetCustomer("TRADH") - 19:10, finished building client interface and quick & dirty mapping from database implementation.
- 19:24, finished code generation, now working on runtime compilcation...
- 19:54: finished runtime code generation
- 20:13, can now successfully query the database using NHibernate just from connection string. Starting to work on dynamic implementation.
- 20:16, done basic dynamics, now playing with Booish.
- 20:21, the code above now works, and I am going for dinner.
- 21:10, back from dinner, final polish...
- 21:13, done!
So, about two hours of work, most of which had to do with generating the mapping from the database. I have cut some corners there, so it is SQL Server only, and it can't support a legacy app, adding support for the more complex cases is simply adding it to the mapping generation, nothing else. I made sure that adding new functionality would be easy, however.
Right now, you can get the code, just run the application, and you will get a shell that you can use to interact with the objects and the database. You need to start a new Bumble (you can simply cut/paste the code above) and then play with it. You can also reference the assembly and work with it directly using Boo.
Getting the code:
Comments
What is Bumbler? Google returns no results.
Thanks.
bumbler
Noun
(synonym) bungler, blunderer, fumbler, stumbler, sad sack, botcher, butcher, fuckup
(hypernym) incompetent, incompetent person
(derivation) botch, bumble, fumble, botch up, muff, blow, flub, screw up, ball up, spoil, muck up, bungle, fluff, bollix, bollix up, bollocks, bollocks up, bobble, mishandle, louse up, foul up, mess up, fuck up
I would be surprised if you heard about it, this post was literally when I created it.
Ok, how about a link to what Jasper is? Either way, very cool work Ayende!
Jasper is a dynamic extension to the entity framework.
For more details: http://fredrik.nsquared2.com/ViewPost.aspx?PostID=426
OK, and how long does it take to build Astoria? ;)
Not planning to.
I really don't like the idea of exposing my database to the world in such a manner. CRUD API are not the proper way of dealing with Web Services. The reason for Bumbler was simply because I read about Jasper and thought "Hey, this isn't anything I can put together in a few hours".
I guess I am not in favor of people making a big deal out of very simple things.
That said, I estimate that building that on top of Bumbler's Sceham2Mapping is a matter of a day or so.
@Ayende:
the "code" link is bad.
points to a port no. that is not available.
manually removing the port from the url got me to the right location
Cool work.
It actually is not bad, but there is a referral protection scheme in place, probably. I removed the link.
Alright dude, now you have three hours to write SilverLight...
It is going to be though to do it with NHibernate, can I get four?
Comment preview