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:

svn co https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk/SampleApplications/Bumbler

Print | posted on Friday, May 04, 2007 9:50 PM

Feedback


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/4/2007 11:36 PM Rodney

What is Bumbler? Google returns no results.

Thanks.


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/4/2007 11:38 PM Ayende Rahien

bumbler
--------------------------------------------------------------------------------
Noun
1. someone who makes mistakes because of incompetence
(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


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/4/2007 11:38 PM Ayende Rahien

I would be surprised if you heard about it, this post was literally when I created it.


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/4/2007 11:42 PM Shawn Wheatley

Ok, how about a link to what Jasper is? Either way, very cool work Ayende!


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/4/2007 11:53 PM Ayende Rahien

Jasper is a dynamic extension to the entity framework.
For more details: http://fredrik.nsquared2.com/ViewPost.aspx?PostID=426


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/5/2007 12:05 AM Andres Aguiar

OK, and how long does it take to build Astoria? ;)


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/5/2007 12:29 AM Ayende Rahien

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.


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/5/2007 12:30 AM Ayende Rahien

That said, I estimate that building that on top of Bumbler's Sceham2Mapping is a matter of a day or so.


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/5/2007 2:03 PM Ken Egozi

@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.


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/5/2007 2:48 PM Ayende Rahien

It actually is not bad, but there is a referral protection scheme in place, probably. I removed the link.


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/9/2007 9:14 PM neuruss

Alright dude, now you have three hours to write SilverLight...


Gravatar

# re: Bumbler: NHibernate Dynamic / Interactive Shell 5/9/2007 9:19 PM Ayende Rahien

It is going to be though to do it with NHibernate, can I get four?

Comments have been closed on this topic.