![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Abstract class as ServiceContract Is there any way to use a pure abstract class rather than an interface as a ServiceContract? I get runtime errors when I do so, but I'm not really understanding the difference since in either case I am only defining the abstract methods I want to expose as OperationContract elements. |
| | #2 (permalink) |
| Guest | Re: Abstract class as ServiceContract From MSDN a.. An abstract class is permitted (but not required) to contain abstract members. As you can see " (but not required)" make the difference Arkady "DCBass" <DCBass@discussions.microsoft.com> wrote in message news:9BE6C1F4-2E93-47A5-80AB-F496D1AF88BA@microsoft.com... > Is there any way to use a pure abstract class rather than an interface as > a > ServiceContract? I get runtime errors when I do so, but I'm not really > understanding the difference since in either case I am only defining the > abstract methods I want to expose as OperationContract elements. |
| | #3 (permalink) |
| Guest | Re: Abstract class as ServiceContract I realize what an abstract class is, but I don't understand why that actually makes a difference since in either case you are defining the interface (method signatures, etc) of that class. I'm talking about a "pure" abstract class where there is no implementation. This is a C++ concept but applies to C# as well (see http://en.wikibooks.org/wiki/Program...tract_Classes). If the purpose of a ServiceContract is to define the interface to the WCF service, why does it matter if it is specified in an abstract class or an interface? It seems that it should really only matter that the OperationContract attribute is only applied to abstract methods (whether they are defined in an interface or an abstract class). Is there any way to use an abstract class as a ServiceContract? If not, what is the reasoning behind limiting this attribute to interfaces? "Arkady Frenkel" wrote: > From MSDN > a.. An abstract class is permitted (but not required) to contain abstract > members. > > As you can see " (but not required)" make the difference > > Arkady > > "DCBass" <DCBass@discussions.microsoft.com> wrote in message > news:9BE6C1F4-2E93-47A5-80AB-F496D1AF88BA@microsoft.com... > > Is there any way to use a pure abstract class rather than an interface as > > a > > ServiceContract? I get runtime errors when I do so, but I'm not really > > understanding the difference since in either case I am only defining the > > abstract methods I want to expose as OperationContract elements. > > > |
| | #4 (permalink) |
| Guest | Re: Abstract class as ServiceContract Pure abstruct class of C++ is interface in C#. Abstruct class in C# can in moment be changed to not so pure ( when you add the code ), that's why interface demanded Arkady "DCBass" <DCBass@discussions.microsoft.com> wrote in message news:C5901068-F2B5-45E1-A8C3-86EE2610BFEE@microsoft.com... >I realize what an abstract class is, but I don't understand why that >actually > makes a difference since in either case you are defining the interface > (method signatures, etc) of that class. I'm talking about a "pure" > abstract > class where there is no implementation. This is a C++ concept but applies > to > C# as well (see > http://en.wikibooks.org/wiki/Program...tract_Classes). > > If the purpose of a ServiceContract is to define the interface to the WCF > service, why does it matter if it is specified in an abstract class or an > interface? It seems that it should really only matter that the > OperationContract attribute is only applied to abstract methods (whether > they > are defined in an interface or an abstract class). > > Is there any way to use an abstract class as a ServiceContract? If not, > what is the reasoning behind limiting this attribute to interfaces? > > "Arkady Frenkel" wrote: > >> From MSDN >> a.. An abstract class is permitted (but not required) to contain abstract >> members. >> >> As you can see " (but not required)" make the difference >> >> Arkady >> >> "DCBass" <DCBass@discussions.microsoft.com> wrote in message >> news:9BE6C1F4-2E93-47A5-80AB-F496D1AF88BA@microsoft.com... >> > Is there any way to use a pure abstract class rather than an interface >> > as >> > a >> > ServiceContract? I get runtime errors when I do so, but I'm not really >> > understanding the difference since in either case I am only defining >> > the >> > abstract methods I want to expose as OperationContract elements. >> >> >> |
| |
| |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Class not Registered | eldonstuhr | Vista music pictures video | 3 | 05-30-2007 10:45 PM |
| PowerShell Class | Hayato Iriumi | PowerShell | 4 | 11-02-2006 11:18 PM |
| Having a window extend an abstract class | Jason Dolinger | Avalon | 1 | 01-31-2006 07:00 AM |