| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#11
| |||
| |||
| "Larry Smith" <no_spam@_nospam.com> wrote in message news:eZO4O8axHHA.1208@TK2MSFTNGP05.phx.gbl... > Thanks for the clarification (appreciated). As for the rumour, I'm not > sure how they'll tackle that given that there already seem to be some > built-in assumptions based on single-inheritance. They could change this > of course but it might cause a lot of problems. Anyway, thanks again. I'd be surprised if we ever see multiple inheritance in C#... http://blogs.msdn.com/csharpfaq/arch.../07/85562.aspx http://www.google.co.uk/search?hl=en...eritance&meta= -- Mark Rae ASP.NET MVP http://www.markrae.net |
|
#12
| |||
| |||
| > I'd be surprised if we ever see multiple inheritance in C#... > > http://blogs.msdn.com/csharpfaq/arch.../07/85562.aspx > http://www.google.co.uk/search?hl=en...eritance&meta= I'd be surpised as well. It's not likely to take off given that it's already established as single inheritance. Moreover, it's rarely even used in the C++ world. From my own (long) experience in that arena, it makes sense conceptually but in practice it's mechanically very difficult to work with. I doubt significant improvements can be made on this front. |
|
#13
| |||
| |||
| > I'd be surprised if we ever see multiple inheritance in C#... > > http://blogs.msdn.com/csharpfaq/arch.../07/85562.aspx > http://www.google.co.uk/search?hl=en...eritance&meta= I'd be surpised as well. It's not likely to take off given that it's already established as single inheritance. Moreover, it's rarely even used in the C++ world. From my own (long) experience in that arena, it makes sense conceptually but in practice it's mechanically very difficult to work with. I doubt significant improvements can be made on this front. |
|
#14
| |||
| |||
| "Larry Smith" <no_spam@_nospam.com> wrote in message news:%23A5C5UixHHA.3328@TK2MSFTNGP03.phx.gbl... > I'd be surpised as well. It's not likely to take off given that it's > already established as single inheritance. Moreover, it's rarely even used > in the C++ world. From my own (long) experience in that arena, it makes > sense conceptually but in practice it's mechanically very difficult to > work with. I doubt significant improvements can be made on this front. Indeed. I've been using C# since the latter half of 2002 and have never had any need for multiple inheritance... -- Mark Rae ASP.NET MVP http://www.markrae.net |
|
#15
| |||
| |||
| "Larry Smith" <no_spam@_nospam.com> wrote in message news:%23A5C5UixHHA.3328@TK2MSFTNGP03.phx.gbl... > I'd be surpised as well. It's not likely to take off given that it's > already established as single inheritance. Moreover, it's rarely even used > in the C++ world. From my own (long) experience in that arena, it makes > sense conceptually but in practice it's mechanically very difficult to > work with. I doubt significant improvements can be made on this front. Indeed. I've been using C# since the latter half of 2002 and have never had any need for multiple inheritance... -- Mark Rae ASP.NET MVP http://www.markrae.net |
|
#16
| |||
| |||
| (removed microsoft.public.vstudio.extensibility and microsoft.public.dotnet.framework.clr due to lack of relevance and reduction of cross-posting) On Sat, 14 Jul 2007 07:42:37 -0700, Larry Smith <no_spam@_nospam.com> wrote: > I'd be surpised as well. It's not likely to take off given that it's > already > established as single inheritance. Moreover, it's rarely even used in the > C++ world. From my own (long) experience in that arena, it makes sense > conceptually but in practice it's mechanically very difficult to work > with. > I doubt significant improvements can be made on this front. IMHO, C# already does make an improvement over multiple inheritance vs C++. That is, a class can in fact inherit multiple interfaces. This allows for the same basic behavior as multiple inheritance, while forcing the programmer to be explicit about how the class is arranged (ambiguity in behavior of base classes shared by multiply inherited classes being one of the bigger stumbling blocks for multiple inheritance in C++, IMHO). Pete |
|
#17
| |||
| |||
| Am Sat, 14 Jul 2007 16:37:06 +0100 schrieb Mark Rae [MVP]: > > Indeed. I've been using C# since the latter half of 2002 and have never had > any need for multiple inheritance... Hello, how then can you advise me to implement the following: I have derivations from the standard WinForm Controls that implement certain protocols for loading, storing, verification etc. Code example: //----------------------------------------------------------------- // boBindName // [ Bindable (true) , Category ("QFC") , Description ("Feld/Property, an das gebunden werden soll") ] public string boBindName { get { return mBoBindName; } set { mBoBindName = value; } } I have many of those. At the moment, I need to have the exact same code in all of my derived controls. Any change in that code must be manually repeated for all controls - a perfect situation for implementation inheritance with the help of MI. Paule |
|
#18
| |||
| |||
| Am Sat, 14 Jul 2007 16:37:06 +0100 schrieb Mark Rae [MVP]: > > Indeed. I've been using C# since the latter half of 2002 and have never had > any need for multiple inheritance... Hello, how then can you advise me to implement the following: I have derivations from the standard WinForm Controls that implement certain protocols for loading, storing, verification etc. Code example: //----------------------------------------------------------------- // boBindName // [ Bindable (true) , Category ("QFC") , Description ("Feld/Property, an das gebunden werden soll") ] public string boBindName { get { return mBoBindName; } set { mBoBindName = value; } } I have many of those. At the moment, I need to have the exact same code in all of my derived controls. Any change in that code must be manually repeated for all controls - a perfect situation for implementation inheritance with the help of MI. Paule |
|
#19
| |||
| |||
| Am Sat, 14 Jul 2007 09:59:39 -0700 schrieb Peter Duniho: > IMHO, C# already does make an improvement over multiple inheritance vs > C++. That is, a class can in fact inherit multiple interfaces. A class can implement multiple interfaces - roughly the same as in C++ (minor differences ignored). But a class in C# cannot use implementation inheritance, which can be very useful. You have to duplicate the code, use delegation etc. >This > allows for the same basic behavior as multiple inheritance, while forcing > the programmer to be explicit about how the class is arranged (ambiguity > in behavior of base classes shared by multiply inherited classes being one > of the bigger stumbling blocks for multiple inheritance in C++, IMHO). No, disagree. The same ambiguity problems can arise when you implement multiple interfaces in a C#-class. The solution is the same, though: Compiler gives notice, and you have to manually resolve the amiguity, usually by qualifying the name. No problem. Paule |
|
#20
| |||
| |||
| [Please do not mail me a copy of your followup] Paul Werkowitz <newsgroups@primaprogramm.de> spake the secret code <1fd4e049y61vc$.i7k81e3krf13$.dlg@40tude.net> thusly: >Am Sat, 14 Jul 2007 16:37:06 +0100 schrieb Mark Rae [MVP]: > >> >> Indeed. I've been using C# since the latter half of 2002 and have never had >> any need for multiple inheritance... > >Hello, how then can you advise me to implement the following: > >I have derivations from the standard WinForm Controls that implement >certain protocols for loading, storing, verification etc. Code example: > > //----------------------------------------------------------------- > // boBindName > // > [ > Bindable (true) > , Category ("QFC") > , Description ("Feld/Property, an das gebunden werden soll") > ] > public string boBindName > { > get { return mBoBindName; } > set { mBoBindName = value; } > } > >I have many of those. > >At the moment, I need to have the exact same code in all of my derived >controls. Any change in that code must be manually repeated for all >controls - a perfect situation for implementation inheritance with the help >of MI. Personally, I'd question any design that is encouraging you to subclass every .NET WinForms Control. MI is only one way to aggregate behaviors, not the only way. In .NET you can implement multiple interfaces to aggregate multiple behaviors into a single class. In .NET 2 you also have generics, so you can do template type tricks: class BindableControl<T> : T { [Bindable(true)] [Category("QFC")] [Description("...")] public string boBindName { get { return mBoBindName; } set { mBoBindName = value; } } private string mBoBindName; } This eliminates the duplication, but it still is requiring you to subclass every .NET control. I'd consider other design alternatives that wouldn't require you to do this. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/> |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.