> On 10/18/06, Manoj Aggarwal <[EMAIL PROTECTED]> wrote:
> > Can you please explain why is it so...
> > Also It will be helpful if u can explain what is "datarow with
> > parameterless constructor", an example will help me a long way
>
> The .net framework must be able to construct a class from it
> serialized form.
> In other words the class must be deserializable.
> Therefor it mandate the class to have a parameterless constructor.
>
> class Foo
> {
> public Foo() { /* do something neat */ } }
>
> class Bar
> {
> public Bar(int value) { /* do something neat */ } }
>
> class Bar doesnt have a parameterless ctor, it wants an int.
> The .net framework cannot simple know what value it should
> pass, therefor it can deserialize class Foo but not class Bar.

        sure it can, though the XmlSerializer can't (at least in .net 1.x). The 
remoting formatters can. I have classes marked with
[Serializable] and with solely parameter using constructors. And they serialize 
fine (without ISerializable requirements).

        As the TS talked about webservices, I think it's good to distinguish 
remoting serialization and xml serialization as these
are not related :)

                FB

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

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

Reply via email to