LLBLGen Pro- Data-access tier GENERATOR
LLBLGen Pro is a data-access tier generator for .NET, which generates a complete data-access tier and business support tier for you (in C# or VB.NET), using an existing database schema set. The generated .NET code is compiler-ready and can, being compiled by the .NET C# or VB.NET compiler, and can be used immediately by other applications.
LLBLGen Pro fully supports existing stored procedures by creating wrapper code, that lets you call a stored procedure with one line of code.
LLBLGen Pro saves developers a lot of time, up to over 50% of a total project's development time, and lets them focus on the real deal: business logic code
You design your database schema's with the abstract modelling tools you always use and LLBLGen Pro takes care of the rest.
LLBLGen Pro supports two paradigms: SelfServicing (persistence logic is part of the entities) and Adapter (persistence logic is a service, part of an 'adapter' object and not part of the entities). Of both paradigms a short example is given below.
SelfServicing paradigm
The orders of the customer below are lazy loaded from the persistent storage. This means that when the orders are already loaded, they are not loaded again. Also, notice that the generated code doesn't need a central object which provides you the entity instances, you can work with the classes as if you've written them yourself.
// C#
CustomerEntity customer = new CustomerEntity("CHOPS");
orderGrid.DataSource = customer.Orders;
If you want to refresh the orders collection of this customer, you can force a refresh, to overrule the lazy loading:
// C#
customer.GetMultiOrders(true);
Adapter paradigm
Adapter is the paradigm meant for disconnected applications and applications where persistence logic can't be part of or shouldn't be part of the entities. An example could be an application where the UI tier for example isn't allowed to do any persistence logic: to avoid having developers call persistence oriented methods like fetch methods or save methods, Adapter is a good alternative. Also, in distributed applications, adapter is recommended. Adapter is also suitable to use multiple database types at the same time, so fetch an entity from SqlServer and save it later on in an Oracle database for example.
Because of its nature, Adapter doesn't support Lazy Loading. However it does support, as SelfServicing, the powerful Prefetch Path feature to load related entities efficiently. This is illustrated in the following example.
// C#
CustomerEntity customer = new CustomerEntity("CHOPS");
PrefetchPath2 path = new PrefetchPath((int)EntityType.CustomerEntity);
path.Add(CustomerEntity.PrefetchPathOrders);
// now fetch the customer and the related orders in one go
using(DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntity(customer, path);
}
orderGrid.DataSource = customer.Orders;
You can download the demo from http://llblgen.com/pages/demo.aspx
Labels: Code generator

0 Comments:
Post a Comment
<< Home