Improving Efficiency

Improving Efficiency

Old forum URL: forums.lhotka.net/forums/t/3181.aspx


devbanana posted on Thursday, July 12, 2007

Hi,

 

I love using CSLA .NET for its functionality and scalability when scalability is required.

 

However frankly sometimes the data access is just a pain. I just came from a project where I used an ORM layer but was also able to use direct SQL when required, and a project I quoted three weeks for took 8 days.

 

I'm wondering if there are any related tools that can be tied into CSLA .NET to improve efficiency? Flexibility is great, but time costs and if it takes a whole lot longer to create the necessary business objects for something, well one wonders if it is then worth the gain. I'd love some compromise.

 

No offense is meant in the above, because I really like using this, just trying to find some ways to gain efficiency as far as time is concerned. What do you think?

devbanana replied on Thursday, July 12, 2007

Not to bump this, but I just was searching around a bit.

 

Apparnetly many people are using code generators.

 

so, what do you recommend as far as those are concerned? Do oyu think that's the best way to go?

 

It'd be nice to have the stored procedures generated as well, and common / simple parts of the business objects, but I'd still want to be able to add to them or modify them obviously.

Skafa replied on Thursday, July 12, 2007

Have a look at CslaGenerator which does all of this:

http://groups.google.com/group/CslaGenerator

JoeFallon1 replied on Thursday, July 12, 2007

I use Codesmith to generate BOs.

I helped create the initial set of templates a few years ago but then had to split off from that project as my style differed greatly from the common style. e.g. I do not use SPs. I have all the SQL coded in Shared methods. etc.

Bottom line is - if you have some BOs that you have already built then you are familiar with your own style and you can easily create Codesmith templates to re-generate them. Once you have a template you can use it to build other BOs of the same type (Root, Child, ROC, ECC, etc.)

I also use split classes and inheritance. So I code gen a base class and inherit from it in the final type. In the final type I can override base methods and properties to fine tune the result.

 

Oh yeah - you should definitely have a Base class for each type defined by Rocky so that you derive all yur classes from your own base types. This allows you to override stuff in CSLA and have all the BOs that inherit from your base types get the new functionality. Rocky has made CSLA much more extensible over the years and it is great to be able to change things without modifying the framework.

 

Joe

 

devbanana replied on Thursday, July 12, 2007

Hello,

 

Thank you for the responses.

 

CSLAGen looks nice, and I was trying it (that's why it took me so long to respond), but alas, it is very inaccessible for me because I am blind and use a screen reader.

 

Are there any tutorials on using codesmith? I wouldn't mind trying that. I downloaded the standard version but am not exactly sure how to get started.

 

Also to those who have codesmith, does the standard version have enough functionality? That pricier version, well..is pricy :O

xal replied on Friday, July 13, 2007

I'm sorry to hear you have trouble using cslagen.
Let me know what I can do to improve usability and I'll try to make it more accesible if possible.
Maybe this should be discussed in cslagen's forum.


Andrés

devbanana replied on Friday, July 13, 2007

Hi,

 

It's a great program it seems, just again a little hard to use.

 

For example, I just can't seem to find the generate button. It's probably a graphic or something you didn't put any labeling text to? I don't know, but I can't find it. Also can't find the save button for the property windows. Those are the two biggest problems.

 

Also if you added some key combinations, that'd help a lot.

 

Anyway, I finally figured out code smith I think. I tried the stored procedure generator first and will mess with the csla templates later on. I just wish there were templates for optimistic concurrency to automatically add the LastChanged timestamp as an output parameter for example, but maybe I can modify it to do that. :)

devbanana replied on Friday, July 13, 2007

Hi,

 

Ah, I've finally figured out code smith. Just one question.

 

Why does it add the ID as a parameter in GetReadOnlyList? I guess I just don't see the sense in that since it is a list and so you wouldn't want just one item.

 

Also how's this do with child objects?

JoeFallon1 replied on Friday, July 13, 2007

The ID could be the parent ID which you could use to get the list of items that belong to the parent.

Also - the templates are just a starting point - they may not be 100% bug free. They may not be in compliance with your design standards. Feel free to modify them to meet your unique needs.

Joe

 

Copyright (c) Marimer LLC