Is code generation a requirement for CSLA?

Is code generation a requirement for CSLA?

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


mikemir8 posted on Wednesday, November 28, 2007

Of course I know you can write all your code by hand if you want. But, based on your own experience, is it reasonable to create a medium or large project with no code generation (except maybe for code snippets)?

- Miguel

ayubu replied on Wednesday, November 28, 2007

Hi

for a large or medium coding buusiness objects  manually is not reasonable and this is not only for CSLA.NET business objects but also for any persistable object, thanx for CSLA.NET that a code to make full fledged business objects is arleady implemented making code generation highly productive

A good number of code in the CSLA.NET based business objects are properties and also the approach is so good arranged that they follow a good hence using code generation a breeze.

However using code generation tools can be tempting making a developer think at first designing database, then from database ganerating business objects, which is not good as it will only make object a representing database tables and columns i.e normalizing data while in object world it is normalizing behaviour is required.

 

ayubu replied on Friday, September 05, 2008

Hi every one
I am new to CSLA.NET 3.5 and am building an accounting package.
When i use a debit or credit property with nullabe double datatype i get this message

DataPortal.Update failed (System.Data.SqlClient.SqlException: The parameterized query '(@AccountID uniqueidentifier,@LocalAmount float,@DrCr nvarchar(1' expects the parameter '@Credit', which was not supplied.    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)    at


When i type 0 or any number the query executes fine the same if i use the normal double datatype( not nullable). is there a way to deal with this.
Am using raw sql statements , stored procedure is not an option to me( am using custom made code generator)

Regards

tstout replied on Friday, September 05, 2008

I disagree that generating code from the DB schema is bad. You can always do a select into with appropriate joins to create a table that reflects the desired business object representation. Using the DB schema does not force you to have a 1 to 1 mapping between business objects and tables. Many people jump to this conclusion incorrectly.

pandelaras replied on Thursday, November 29, 2007

plus, most code generators are based on csla 2.0. Usually its hard for to find any using the latest csla version.

Philip replied on Monday, January 14, 2008

With so much pressure to deliver projects on time and reduce costs, I think Code Generation  these days is almost a must. For my team it has become a neccessity.  Beside there is a good deal of choice now on the market to choose from and Code Generators are getting better and better. There are several advantages  in using Code Generation and the main one is  to free programmers to concentrate on the areas that deserve better their brain power. Code Generation can also be a good mentor for developers and generated code is generally  well written and consistent. I agree also that one of the main disadvantage with most Code Generators is that you have to start from a database model and the database must be well designed.

As for CSLA, I can inform you that Code Complete is dedicated to CSLA and always uses the latest version of CSLA.NET

Philip

Juppy replied on Tuesday, January 15, 2008

If you are interessed in a DSL-Tool (Domain Specific Language) for the Csla-Framework (BO driven Modelling) have a look at www.cslafactory.net . A first CTP Preview of the open source Tool will be released in march. For a first look you can press the View Demo button on the site.

mcsean replied on Monday, September 15, 2008

the other one is Sculpture (http://www.codeplex.com/Sculpture) it does not target the CSLA.net framework, but templates can be created to work for CSLA. Doesn't know how much longer cslafactory need for the next release, but Sculpture has already been working with Linq.

If anyone guru out there is interested in writing a "mold", the templates in Sculpture's term, to work with CSLA. please let me know, we would like to help out!

cheers!

coder replied on Sunday, October 12, 2008

The gurus from Sculpture is writing the CSLA.net mold and it will be released with Sculpture beta 2, which is within a month time. Then there will be another codegen for CSLA.net - probably the first Visual Designer for CSLA to work with VS2008.  

Copyright (c) Marimer LLC