Re: Reflection and order of the fields

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 03/08/04


Date: Mon, 8 Mar 2004 13:04:22 -0500

Frank,

    I am curious, if you are sending an object over the wire, then why not
just use serialization (assuming that .NET is on the other side of the
wire).

    The order of the fields is not guaranteed. Some reasonable assumptions
would be to get them in declarative order, and alphabetical, but I am not
sure. If you need a specific order, I would recommend getting the specific
fields and then ordering them yourself.

    Hope this helps.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"Frank D Lombardo" <Frank@NoSpam.com> wrote in message
news:O8nyEXTBEHA.1548@TK2MSFTNGP12.phx.gbl...
> I am attempting to use Reflection to send an object over a serial port.  I
> won't know the exact type of the object until run-time.  If I call
> GetFields(), is there any guarantee on the order the fields are returned?
> Would it help if I used a struct instead of a class?  I need to send the
> fields in a known and consistent order.  I would also like this code to
work
> on the Compact Framework.
>
>
> Thanks,
> -- 
> Frank D. Lombardo
> Turning Point Technology, Inc.
> Frank_AT_TurningPointOnline_DOT_com
>
>
>
>


Relevant Pages

  • Re: Reflection and order of the fields
    ... just use serialization (assuming that .NET is on the other side of the ... wire). ... would be to get them in declarative order, and alphabetical, but I am not ... I> won't know the exact type of the object until run-time. ...
    (microsoft.public.dotnet.framework)
  • Re: Reflection and order of the fields
    ... just use serialization (assuming that .NET is on the other side of the ... wire). ... would be to get them in declarative order, and alphabetical, but I am not ... I> won't know the exact type of the object until run-time. ...
    (microsoft.public.dotnet.general)
  • Re: Reflection and order of the fields
    ... just use serialization (assuming that .NET is on the other side of the ... wire). ... would be to get them in declarative order, and alphabetical, but I am not ... I> won't know the exact type of the object until run-time. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Reducing the size of a serialized object.
    ... Serialization I find that the best place to look is the JavaDoc's ... Because a lot of beans are being sent over the wire to the RMI server ... > every day I want to try to keep down the size of the serialized bean. ...
    (comp.lang.java.programmer)
  • Re: Web Service Performance
    ... Also don't measure the first time as you don't want to include assembly load ... >> serialization is quite fast, ... >> When request is made, it goes through (i may be wrong with some of these ... >>> still sounds like it is the wire since I'm still in testing on my ...
    (microsoft.public.dotnet.framework)