A quick update on LLBLGen Pro

You might have heared about the DAL generator I released last year, LLBLGen, which as a surprise to me, became a worldwide success (over 25,000 downloads). I'm currently busy developing its big brother LLBLGen Pro, which should be released later this summer. As a quick update on what this successor is capable of, some lines of example code which uses some generated code (entities, collections) that is produced with an alpha version of LLBLGen Pro.

It loads a collection of entity objects (that's right, normal entity classes) of the type OrderDetail, from the Northwind database, which contain references to the product with ID '24', binds it using databinding to a datagrid in a form, which allows full editing of the OrderDetail objects, and after that, all changed objects are saved using an embedded transaction to the persistent storage using a single line of code. I think it's pretty neat :) Of course this is one of the many ways to retrieve / construct entity objects using the O/R mapper code generated by LLBLGen Pro. More updates later on.

OrderDetailCollection collection = new OrderDetailCollection();
ProductEntity product = new ProductEntity(24);
// ...
collection.GetMulti(null, product);
DatabindTester dbtester = new DatabindTester();
dbtester.OrderDetailEntities = collection;
dbtester.ShowDialog();

// ...
// in the dialog:
public OrderDetailCollection OrderDetailEntities
{
 get { return _orderDetailEntities; }
 set 
 { 
  _orderDetailEntities = value; 
binderGrid.DataSource = _orderDetailEntities; } }
private void saveButton_Click(object sender, System.EventArgs e) { _orderDetailEntities.SaveMulti(); }

All queries are generated dynamicly, all code is using several patterns like the DAO pattern and the strategy pattern. Everything is developed internally using interfaces.

14 Comments

  • Hi Frans,





    I used your previous version on one or two projects and really liked it. One question though....what type of price range was you thinking for your next release?





    Or is it too soon to say?





    Thanks





    John

  • Bindable entities by implenting a binding interface upon a business entity... hmm looks farmilair ;)





    Frans you thought about entity v.s. value objects? When is an object considered to have an identity and presumable be and entity? Or an object with no identy presumable a value object(depending on the object context?).

  • John: around 175 euros incl. VAT for a site license, thus unlimited number of developers can use that license in your company.





    Paul: Entities are the elements you focus on when you design an ORM/NIAM model, thus f.e. the tables in your database. The entity classes talk about the same entities as the entities found in the database, they should be the same.





    Besides these entities you have views defined over a number of attributes of a collection of entities. These are also supported (typed datatables).

  • So, Frans, when are you going to add the SQL CE option? That would be really sweet!





  • Any plans for two-way tools a la DeKlarit? If not, what is the process for updating the DAL as the database changes across releases of software?





    --Bruce

  • No, there are no plans for two way tools, since these can be pretty problematic. When the database changes, you simply refresh the catalog view, LLBLGen Pro will enlist the classes, typed lists and other elements which are changed because of the changed database and you can apply these changes then, regenerate the code, and are set.

  • Okay. I like some of the features DeKlarit has, but I agree with you that these can be problematic.





    I ran 1.2 on Northwind with no problems. I am next going to run it on the database created by my current DeKlarit project and see how the code looks there. :)





    --Bruce

  • Which features do you like of DeKlarit? Can you describe them a bit? Perhaps LLBLGen Pro already will support them :)





    LLBLGen Pro is in every word a successor of LLBLGen v1.0 so it is not a simple upgrade, it is a new tool with a broader functionality spectrum, which means that the functionality of v1.0 is extended and re-implemented and new functionality is added. The concept of what the generator will generate is moved upwards, from the DAL to the DAL + BL Facade, which is now integrated. :) (hmm, I'm starting to sound like a person from marketing ;))

  • In theory I like the fact that Deklarit lets me focus on the object model and builds the data model behind the scenes for me. In practice the tool is a bit hard to use, but this is IMO user experience.





    For example, in DeKlarit I can create the following entity:





    Client


    ClientID (PK)


    ClientName


    TransactionID


    TransactionDateTime


    TransactionAmount


    ClientBalance (sum(TransactionAmount))





    This will produce two tables for me, Client and Client1. It would produce a Transaction table only if I created a separate entity (what they call a business component, which i feel is a misnomer) called Transaction and had those same property names in it (Deklarit uses name/identity equivalance on properties).

  • oops, the transaction* properties should be indented a few spaces to show they are a level inside of the Client entity.

  • Will there be strongly typed tables in 2.0?

  • Nice! Hurry up, summer! :)





    --Bruce

  • How are you handling nullable types in Pro? In 1.2 you use SQL Types.

  • The classes are .NET classes and have .NET types for their properties. You can test when a value was NULL, but the properties exposed have .NET types. When you want to set a value to NULL, you simply specify null or nothing. When a field is nullable it will be ok, otherwise an exception is thrown. WHen you read a NULL value from the database, it gets converted to a default value, like "" for NULLs in string related types. These defaults are user definable in a special class. There is no SqlType nor equivalent used anywhere :)

Comments have been disabled for this content.