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.

Published Friday, May 30, 2003 3:03 PM by FransBouma
Filed under:

Comments

# re: A quick update on LLBLGen Pro

Friday, May 30, 2003 5:10 AM by John
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

# re: A quick update on LLBLGen Pro

Friday, May 30, 2003 8:40 AM by Paul Gielens
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?).

# re: A quick update on LLBLGen Pro

Friday, May 30, 2003 8:56 AM by Frans Bouma
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).

# Emitter

Friday, May 30, 2003 9:03 AM by TrackBack
Emitter

# re: A quick update on LLBLGen Pro

Tuesday, June 10, 2003 9:26 AM by Darren Pruitt
So, Frans, when are you going to add the SQL CE option? That would be really sweet!

# re: A quick update on LLBLGen Pro

Tuesday, June 17, 2003 4:35 AM by Bruce Onder
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

# re: A quick update on LLBLGen Pro

Tuesday, June 17, 2003 4:39 AM by Frans Bouma
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.

# re: A quick update on LLBLGen Pro

Tuesday, June 17, 2003 11:47 AM by Bruce Onder
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

# re: A quick update on LLBLGen Pro

Tuesday, June 17, 2003 8:50 PM by Frans Bouma
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 ;))

# re: A quick update on LLBLGen Pro

Wednesday, June 18, 2003 1:44 PM by Bruce Onder
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).

# re: A quick update on LLBLGen Pro

Wednesday, June 18, 2003 1:48 PM by Bruce Onder
oops, the transaction* properties should be indented a few spaces to show they are a level inside of the Client entity.

# re: A quick update on LLBLGen Pro

Wednesday, June 18, 2003 2:39 PM by Bruce Onder
Will there be strongly typed tables in 2.0?

# re: A quick update on LLBLGen Pro

Thursday, June 19, 2003 6:53 AM by Frans Bouma
There will be strongly typed tables, so called typed lists. These can be designed in the tool (the columns and the list of entities to retrieve them from) and contain filters in code, so you can filter on the list at runtime. These are typed datatables.

I'm a strong believer of abstract modelling of datamodels, by using NIAM or ORM (see http://www.orm.net). Therefor modifying a database in LLBLGen Pro is not necessary since the database is created using an E/R model that is derived from a NIAM / ORM model created by a software architect.

LLBLGen detects automatically relations between entities (1:1, 1:n and m:n) and adds properties to retrieve related data automatically. So you can walk these relations by simply pressing the '.' :) -> CustomerEntity c = new Customer("ABC");
string ProductName = c.Orders[0].OrderDetails[1].Product.Name;

All lazy loaded. Also available in a datagrid, you can bind c.Orders to a datagrid and walk the complete model from there, in your grid :)

# re: A quick update on LLBLGen Pro

Sunday, June 22, 2003 9:38 AM by Bruce Onder
Nice! Hurry up, summer! :)

--Bruce

# re: A quick update on LLBLGen Pro

Monday, June 30, 2003 4:01 PM by nullable types
How are you handling nullable types in Pro? In 1.2 you use SQL Types.

# re: A quick update on LLBLGen Pro

Monday, June 30, 2003 10:01 PM by Frans Bouma
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 :)