Hi Guys
This is my first post, though I've been reading for a few weeks...
I'm very enthused about CSLA.NET, but am just trying a few experiments with some real stuff now - thinking about converting/upgrading an existing application to CSLA.NET.
I'm intested in knowing what people use for code generation, if anything. I'm thinking that there's a huge amount of code to write for things like property accessors, etc. if it all has to be written by hand (and especially so when converting an existing app!)
Do you use a code generator, and more importantly, what is the "source" of the generation? From what I can see, I want my business object classes to model my domain and not the way my relational database is structured - so ideally I'd be using some UML model of my classes as input to a code generator, and not my database schema. Or maybe I'm imagining something that doesn't actually exist (but would make an awesome productivity tool if it did!)
I'm most interested in using CSLA.NET with an ORM (LLBLGen is my current tool) but I'm leery of making my business object classes mirror the database (which is exactly what LLBLGen tries to provide) - I really want to get away from that and be able to model my objects according to their behaviour rather than their data structure.
Interestingly there are some guys who've put together a combination of LLBLGen and CSLA.NET - known as JCL - however, from looking at it I'm wary that they've hacked CSLA.NET to use the LLBLGen generated classes as the base classes - the business object classes inherit from the LLBLGen classes and this then ties the business object design to the database. Not what I want...
Thanks in advance for any enlightenment.
Craig
Hi Craig,
Have a look at CodeSmith. There are already CSLA templates that can be used to create your classes. All you really need to do is state what properties you want and then fill in the data access code.
I've never been a fan of code generation, but I have to say this is a good tool and produces clean code (you define the template to do produce what you want).
Hi Andres
From the quick look I've taken as your CSLAGen, it looks like what I was imagining. Certainly sounds promising. Are you working on a version for 2.0 of CSLA?
The other track I'm going down is that my company has previously purchased a tool called Enterprise Architect which is a UML modelling tool. We've really only scratched the surface of it previously but the version we have supports MDA and being able to transform a UML model, through templates, into something else. At this stage, I'm thinking that if I wrote some templates for CSLA.NET this would give me what I'm looking for.
Craig
Hi Andres
I looked at Chris' site in the tips/tricks section, then went to SourceForge to download the project, but it's not the same version as Chris's page refers to. Where do I get the version his tutorial is for?
Thanks,
Craig
P.S. I went to www.cslagen.com but it comes up with some ASP.NET configuration error :
Hi Andres
I'm certainly keen on getting my hands on this, and would like to be able to contribute.
Craig
Hey Craig,
I'm one of the people who've compiled the JCL Framework, and I'd like to inform you that on an upcoming version of the framework, we will be doing exactly what you asked for: allow the users to create objects based on behaviour and NOT data.
If you read the blogs on the JCL website www.jclframework.net you'll see what I mean.
Bashar
Copyright (c) Marimer LLC