I have been looking for a set of templates to create business entities. I have certain requirements and I have been looking for them. I haven't been able to find them, so I have started writing my own templates. I am guessing that a lot of you have done this before. So if I would like to run my thoughts past this group.
I have seen two camps when it comes to DAL layer of n-Tier design. One camp breaks an entity up inside the data server. Meaning that the Entity calls a stored procedure and inside that stored procedure the process of breaking the entity into it's constituent part is done in the server. The other camp are people who break the entity up inside the C#/VB code and then use vanilla CRUD stored procedures for each table in the database to save the data. Both methods have their good and bad. I have put the options before my group of programmers and they wanted to do the the later.
So the template should take in the properties for a entity and create the entity class. It then needs to write code to create the data factory which breaks up the entity into it's appropriate tables and processes them individually. So far I have decided to use an XML File to drive the creation of the entity and the DAL. Below is a blank version of the XML file.
<EntityOutline>
<ClassName></ClassName>
<ClassNamespace></ClassNamespace>
<DataFactory>
<ClassName></ClassName>
<ClassNamespace></ClassNamespace>
<PartialClass>true</PartialClass>
</DataFactory>
<Properties>
<Property>
<PropertyName></PropertyName>
<PropertyType></PropertyType>
<IsEntityKey>false</IsEntityKey>
<DatabaseName></DatabaseName>
<TableName></TableName>
<FieldName></FieldName>
<DatabaseFieldType></DatabaseFieldType>
</Property>
</Properties>
<DatabaseOutline>
<TableConnection>
<ReferencedDatabase></ReferencedDatabase>
<ReferencedTable></ReferencedTable>
<ReferencedField></ReferencedField>
<ReferencingDatabase></ReferencingDatabase>
<ReferencingTable></ReferencingTable>
<ReferencingField></ReferencingField>
</TableConnection>
</DatabaseOutline>
</EntityOutline>
I believe this contains all the information I need to accomplish my code, but like I said some of you may have already done this. So I am looking for suggestion, opinions, etc.
Thanks