Content here is by:
Michael Still
mikal@stillhq.com
All my Open Source projects
Extracted view of CVS
Home Site map
|
See recent comments. RSS feed of all comments.
ImageMagick book
MythTV book
|
 |
|
 |
|
| RE: [aus-dotnet] .NET 2.0 Hidden Gems |
|
Title: RE: [aus-dotnet] .NET 2.0 Hidden Gems
You can't always control your base class (ie System.Windows.Forms.Control),
so abstract classes are out, however as you can typically use interfaces in this
situation, my personal view is that there is not a lot of benefit (that I
can see) in having compile time static checking over using
interfaces with generics.
-----Original Message----- From:
dotnet-owner@xxxxxxxxxxx on behalf of mcasiou@xxxxxxxxxx
Sent: Thu 10/03/2005 4:25 PM To: dotnet@xxxxxxxxxxx
Cc: Subject: RE: [aus-dotnet] .NET 2.0 Hidden
Gems
What's the rationale behind NOT using abstract classes or
interfaces.
Is it that you don't want to share any code between the
implementations?
Cheers Minas Casiou Information Systems
Architect, Senior Consultant
CSC Australia Enterprise Business
Solutions Financial Services 26 Talavera Road Macquarie Park
NSW 2113 Australia Ph: (02) 9034 3338 Mob: 0412 343 069 email:
mcasiou@xxxxxxxxxx
----------------------------------------------------------------------------------------
This
is a PRIVATE message. If you are not the intended recipient, please delete
without copying and kindly advise us by e-mail of the mistake in delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose. ----------------------------------------------------------------------------------------
|---------+---------------------------> |
| "David
Kean" | |
|
<David.Kean@auss| |
|
oft.com>
| |
| Sent
by:
| |
|
dotnet-owner@sta| |
|
nski.com
| |
|
| |
|
| |
| 10/03/2005
04:21| |
|
PM
| |
| Please
respond | |
| to
dotnet
| |
|
| |---------+--------------------------->
>-------------------------------------------------------------------------------------------------------------------------------|
|
| |
To:
<dotnet@xxxxxxxxxxx>
| |
cc:
| | Subject: RE:
[aus-dotnet] .NET 2.0 Hidden
Gems
|
>-------------------------------------------------------------------------------------------------------------------------------|
Yea
but the point was to to be able to do this without using abstract classes
or interfaces, which is not currently possible with C# V1 or
V2
-----Original Message----- From: dotnet-owner@xxxxxxxxxxx [mailto:dotnet-owner@xxxxxxxxxxx]
On Behalf Of mcasiou@xxxxxxxxxx Sent: Thursday, 10 March 2005 3:34
PM To: dotnet@xxxxxxxxxxx Subject: RE: [aus-dotnet] .NET 2.0 Hidden
Gems
Not sure if I've missed the point, but can't
you use an abstract base class to achieve this? i.e.
Define a base
class Class MustInherit MyAbstractBase
Public MustOverride Function MyMustOverrideMethod() As String... End Class
... yeah, I just had to write it in VB...
Then, derived classes must
implement this method if they derive from it... Class
MyDerived Public Overrides Function
MyMustOverrideMethod() As
String
'do stuffs... end function End
Class
Do you mean you don't want to share any code between the
implementations etc.?
Cheers Minas Casiou Information Systems
Architect, Senior Consultant
CSC Australia Enterprise Business
Solutions Financial Services 26 Talavera Road Macquarie Park
NSW 2113 Australia Ph: (02) 9034 3338 Mob: 0412 343 069 email:
mcasiou@xxxxxxxxxx
------------------------------------------------------------------------ ----------------
This
is a PRIVATE message. If you are not the intended recipient, please delete
without copying and kindly advise us by e-mail of the mistake in delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose. ------------------------------------------------------------------------ ----------------
|---------+---------------------------> |
| "David
Kean" | |
|
<David.Kean@auss| |
|
oft.com>
| |
| Sent
by:
| |
|
dotnet-owner@sta| |
|
nski.com
| |
|
| |
|
| |
| 10/03/2005
11:56| |
|
AM
| |
| Please
respond | |
| to
dotnet
| |
|
| |---------+--------------------------->
>----------------------------------------------------------------------- --------------------------------------------------------|
| | |
To: <dotnet@xxxxxxxxxxx> |
| cc: |
| Subject: RE: [aus-dotnet] .NET 2.0
Hidden
Gems |
>----------------------------------------------------------------------- --------------------------------------------------------|
I
think he means that you don't need to implement an interface to get compile
time static checking, ie:
If you have the following
method:
public static void CompileTimeChecking<T>(T
obj) {
obj.ThisMethodMustExistAtCompileTime(); }
And the following
classes:
public class MyClass { public void
ThisMethodMustExistAtCompileTime() { } }
public
class MyOtherClass { public void
ThisMethodMustExistAtCompileTime() { } }
If C#
had static compile time checking, then you could do the
following:
CompileTimeChecking<MyClass>(new
MyClass());
and
CompileTimeChecking<MyOtherClass>(new
MyOtherClass());
without needing
interfaces... -----Original
Message----- From: dotnet-owner@xxxxxxxxxxx
[mailto:dotnet-owner@xxxxxxxxxxx] On
Behalf Of Peter Gummer Sent: Thursday, 10
March 2005 11:49 AM To:
dotnet@xxxxxxxxxxx Subject: RE: [aus-dotnet]
.NET 2.0 Hidden Gems
-----Original Message----- From:
matt_trentini@xxxxxxxxxxx [mailto:matt_trentini@xxxxxxxxxxx]
> And the STL is more elegant than any equivalent I've
seen. Coding > against interfaces is a
poor second cousin to compile-time static
> checking IMHO.
Although I'm no
great fan of interfaces (I much prefer
multiple inheritance and generics), I don't
understand why you accuse them of not
being compile-time statically
checked.
Are you thinking of
horrible 1990s-style COM late binding and
(shudder) IDispatch?
- Peter
Gummer
Attention: The information contained in this message and
or attachments is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of, or taking of any
action in reliance upon, this information by persons or entities other than
the intended recipient is prohibited. Any views expressed in this message
are those of the individual sender and may not necessarily reflect the
views of AusSoft Solutions Pty Ltd. If you received this in error, please
inform us by email at postmaster@xxxxxxxxxxx and delete the material from
any system.
--- [This E-mail scanned for
viruses by Declude]
_________________ You are a part of the
Australian "dotnet" mailing list. To unsubscribe send "unsubscribe dotnet"
or to re-subscribe send "subscribe dotnet Your Name" in the body of the
email to: imailsrv@xxxxxxxxxxx List managed by: http://www.stanski.com #####################################################################################
Attention: The
information contained in this message and or attachments is intended only
for the person or entity to which it is addressed and may
contain confidential and/or privileged material. Any review,
retransmission, dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other than the
intended recipient is prohibited. Any views expressed in this message are
those of the individual sender and may not necessarily reflect the views
of AusSoft Solutions Pty Ltd. If you received this in error, please
inform us by email at postmaster@xxxxxxxxxxx and delete the material
from any
system. #####################################################################################
--- [This
E-mail scanned for viruses by Declude]
_________________ You are a
part of the Australian "dotnet" mailing list. To unsubscribe send
"unsubscribe dotnet" or to re-subscribe send "subscribe dotnet Your Name"
in the body of the email to: imailsrv@xxxxxxxxxxx List managed by: http://www.stanski.com
--- [This
E-mail scanned for viruses by Declude]
_________________ You are a
part of the Australian "dotnet" mailing list. To unsubscribe send
"unsubscribe dotnet" or to re-subscribe send "subscribe dotnet Your Name" in
the body of the email to: imailsrv@xxxxxxxxxxx List managed by: http://www.stanski.com
Attention: The information contained in this message and or
attachments is intended only for the person or entity to which it is addressed
and may contain confidential and/or privileged material. Any review,
retransmission, dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other than the intended
recipient is prohibited. Any views expressed in this message are those of the
individual sender and may not necessarily reflect the views of AusSoft Solutions
Pty Ltd. If you received this in error, please inform us by email at postmaster@xxxxxxxxxxx and delete the
material from any system.
|
( Click here for more information on the aus-dotnet mailling list)
|
|
|
|
|
|
|
|