Create own Datalayer or Use LLBLGen Pro

R

Ryan

I was hoping some of you experts out there can give a newb some advice.
Let me first explain what i am doing.

I am starting a large project ( large to me, but again i have never
created a "real" application before so its probably small for some of
you ). For the time being it will be an internal project for my company,
but i may put it on the market once tested and proven. I am estimating
it will contain around 40-50 tables in MSQL database by the time im
done. For my data layer i have narrowed it down to two options. #1) Use
an or mapper, im specifically looking at llblgen pro. #2) Make my own
data layer creation script using codesmith.

Now there is a couple things to take into consideration. I have already
started work on a codesmith template, that can generate my entities,
typed collections and classes to persist the entities and collections to
the database. It actually works :) Although i still need to do more
extensive testing, it also generates the stored procedures for me. If
you look at the tracker sample app by infragistics, my templates produce
something VERY similar to their data layer except a bit more advanced.

I have done quite a bit of research on my options, and every sample app
i see, they create thier own simple data layer ( tracker, taskvision,
dotnetnuke). Is their a particular reason why none of them use an OR mapper?

I also would like to implement a logging mechanism, that will record who
updated what table and what time, this can be done easily with stored
procedures as i just modify my stored procedures templates. With llblgen
pro, i would have to implement this in business logic instead of making
it transparent. Unless, i could somehow override the save feature in
llblgen ( frans feel free to reply :) )

i have created a list of pro's and cons that i have come up with for both.

1.) Using my templates, i will have over 200+ stored procedures to
maintain, although they will be generated. LLBLGen doesnt suffer from
this, plus its filtering options are much better.

2.) My templates are not thoroughly tested and not used by many people,
as where llblgen has been tested and is used by many.

3.) By using my templates i have complete control over everything. But
it also will require more time to test etc...

4.) LLBLGen Pro is inexpensive and i am sure i will most likely have
over $210 in time still left to put in my templates to make them a bit
more robust. ( Then again maybe my tempaltes will do just fine for what
i need )

5.) My templates use my coding style, although i am sure if i jsut sat
down and forced myself to use another style, it would come naturally
quickly.

i guess i am asking you experienced developers to share some wisdom with
a non-experienced one. What is a better option for the long run? those
of you who use or mappers, what are your experiences? Does anyone use
LLBLGen Pro or another or mapper for a production applcation u can buy?
(ie. you sell to the public, not made for one specific company )


Thanks Ryan
 
W

William Ryan eMVP

Hi Ryan:

Miha Markic has a template generator at www.rthand.com that you may find
helpful. I only recently got into OR/M tools and i can comment on two in
particular. I know about 6 people that use LLBLGenpro and I've heard the
same stuff about it from everyone.. It's a superb product that will save you
a ton of time. There is a learning curve, but it pays for itself after a
day or two. We have a forum over on devbuzz
http://forums.devbuzz.com/Using_OR/M_and_Code_Generators/forumid_28/tt.htm
For OR/M tools and I've heard nothign but rave reviews about LLBLGen.
There's another product which is made by Deklarit www.deklarit.com which I
am in love with . However, it does a lot more than ORM and it carries with
it a decent learning curve. Once you get over it, you can generate entire
projects in light speed, but it does take a commitment to learning. I've
used it extensively and know quite a few others that have and have and I
could not speak higher about the product
http://msmvps.com/williamryan/posts/6268.aspx . You will not go wrong with
either one.

Also, if you need to do your own thing and really can't live with the
'rules' that either product puts on you, Kathleen Dollard's new Code
Generation in ..NET book has a whole chapter (Ch 6) dedicated to the
subject. Kathleen's a brilliant woman and definitely knows here stuff - and
her discussion of OR/M illustrates this fact. If you want to roll your own
stuff for future use, it will get you where you want to be (and the rest of
the book is pretty kick a33 too).

HTH,

Bill

www.devbuzz.com
www.knowdotnet.com
 
F

Frans Bouma [C# MVP]

Ryan wrote:

(inline)
I am starting a large project ( large to me, but again i have never created
a "real" application before so its probably small for some of you ). For
the time being it will be an internal project for my company, but i may put
it on the market once tested and proven. I am estimating it will contain
around 40-50 tables in MSQL database by the time im done. For my data layer
i have narrowed it down to two options. #1) Use an or mapper, im
specifically looking at llblgen pro. #2) Make my own data layer creation
script using codesmith.

Now there is a couple things to take into consideration. I have already
started work on a codesmith template, that can generate my entities, typed
collections and classes to persist the entities and collections to the
database. It actually works :) Although i still need to do more extensive
testing, it also generates the stored procedures for me. If you look at the
tracker sample app by infragistics, my templates produce something VERY
similar to their data layer except a bit more advanced.

Cool :)
I have done quite a bit of research on my options, and every sample app i
see, they create thier own simple data layer ( tracker, taskvision,
dotnetnuke). Is their a particular reason why none of them use an OR mapper?

