RSS 2.0
 Monday, August 06, 2007
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'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;
    }
}

Monday, August 06, 2007 9:23:36 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [1] -
Misc | Software Tools
Monday, September 17, 2007 9:05:06 AM (Pacific Daylight Time, UTC-07:00)
Thanks for the words! I think we're on the same page when it comes to the big graphical DSL model. We've got some interesting things slated for the next version too, namely Entity inheritance (e.g. Customer : Person, Employee : Person), dynamic querys, entity reflection, E# generation and hopefully VS 2008 support. Should be fun!
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Navigation
Archive
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2009
Accentient, Inc.
Sign In
Statistics
Total Posts: 351
This Year: 0
This Month: 0
This Week: 0
Comments: 359
Themes
Pick a theme:
All Content © 2009, Accentient, Inc.
DasBlog theme 'Business' created by Christoph De Baene (delarou)