Remoting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Broadbent

    Remoting

    Could someone clear this up for me a bit. I am a little bit uncertain about
    this but this is my understanding. Please correct where wrong or bits
    missing.

    There are two types of remoting :-

    Marshal-by-reference
    Server Activated objects (SAO). Object instanciated on the
    server. Default constructor. Creation delayed till first method call.
    Lifetime controlled by server
    has :-
    SingleCall activation mode. Object created and destroyed
    with each client request
    Singleton activation mode. Object created and shared
    between clients
    Client Activated objects (CAO). Object instanciated on the
    server. Multiple constructors. Creation is not delayed. Lifetime controlled
    by client

    Marshal-by-value
    Can be Client Activated Objects only, and instanciated on the client
    itself


    One thing I really dont understand (no real code examples) is how to remote
    using marshal-by-value. I have read that you need to apply the
    [Serializable()] attribute to the class in question but is this all you need
    to do?


    --


    Br,
    Mark Broadbent
    mcdba , mcse+i
    =============


  • Sunny

    #2
    Re: Remoting

    Hi,

    In article <OVKkkmRZEHA.22 8@TK2MSFTNGP10. phx.gbl>, no-spam-please@no-
    spam-please.com says...[color=blue]
    > Could someone clear this up for me a bit. I am a little bit uncertain about
    > this but this is my understanding. Please correct where wrong or bits
    > missing.
    >
    > There are two types of remoting :-
    >
    > Marshal-by-reference
    > Server Activated objects (SAO). Object instanciated on the
    > server. Default constructor. Creation delayed till first method call.
    > Lifetime controlled by server
    > has :-
    > SingleCall activation mode. Object created and destroyed
    > with each client request
    > Singleton activation mode. Object created and shared
    > between clients
    > Client Activated objects (CAO). Object instanciated on the
    > server. Multiple constructors. Creation is not delayed. Lifetime controlled
    > by client
    >
    > Marshal-by-value
    > Can be Client Activated Objects only, and instanciated on the client
    > itself
    >
    >
    > One thing I really dont understand (no real code examples) is how to remote
    > using marshal-by-value. I have read that you need to apply the
    > [Serializable()] attribute to the class in question but is this all you need
    > to do?[/color]

    Yes, thats all you need to do. You can not have MBR and Serializable at
    the same time, as the system would not know what to do, to pass by ref
    or by val.

    Also, you can make your class implement ISerializable, and create your
    own serialization of your class, so it can be MBV as well.

    Sunny

    Comment

    • Ken Kolda

      #3
      Re: Remoting

      Hey Sunny --

      I believe it actually is allowed to have an MBR object marked as
      Serializable. The MBR takes precedence for the purposes of remoting.

      Ken


      "Sunny" <sunny@newsgrou ps.nospam> wrote in message
      news:%23AiQf9RZ EHA.2908@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > Hi,
      >
      > In article <OVKkkmRZEHA.22 8@TK2MSFTNGP10. phx.gbl>, no-spam-please@no-
      > spam-please.com says...[color=green]
      > > Could someone clear this up for me a bit. I am a little bit uncertain[/color][/color]
      about[color=blue][color=green]
      > > this but this is my understanding. Please correct where wrong or bits
      > > missing.
      > >
      > > There are two types of remoting :-
      > >
      > > Marshal-by-reference
      > > Server Activated objects (SAO). Object instanciated on the
      > > server. Default constructor. Creation delayed till first method call.
      > > Lifetime controlled by server
      > > has :-
      > > SingleCall activation mode. Object created and[/color][/color]
      destroyed[color=blue][color=green]
      > > with each client request
      > > Singleton activation mode. Object created and shared
      > > between clients
      > > Client Activated objects (CAO). Object instanciated on the
      > > server. Multiple constructors. Creation is not delayed. Lifetime[/color][/color]
      controlled[color=blue][color=green]
      > > by client
      > >
      > > Marshal-by-value
      > > Can be Client Activated Objects only, and instanciated on the[/color][/color]
      client[color=blue][color=green]
      > > itself
      > >
      > >
      > > One thing I really dont understand (no real code examples) is how to[/color][/color]
      remote[color=blue][color=green]
      > > using marshal-by-value. I have read that you need to apply the
      > > [Serializable()] attribute to the class in question but is this all you[/color][/color]
      need[color=blue][color=green]
      > > to do?[/color]
      >
      > Yes, thats all you need to do. You can not have MBR and Serializable at
      > the same time, as the system would not know what to do, to pass by ref
      > or by val.
      >
      > Also, you can make your class implement ISerializable, and create your
      > own serialization of your class, so it can be MBV as well.
      >
      > Sunny[/color]


      Comment

      • Mark Broadbent

        #4
        Re: Remoting

        from what I've seen so far it does certainly appear that you can mark MBR's
        as serializable.

        I really need to get my hands on a comparison though to make it clear to me
        a. How to define a MBR (which I know -inherit from MarshalByRefObj ect)
        b. How to define a MBV (which I thought you just needed to set Serializable
        attribute..... but then if that was the case how come you can mark MBR's
        with this attribute too. Something dont add up?


        --


        Br,
        Mark Broadbent
        mcdba , mcse+i
        =============
        "Ken Kolda" <ken.kolda@elli emae-nospamplease.co m> wrote in message
        news:ux58p5TZEH A.2456@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Hey Sunny --
        >
        > I believe it actually is allowed to have an MBR object marked as
        > Serializable. The MBR takes precedence for the purposes of remoting.
        >
        > Ken
        >
        >
        > "Sunny" <sunny@newsgrou ps.nospam> wrote in message
        > news:%23AiQf9RZ EHA.2908@TK2MSF TNGP10.phx.gbl. ..[color=green]
        > > Hi,
        > >
        > > In article <OVKkkmRZEHA.22 8@TK2MSFTNGP10. phx.gbl>, no-spam-please@no-
        > > spam-please.com says...[color=darkred]
        > > > Could someone clear this up for me a bit. I am a little bit uncertain[/color][/color]
        > about[color=green][color=darkred]
        > > > this but this is my understanding. Please correct where wrong or bits
        > > > missing.
        > > >
        > > > There are two types of remoting :-
        > > >
        > > > Marshal-by-reference
        > > > Server Activated objects (SAO). Object instanciated on the
        > > > server. Default constructor. Creation delayed till first method call.
        > > > Lifetime controlled by server
        > > > has :-
        > > > SingleCall activation mode. Object created and[/color][/color]
        > destroyed[color=green][color=darkred]
        > > > with each client request
        > > > Singleton activation mode. Object created and[/color][/color][/color]
        shared[color=blue][color=green][color=darkred]
        > > > between clients
        > > > Client Activated objects (CAO). Object instanciated on the
        > > > server. Multiple constructors. Creation is not delayed. Lifetime[/color][/color]
        > controlled[color=green][color=darkred]
        > > > by client
        > > >
        > > > Marshal-by-value
        > > > Can be Client Activated Objects only, and instanciated on the[/color][/color]
        > client[color=green][color=darkred]
        > > > itself
        > > >
        > > >
        > > > One thing I really dont understand (no real code examples) is how to[/color][/color]
        > remote[color=green][color=darkred]
        > > > using marshal-by-value. I have read that you need to apply the
        > > > [Serializable()] attribute to the class in question but is this all[/color][/color][/color]
        you[color=blue]
        > need[color=green][color=darkred]
        > > > to do?[/color]
        > >
        > > Yes, thats all you need to do. You can not have MBR and Serializable at
        > > the same time, as the system would not know what to do, to pass by ref
        > > or by val.
        > >
        > > Also, you can make your class implement ISerializable, and create your
        > > own serialization of your class, so it can be MBV as well.
        > >
        > > Sunny[/color]
        >
        >[/color]


        Comment

        • Ken Kolda

          #5
          Re: Remoting

          Marking a class as Serializable has many more uses than just for remoting
          (e.g. serialization to disk or to a database). Imagine a class which
          represents a large dataobject that's pulled from a database. You might use
          serialization to generate a binary representation that could be stored in
          and retrieved from a db easily, but when you remote this object you may want
          MBR behavior to prevent the massive amounts of data from crossing the wire
          when only a small piece of it is needed.

          Ken



          "Mark Broadbent" <no-spam-please@no-spam-please.com> wrote in message
          news:%231rL1HUZ EHA.4092@TK2MSF TNGP11.phx.gbl. ..[color=blue]
          > from what I've seen so far it does certainly appear that you can mark[/color]
          MBR's[color=blue]
          > as serializable.
          >
          > I really need to get my hands on a comparison though to make it clear to[/color]
          me[color=blue]
          > a. How to define a MBR (which I know -inherit from MarshalByRefObj ect)
          > b. How to define a MBV (which I thought you just needed to set[/color]
          Serializable[color=blue]
          > attribute..... but then if that was the case how come you can mark MBR's
          > with this attribute too. Something dont add up?
          >
          >
          > --
          >
          >
          > Br,
          > Mark Broadbent
          > mcdba , mcse+i
          > =============
          > "Ken Kolda" <ken.kolda@elli emae-nospamplease.co m> wrote in message
          > news:ux58p5TZEH A.2456@TK2MSFTN GP10.phx.gbl...[color=green]
          > > Hey Sunny --
          > >
          > > I believe it actually is allowed to have an MBR object marked as
          > > Serializable. The MBR takes precedence for the purposes of remoting.
          > >
          > > Ken
          > >
          > >
          > > "Sunny" <sunny@newsgrou ps.nospam> wrote in message
          > > news:%23AiQf9RZ EHA.2908@TK2MSF TNGP10.phx.gbl. ..[color=darkred]
          > > > Hi,
          > > >
          > > > In article <OVKkkmRZEHA.22 8@TK2MSFTNGP10. phx.gbl>, no-spam-please@no-
          > > > spam-please.com says...
          > > > > Could someone clear this up for me a bit. I am a little bit[/color][/color][/color]
          uncertain[color=blue][color=green]
          > > about[color=darkred]
          > > > > this but this is my understanding. Please correct where wrong or[/color][/color][/color]
          bits[color=blue][color=green][color=darkred]
          > > > > missing.
          > > > >
          > > > > There are two types of remoting :-
          > > > >
          > > > > Marshal-by-reference
          > > > > Server Activated objects (SAO). Object instanciated on[/color][/color][/color]
          the[color=blue][color=green][color=darkred]
          > > > > server. Default constructor. Creation delayed till first method[/color][/color][/color]
          call.[color=blue][color=green][color=darkred]
          > > > > Lifetime controlled by server
          > > > > has :-
          > > > > SingleCall activation mode. Object created and[/color]
          > > destroyed[color=darkred]
          > > > > with each client request
          > > > > Singleton activation mode. Object created and[/color][/color]
          > shared[color=green][color=darkred]
          > > > > between clients
          > > > > Client Activated objects (CAO). Object instanciated on[/color][/color][/color]
          the[color=blue][color=green][color=darkred]
          > > > > server. Multiple constructors. Creation is not delayed. Lifetime[/color]
          > > controlled[color=darkred]
          > > > > by client
          > > > >
          > > > > Marshal-by-value
          > > > > Can be Client Activated Objects only, and instanciated on[/color][/color][/color]
          the[color=blue][color=green]
          > > client[color=darkred]
          > > > > itself
          > > > >
          > > > >
          > > > > One thing I really dont understand (no real code examples) is how to[/color]
          > > remote[color=darkred]
          > > > > using marshal-by-value. I have read that you need to apply the
          > > > > [Serializable()] attribute to the class in question but is this all[/color][/color]
          > you[color=green]
          > > need[color=darkred]
          > > > > to do?
          > > >
          > > > Yes, thats all you need to do. You can not have MBR and Serializable[/color][/color][/color]
          at[color=blue][color=green][color=darkred]
          > > > the same time, as the system would not know what to do, to pass by ref
          > > > or by val.
          > > >
          > > > Also, you can make your class implement ISerializable, and create your
          > > > own serialization of your class, so it can be MBV as well.
          > > >
          > > > Sunny[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Sunny

            #6
            Re: Remoting

            Thanks Ken,

            Sunny

            In article <ux58p5TZEHA.24 56@TK2MSFTNGP10 .phx.gbl>, ken.kolda@ellie mae-
            nospamplease.co m says...[color=blue]
            > Hey Sunny --
            >
            > I believe it actually is allowed to have an MBR object marked as
            > Serializable. The MBR takes precedence for the purposes of remoting.
            >
            > Ken
            >
            >
            > "Sunny" <sunny@newsgrou ps.nospam> wrote in message
            > news:%23AiQf9RZ EHA.2908@TK2MSF TNGP10.phx.gbl. ..[color=green]
            > > Hi,
            > >
            > > In article <OVKkkmRZEHA.22 8@TK2MSFTNGP10. phx.gbl>, no-spam-please@no-
            > > spam-please.com says...[color=darkred]
            > > > Could someone clear this up for me a bit. I am a little bit uncertain[/color][/color]
            > about[color=green][color=darkred]
            > > > this but this is my understanding. Please correct where wrong or bits
            > > > missing.
            > > >
            > > > There are two types of remoting :-
            > > >
            > > > Marshal-by-reference
            > > > Server Activated objects (SAO). Object instanciated on the
            > > > server. Default constructor. Creation delayed till first method call.
            > > > Lifetime controlled by server
            > > > has :-
            > > > SingleCall activation mode. Object created and[/color][/color]
            > destroyed[color=green][color=darkred]
            > > > with each client request
            > > > Singleton activation mode. Object created and shared
            > > > between clients
            > > > Client Activated objects (CAO). Object instanciated on the
            > > > server. Multiple constructors. Creation is not delayed. Lifetime[/color][/color]
            > controlled[color=green][color=darkred]
            > > > by client
            > > >
            > > > Marshal-by-value
            > > > Can be Client Activated Objects only, and instanciated on the[/color][/color]
            > client[color=green][color=darkred]
            > > > itself
            > > >
            > > >
            > > > One thing I really dont understand (no real code examples) is how to[/color][/color]
            > remote[color=green][color=darkred]
            > > > using marshal-by-value. I have read that you need to apply the
            > > > [Serializable()] attribute to the class in question but is this all you[/color][/color]
            > need[color=green][color=darkred]
            > > > to do?[/color]
            > >
            > > Yes, thats all you need to do. You can not have MBR and Serializable at
            > > the same time, as the system would not know what to do, to pass by ref
            > > or by val.
            > >
            > > Also, you can make your class implement ISerializable, and create your
            > > own serialization of your class, so it can be MBV as well.
            > >
            > > Sunny[/color]
            >
            >
            >[/color]

            Comment

            Working...