Most examples are using plain ADO.NET because they're examples of using,
among other things, ADO.NET. DotNetNuke for example is based on such an
example, IBuySpy.

An n-tier application (every database targeting applicationa actually) has
to deal with a pile of overhead code. The overhead code will end up in the
GUI or in teh Lower end of your app:
- with datasets, you need to type more code in your gui/BL code, for example:
myDataSet.Tables[0].Rows[x][y].
- with an O/R mapper, you have less code in your higher layers,
myCustomer.Name, however you need more code in your DAL: transform data from
the DB into a custom class.
I also would like to implement a logging mechanism, that will record who
updated what table and what time, this can be done easily with stored
procedures as i just modify my stored procedures templates. With llblgen
pro, i would have to implement this in business logic instead of making it
transparent. Unless, i could somehow override the save feature in llblgen (
frans feel free to reply :) )

:)
If you use the adapter template set, you can create a subclass of the
DataAccessAdapter (the object broker) class, and override OnSaveEntity() for
example and call your logging package there.
i have created a list of pro's and cons that i have come up with for both.

1.) Using my templates, i will have over 200+ stored procedures to
maintain, although they will be generated. LLBLGen doesnt suffer from this,
plus its filtering options are much better.

it's often the code calling the procs which is hard to maintain. For example
you want an extra filter option: you adjust the proc, add a parameter, but
you *also* have to alter the method calling the proc in your DAL class. You
can of course generate that one also again, but the signature of the method
calling your proc probably changes, breaking code.
2.) My templates are not thoroughly tested and not used by many people, as
where llblgen has been tested and is used by many.

If what you have works for you, you always have to consider that option as
well. As I said earlier: it's overhead code, it ends up somewhere, and if you
can deal with that in the most easiest way, you should take that option,
considering mantainability, extensibility etc. Our templates are well tested
and already live in a lot of applications around the globe.
3.) By using my templates i have complete control over everything. But it
also will require more time to test etc...

sad isn't it, that often when you have X you don't have Y ;) :)
4.) LLBLGen Pro is inexpensive and i am sure i will most likely have over
$210 in time still left to put in my templates to make them a bit more
robust. ( Then again maybe my tempaltes will do just fine for what i need )

It contains over 1.5 years of development :)
5.) My templates use my coding style, although i am sure if i jsut sat
down and forced myself to use another style, it would come naturally
quickly.

If you stick with MS' code guidelines you will not be in a lot of trouble.
Our tool uses MS' code guidelines.

If you have more specific LLBLGen Pro questions, feel free to ask them
directly :)

Frans.
 
M

Miha Markic [MVP C#]

R

Ryan

Thanks guys for your feed back.

I am still interested in what other people have to say, has anyone else
used llblgenpro?

I know this could start a flamewar, but it is a serious question. I do
lack experience so its hard for me to see problems i might run into.

What are the downsides to using LLBLGenPro? Why have some of you decided
not to use it?

Im targeting LLBLGen becuase i liked it the best of all that i have seen
and from what i can tell, the support frans provides is superb!


Frans:

What i meant by coding style is mostly the naming of objects. For some
reason it just seems a bit greek to me. However, thats just be cuase
someone else coded it and not me :) I will say though that i have been
reviewing the documentation and i am becoming much more comfortable with
it. Especially once i understand why you did certain things it makes
more sense. i can see why some people said it takes a day or so before
you get comfortable.

I do have a couple questions though.

#1) In the adapter templates, you can extend the framework through
inheritance. What would be cool is if you could have an option in your
designer to have it autogenerate the classes for you. This would really
be handy if you have a lot of tables. Or in my case, i want to pass the
objects to plugins, but i dont want my "plugin developer" to see the
transaction stuff and possibly some other things in the generated
objects. Is somethign like this possible?

#2) if you dont mind me asking, what kind of cool new features do you
have in the works? :) :)


Thanks Ryan


Ryan wrote:

(inline)

I am starting a large project ( large to me, but again i have never created
a "real" application before so its probably small for some of you ). For
the time being it will be an internal project for my company, but i may put
it on the market once tested and proven. I am estimating it will contain
around 40-50 tables in MSQL database by the time im done. For my data layer
i have narrowed it down to two options. #1) Use an or mapper, im
specifically looking at llblgen pro. #2) Make my own data layer creation
script using codesmith.

Now there is a couple things to take into consideration. I have already
started work on a codesmith template, that can generate my entities, typed
collections and classes to persist the entities and collections to the
database. It actually works :) Although i still need to do more extensive
testing, it also generates the stored procedures for me. If you look at the
tracker sample app by infragistics, my templates produce something VERY
similar to their data layer except a bit more advanced.


Cool :)

