CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

Is code generation a requirement for CSLA?

Last post 10-12-2008, 8:55 PM by coder. 8 replies.
Sort Posts: Previous Next
  •  11-28-2007, 10:19 PM 19435

    Is code generation a requirement for CSLA?

    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
  •  11-28-2007, 11:44 PM 19439 in reply to 19435

    Re: Is code generation a requirement for CSLA?

    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.

     

  •  11-29-2007, 12:22 AM 19441 in reply to 19435

    Re: Is code generation a requirement for CSLA?

    plus, most code generators are based on csla 2.0. Usually its hard for to find any using the latest csla version.
  •  01-14-2008, 4:22 AM 20411 in reply to 19441

    Re: Is code generation a requirement for CSLA?

    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

  •  01-15-2008, 6:07 AM 20435 in reply to 19435

    Re: Is code generation a requirement for CSLA?

    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.

  •  09-05-2008, 6:41 AM 25958 in reply to 19439

    Problem with Nullable Data Type

    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
  •  09-05-2008, 9:18 AM 25965 in reply to 19439

    Re: Is code generation a requirement for CSLA?

    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.
  •  09-15-2008, 3:23 AM 26209 in reply to 20435

    Re: Is code generation a requirement for CSLA?

    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!

  •  10-12-2008, 8:55 PM 27176 in reply to 26209

    Re: Is code generation a requirement for CSLA?

    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.  

View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems