Hi,
I m working on new asp.net project.
I will use n-layer architecture.
So my question is about the business object.
I have some little classes like category, collections, etc...
each of them has 2 or 3 properties.
So is it better to use only one class file that will include all these
little classes or use one class file for each class ?
Thanks for sharing your experience.
Stan
Peter Bromberg [C# MVP] - 11 Jun 2007 17:58 GMT
Generally speaking, code is more maintainable and easier for others to work
with when each class has its own file.
Peter

Signature
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
> Hi,
>
[quoted text clipped - 9 lines]
> Thanks for sharing your experience.
> Stan
Peter Bradley - 11 Jun 2007 18:04 GMT
Ysgrifennodd Peter Bromberg [C# MVP]:
> Generally speaking, code is more maintainable and easier for others to work
> with when each class has its own file.
> Peter
I agree
Peter
Joseph Ferris - 11 Jun 2007 18:27 GMT
> Ysgrifennodd Peter Bromberg [C# MVP]:> Generally speaking, code is more maintainable and easier for others to work
> > with when each class has its own file.
[quoted text clipped - 3 lines]
>
> Peter
Version control is also a consideration. It is much more efficient
to have each object separate in the event of rolling back to specific
versions of maintainable classes and not having changes to one class
tied to another.
Joseph
sloan - 11 Jun 2007 19:07 GMT
I concur.
Seperate them out into classes.
Also see:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!140.entry
I prefer (for collection of my custom objects (in 2.0)) the following
public class EmployeeCollection : List <Employee>
{}
> Hi,
>
[quoted text clipped - 9 lines]
> Thanks for sharing your experience.
> Stan
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 12 Jun 2007 06:53 GMT
I agree that "generally" it's better to have them in separate files.
However, for the sake of convenience I might make an exception in a case
where I'm fairly certain these classes are unlikely to grow.

Signature
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
> Hi,
>
[quoted text clipped - 9 lines]
> Thanks for sharing your experience.
> Stan