I have done quite a bit of research on my options, and every sample app i
see, they create thier own simple data layer ( tracker, taskvision,
dotnetnuke). Is their a particular reason why none of them use an OR mapper?


Most examples are using plain ADO.NET because they're examples of using,
among other things, ADO.NET. DotNetNuke for example is based on such an
example, IBuySpy.

An n-tier application (every database targeting applicationa actually) has
to deal with a pile of overhead code. The overhead code will end up in the
GUI or in teh Lower end of your app:
- with datasets, you need to type more code in your gui/BL code, for example:
myDataSet.Tables[0].Rows[x][y].
- with an O/R mapper, you have less code in your higher layers,
myCustomer.Name, however you need more code in your DAL: transform data from
the DB into a custom class.

I also would like to implement a logging mechanism, that will record who
updated what table and what time, this can be done easily with stored
procedures as i just modify my stored procedures templates. With llblgen
pro, i would have to implement this in business logic instead of making it
transparent. Unless, i could somehow override the save feature in llblgen (
frans feel free to reply :) )


:)
If you use the adapter template set, you can create a subclass of the
DataAccessAdapter (the object broker) class, and override OnSaveEntity() for
example and call your logging package there.

i have created a list of pro's and cons that i have come up with for both.

1.) Using my templates, i will have over 200+ stored procedures to
maintain, although they will be generated. LLBLGen doesnt suffer from this,
plus its filtering options are much better.


it's often the code calling the procs which is hard to maintain. For example
you want an extra filter option: you adjust the proc, add a parameter, but
you *also* have to alter the method calling the proc in your DAL class. You
can of course generate that one also again, but the signature of the method
calling your proc probably changes, breaking code.

2.) My templates are not thoroughly tested and not used by many people, as
where llblgen has been tested and is used by many.


If what you have works for you, you always have to consider that option as
well. As I said earlier: it's overhead code, it ends up somewhere, and if you
can deal with that in the most easiest way, you should take that option,
considering mantainability, extensibility etc. Our templates are well tested
and already live in a lot of applications around the globe.

3.) By using my templates i have complete control over everything. But it
also will require more time to test etc...


sad isn't it, that often when you have X you don't have Y ;) :)

4.) LLBLGen Pro is inexpensive and i am sure i will most likely have over
$210 in time still left to put in my templates to make them a bit more
robust. ( Then again maybe my tempaltes will do just fine for what i need )


It contains over 1.5 years of development :)

5.) My templates use my coding style, although i am sure if i jsut sat
down and forced myself to use another style, it would come naturally
quickly.


If you stick with MS' code guidelines you will not be in a lot of trouble.
Our tool uses MS' code guidelines.

If you have more specific LLBLGen Pro questions, feel free to ask them
directly :)

Frans.
 
F

Frans Bouma [C# MVP]

Ryan said:
I am still interested in what other people have to say, has anyone else
used llblgenpro?

Well, people in over 45 countries are :)
What are the downsides to using LLBLGenPro? Why have some of you decided
not to use it?

Every tool has its downsides. When it comes to O/R mapping, there is a lot
of 'academic blabla' ventilated by a lot of people, i.e.: "an O/R mapper
should do X, Y and Z in the A, B or C way" without giving reasons or thinking
about downsides or alternatives.
Im targeting LLBLGen becuase i liked it the best of all that i have seen
and from what i can tell, the support frans provides is superb!
:)

What i meant by coding style is mostly the naming of objects. For some
reason it just seems a bit greek to me. However, thats just be cuase
someone else coded it and not me :) I will say though that i have been
reviewing the documentation and i am becoming much more comfortable with
it. Especially once i understand why you did certain things it makes more
sense. i can see why some people said it takes a day or so before you get
comfortable.

Yes, especially in teh way O/R mapping works: thinking in entities is
something else than thinking in 'the result of a select'.
I do have a couple questions though.

#1) In the adapter templates, you can extend the framework through
inheritance. What would be cool is if you could have an option in your
designer to have it autogenerate the classes for you. This would really be
handy if you have a lot of tables. Or in my case, i want to pass the
objects to plugins, but i dont want my "plugin developer" to see the
transaction stuff and possibly some other things in the generated objects.
Is somethign like this possible?

There are templates available for this :)
#2) if you dont mind me asking, what kind of cool new features do you have
in the works? :) :)

At the moment (went beta yesterday, release in 3 weeks): Firebird
1.0/1.5/interbase 6.x support, revamped editors in the gui, creation of own
relations (the tool relies currently on FK constraints to determine which
entities are related), template include support and a lot of tiny things
behind the scenes :). Especially the new relation editors and the template
include support are a big step forward: you can for example bind an own
template with custom code to an ID and 'inject' that template in the shipped
templates during code generation, so you can customize the generated code
without having to alter templates or through inheritance. Due to the
templateID approach, you can create really powerful templates: by selecting
another config file you can inject other code into the standard templates :)

FB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top