This is a migrated thread and some comments may be shown as answers.
Business Rules guidance
3 Answers 69 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gene
Top achievements
Rank 1
Gene asked on 31 Dec 2008, 07:22 PM
I'm looking for some guidance on where business rules should be coded.  Can they be put into the partial class file that contains the class properties?  Or should they go someplace else?  What is the best practice? 

thanks in advanc
Gene

3 Answers, 1 is accepted

Sort by
0
Accepted
Thomas
Telerik team
answered on 02 Jan 2009, 10:49 AM
Hello Gene,

yes, the business code should be in a partial class file like the properties are. You can put that into the properties part or you might want to consider using another partial class file just for organizational purposes.

Another (but not preferred by me) way would be to use extension methods, which better separates the public and the private aspects of a class.

Greetings,
Thomas
0
Gene
Top achievements
Rank 1
answered on 05 Jan 2009, 04:06 PM
Thomas,

Thanks for the reply.  When do I need to worry about my classes being overwritten during automated generation?

Thanks again.
Gene.
0
Thomas
Telerik team
answered on 05 Jan 2009, 05:16 PM
Hi Gene Kula,

whenever you do the reverse engineering step (manually from VS), there is a dialog asking you which class files (partial) should be generated. Only those files will be generated (again, only the XXX.Telerik.OpenAccess.cs partial class files, not your XXX.cs file) when selected.
We think of the 'automated generation' not as a cyclic step (although we support that), but as a one time 'get-me-a-matching-model-for-the-db-i-have' step. When you need to alter the database afterwards, it is very likely you need to regenerate only one partial class file.

Greetings,
Thomas
Tags
General Discussions
Asked by
Gene
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Gene
Top achievements
Rank 1
Share this question
or