Re: Reflection and order of the fields

From: Kevin P. Fleming (kpfleming_at_backtobasicsmgmt.com)
Date: 03/08/04


Date: Mon, 08 Mar 2004 11:49:58 -0700

Frank D Lombardo wrote:

> Because of my specific serialization requirements, I was hoping to write my
> own generic command serializer that would use reflection to determine the
> run-time data fields of the command and send them over the wire. I'm just
> not sure if I can rely on the declarative order of the fields being the
> order that they are returned from GetFields().

But this technique breaks all the normal rules of object oriented
programming :-)

Why don't you want the command objects to be able to
serialize/deserialize themselves? There shouldn't be any reason to use
reflection here, and even if GetFields() could return the field in some
predetermined order, are you going to otherwise ensure that both ends of
this link are always be using the same versions of these command
objects? If not, you need a more tolerant serialization mechanism.



Relevant Pages

  • Re: Reflection and order of the fields
    ... > own generic command serializer that would use reflection to determine the ... > run-time data fields of the command and send them over the wire. ... > order that they are returned from GetFields(). ...
    (microsoft.public.dotnet.framework)
  • Re: Reflection and order of the fields
    ... > own generic command serializer that would use reflection to determine the ... > run-time data fields of the command and send them over the wire. ... > order that they are returned from GetFields(). ...
    (microsoft.public.dotnet.general)
  • Re: Reflection and order of the fields
    ... > own generic command serializer that would use reflection to determine the ... > run-time data fields of the command and send them over the wire. ... > order that they are returned from GetFields(). ...
    (microsoft.public.dotnet.languages.csharp)
  • Sequel to: Im giving up computers if this is the future.
    ... This Reflection thing sends a command to the VMS session: RUN ALPHALK2 ...
    (comp.os.vms)
  • Re: Sequel to: Im giving up computers if this is the future.
    ... > This Reflection thing sends a command to the VMS session: RUN ALPHALK2 ...
    (comp.os.vms)