Re: XMLSerialization - continued

Peter Osucha <[email protected]> Thu, 19 Jul 2007 11:30:50 -0400
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <[email protected]>
Thanks for the comments Adam.  This is code that will only be used
internally - but still, I might as well get in the habit of doing things
in a well thought out manner.  There is one project with several objects
that I want to be able to serialize.  Perhaps it would be better to put
the code to serialize all of them in a separate class in that project.

Peter

-----Original Message-----
From: Discussion relating to the specifics of the C# and Managed C++
languages [mailto:[email protected]] On Behalf Of Adam Sills
Sent: Thursday, July 19, 2007 10:33 AM
To: [email protected]
Subject: Re: [DOTNET-CX] XMLSerialization - continued

I don't think there's necessarily anything wrong with it. I think
there's a
bit of a conflict of interest there depending upon your design: will all
clients want to serialize using your method or could a client perhaps
want
to do its own thing? If this is private code to your own application
that
will only be used internally, I think it's up to whether you want the
convenience of [MyClass].Serialize and [MyClass].Deserialize methods.

Do you plan on unit testing this code? Do you mind that you now have a
class
that perhaps spans two purposes (doing whatever the class is meant to do
in
the first place, and providing serialization mechanism)?

Adam..

-----Original Message-----
From: Discussion relating to the specifics of the C# and Managed C++
languages [mailto:[email protected]] On Behalf Of Peter
Osucha
Sent: Wednesday, July 18, 2007 9:40 PM
To: [email protected]
Subject: [DOTNET-CX] XMLSerialization - continued

What do you guys think about including a static method in a specific
class
to Serialize and Deserialize that object?

It seems like something reasonable to do.  It would 'contain' the code
in
that class.  However, perhaps there is something wrong with this train
of
thought...

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor=AE  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com