Re: C# 3.0 partial methods and automatic properties

Mattias Sj?gren <[email protected]> Fri, 10 Nov 2006 23:27:45 +0100
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <[email protected]>
Fabian,

>Unfortunately, I missed the whiteboard discussion where AH seems to
>have defined what these actually are - can anybody on this list shed
>some light on this new feature? Is it finally possible to implement
>the same method in different parts of a partial class, having these
>implementations being merged into one? Or is it something different?

It's been a while since I looked at it. But the way I understand the
feature, it's a way for code generators to add hooks into the generated
code that you as a developer can chose to implement if you need.    The
generated code declares a method signature and can then make calls against
it. Either you provide an implementation in another part of the class, or
the calls do nothing.

Normally you'd have to use a virtual method and inheritance to accomplish
this, but that doesn't work for static methods and sealed classes. You can
see it as a way to implement the template method pattern without inheritance.


Mattias

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

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