I'm not sure that's true--Serialize() and Deserialize() *both* show up in both interfaces. So your comment earlier about explicit implementation for Deserialize (since the return values are different) *and* Brad's comment about providing a single Serialize() method (since the signatures are identical) are both valid.
FWIW, the Deserialize() case is the poster child for Explicit Interface Method Definition (EIMD), as it's called in the C# Spec. There's not much else that's as clear-cut when to use this feature. Ted Neward Author, Presenter, Consultant Java, .NET, XML services http://blogs.tedneward.com > -----Original Message----- > From: Discussion of advanced .NET topics. [mailto:ADVANCED- > [EMAIL PROTECTED] On Behalf Of J. Merrill > Sent: Thursday, November 17, 2005 7:18 PM > To: [email protected] > Subject: Re: [ADVANCED-DOTNET] Interface name collision in C# > > At 05:44 PM 11/17/2005, Brad Wilson wrote (in part) > >On 11/17/05, Jekke Bladt <[EMAIL PROTECTED]> wrote: (in part) > >> If it is possible, can I use different functions to implement > >> IGroupOneSetting.Deserialize and IRemoteDataPayload.Deserialize? What > is > >> the proper syntax for doing so in C#? > > > >You can choose to do this with explicit implementation: > > > >XmlNode IGroupOneSetting.Serialize() { ... } > > > >XmlNode IRemoteDataPayload.Serialize() { ... } > > > >Explicitly implemented methods are not part of the public signature of an > >object, so in this case, you would not be able to call .Serialize() on an > >object that implements both interfaces, without first casting to one > >interface or the other. > > Clarification -- unless I'm mistaken, Brad intended to write "Deserialize" > in each place where he wrote "Serialize" in the above text. > > J. Merrill / Analytical Software Corp > > =================================== > This list is hosted by DevelopMentor. http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
