Data Tier Design and ORM Code Gen

Howdy,

I’ve been playing around with the ORM code generation, after a bit of tinkering I had a fully functional DAL… with one problem. No separation of data tier components from presentation tier (in theory).

The business objects are generated within the DAL. I could change them to another package, but that would require a fair bit of reworking (and could be fraught with mistakes).

Developing in .NET is new for me (many years of Java development). But from my understanding the tiered architecture is the same as Java.

Is there a way to define custom business objects that interact with the ORM generated DAL within the designer? If that was the case then instead of assigning variables to the DAL object, the DAL could just be passed a business object with all the values preset. This would also be true for the reverse, retrieving objects from the DAL would return a business object. This would provide for clear separation of data access logic and presentation logic.

Using custom business objects would also allow them to extend the IList and/or IComponent Interfaces, therefore allow them to be data sources for web components (or windows components).

If one (or all) of the current generation methods provide for a design patter that allows seperation of business logic I would love an example. Or if anyone has come up with a solution that they have used to get around the problem of the DAL class (not the *factory/*dao or the *criteria) be visible to other layer could they please let me know how.

Another question? Are the generation templates available for customization?

I hope this all makes sense. It almost feels like I have got this all wrong.

The code I generated was with Factory and DAO, I have since looked at POJO and found that this is better suited to seperation of business objects from data access. I would still like to be able to modify the templates to customise the business objects (if needed)

Cheers
Q

Hello Quinten,

Thank you for your post. Actually our the generated ORM code act only the data tier within a tier-ed architecture. You still need to code the business and presentation tiers yourself. Of course, you can design the business and presentation tiers with SDE-VS, and generate code from the resulting diagrams :wink:

Best regards,
Jick

Howdy

Sorry, maybe I wasn’t clear enough. What I was referring to was the generation of Business objects, not the Business tier.

The business object effectively just being dumb objects that store (related) data. These objects can then be passed from tier to tier. The are completely separate from the data tier.

Some of the generation methods tended to integrate the business objects with the data tier. As best as I can tell (I’ve on quickly looked at all of the generation patterns) only the POJO offers any real degree of separation. Which is fine because the POJO code is quite nice.

Is there the possibility of customizing the templates?

Cheers

Hello Quinten,

By template, do you mean the way how the code will be generated by generating ORM? I regret that you can only select one of the supported template but not to customize it.

Best regards,
Jick

This post is several years old. Has this capability been added? I’d like to be able to modify the way ORM code is generated. Is there a set of template files?

You are doing a great job.It will help other people aswell.
Thanks.