views:

475

answers:

1

Background

We have our own Business Object Architecture, a much lighter (...and loosely based on, but does'nt actually use...) version of the "CSLA" business object framework with similar usage, validation, inclusive DAL etc. All code is generated (stored procs and Business Objects are creaed using CodeSmith)

The Business Objects are quite rich with regards features to Get Objects, Lists with filter sort parameters to return Objects and Generic Lists.

This architecture may not subscribe to one particular or popular architecture and purism, but its works well for us and has reduced a lot of manual coding.

The one thing we find a lot, especially when integrating with other systems (3rd party, Flash or Silverlight etc) is the requirement for contextualised "Basic Objects" or Data Containers that can be easily serialized and supplied across webservices etc for a specific purpose.

Looking around SO and the web, the Term DTO comes up a lot. We have created these Basic objects within a Dto namespace, these objects are basic objects that represent basic or specific versions of Business Objects but have no features except Constructors that accept either a DataRow or Business Object to populate the "Dto" object.

Questions:

1) Is calling this a "DTO" object correct?

2) Rather than having constructors to provide the data and set the object properties, should this population code be in a different class, some kind of "Helper Class"

Any comments on terminology and naming conventions for what I am trying to do?

Thanks

+2  A: 

1) Yes.

2) I see no big problem, allthough you kind of limit the use of the DTO. But again I see no big problem with it. There is a mapping framework you could use to do this for you which you can find here http://www.lostechies.com/blogs/jimmy%5Fbogard/archive/2009/01/22/automapper-the-object-object-mapper.aspx

chrissie1
Thanks, for the info. I have gone with adding a Method to the Business Object (User configurable partial class) to get the DTO object/list to keep the DTO object as empty as possible.
Mark Redman