NBusiness on CodePlex feels like a Ruby app

NBusiness on CodePlex feels like a Ruby app

Posted by richard | August 6, 2007 | Misc, Tools

NBusiness is an Entity Definition Language focused on the creation of business entities.  Basically, you use a construct called E# to build a code file, which is then ‘compiled’ into C#.  Basically, NBusiness acts as a domain specific language for the creation of business entities. 

Below is an example of some E# code.  It’s still a bit stinted in the structure, but it ‘feels’ like English to me, much like an internal DSL in Ruby.  (Even node the TRIVIAL creation of security around roles near the bottom of the example.)

It seems people are really getting into the Domain Specific Language thing…  But not the way Microsoft seems to be going.  Microsoft seems to be focusing on the big, graphical DSL model.  It’ll be nice when they get there, but meanwhile, they’2013-08-28 13:39:53’re being left in the dust by the folks just creating very clean, very fast DSLs for a particular domain.

Nicely done, guys!

family BeerBase.Business
    entity Address as EntityBase, EntityBaseCollection, EntityInfo, Scripts
        field auto id int AddressId;
        field string Street1;
        field nullable string Street2;
        field string City;
        field string PostalCode;
        field int RegionId;
        relationship Kegbots with Kegbot on AddressId=AddressId as child;
        relationship Companies with Company on AddressId=AddressId as child;
        relationship Region with Region on RegionId=RegionId as parent;
        validate Street1 required;
        validate City required;
        validate PostalCode required;
        validate RegionId required;
        validate City minlength 2;
        validate Street1 maxlength 50;
        validate Street1 minlength 3;
        validate Street2 maxlength 50;
        validate City maxlength 50;
        validate PostalCode maxlength 16;
        validate PostalCode minlength 5;
        authorize allow * retrieve;
        authorize allow Administrators delete;
        authorize allow Administrators create;
        authorize allow Administrators update;

Related Blogs

Posted by richard | June 13, 2016
Stakeholder Traceroute
I'm always amazed at how difficult and even impossible it can be for stakeholders to get their ideas into some product backlogs. I've started asking teams to run a stakeholder...
Posted by richard | September 11, 2013
Story Mapping Software
Updated 16 Sep, 2015 to freshen up the links A few weeks ago I ran a free, half-day Agile software requirements workshop in Boise. There were over 100 attendees and...
Posted by Simon Reindl | July 3, 2012
TFS #loc.MinimumNetFXVersion and Windows 2012 0x0000005D
A tale of two error in the path to RC install. I wanted to install the RC of TFS2012 to do some upgrade proving. To  keep up to date the...