Re: VB vs C#
"Jeremy Todd" <jhtodd@uiuc.ed u> wrote in message
news:O5L1eH0IEH A.3528@TK2MSFTN GP09.phx.gbl...[color=blue]
> "Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
> message news:u4cTz9zIEH A.2128@TK2MSFTN GP11.phx.gbl...
>[color=green]
>> Yes, but I'd argue that IMass.Mass and IWeight.Weight, even if they work[/color]
> the[color=green]
>> same in one situation, are entirely different and as a matter of
>> understanding using the same method to implement them isn't going to make
>> code that makes immediate sense. Although I can't think of a physics[/color]
> example[color=green]
>> to qualify it. Once you do that, how do you seperate them again in a[/color]
> derived[color=green]
>> class? You could say I don't like the conceptual muxing of different
>> ideas
>> for convenience.[/color]
>
> Yes, this was discussed at length. :) In the end, we decided the pros
> and cons slightly favored doing it my way, because the class hierarchy was
> determined early on and we knew well in advance how each class would
> behave.
>[color=green]
>> How often are non-public interfaces on public types a good idea? IMHO not
>> very often. ;) You should be designing your architecture so that public
>> types contain mostly publically accessible functionality(o r underlying
>> protected functionality for virtuality). However, that is my personal
>> POV.[/color]
>
> I don't follow. How is the use of non-public interfaces different from
> non-public class members? Are you also opposed to private fields and
> methods? :)
>[/color]
Merely that they are interfaces. Its not so much a necessity as a goal I
strive to reach. I don't like to implement internal interfaces on public
classes, I'd rather rely on managers\factor ies and implement the interfaces
there and write the public classes without interfaces designed for internal
usage.
I also do my best to avoid designs which rely on internal members(I can't
think of the VB keyword for this, but assembly only access). They are a
nessecery evil in many cases, but something I always look for other ways
around. I don't mean that protected methods or private method(which usually
are helpers for public or protected methods) shouldn't exist, just that when
possible an interface should strive to be public and if a class can't expose
all its externally required behaviour publically there is probably a better
design available. However, this is a guideline I try to follow, not a
steadfast rule; I have written more than one internal interface\metho d in my
lifetime.[color=blue]
> Jeremy
>[/color]
"Jeremy Todd" <jhtodd@uiuc.ed u> wrote in message
news:O5L1eH0IEH A.3528@TK2MSFTN GP09.phx.gbl...[color=blue]
> "Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
> message news:u4cTz9zIEH A.2128@TK2MSFTN GP11.phx.gbl...
>[color=green]
>> Yes, but I'd argue that IMass.Mass and IWeight.Weight, even if they work[/color]
> the[color=green]
>> same in one situation, are entirely different and as a matter of
>> understanding using the same method to implement them isn't going to make
>> code that makes immediate sense. Although I can't think of a physics[/color]
> example[color=green]
>> to qualify it. Once you do that, how do you seperate them again in a[/color]
> derived[color=green]
>> class? You could say I don't like the conceptual muxing of different
>> ideas
>> for convenience.[/color]
>
> Yes, this was discussed at length. :) In the end, we decided the pros
> and cons slightly favored doing it my way, because the class hierarchy was
> determined early on and we knew well in advance how each class would
> behave.
>[color=green]
>> How often are non-public interfaces on public types a good idea? IMHO not
>> very often. ;) You should be designing your architecture so that public
>> types contain mostly publically accessible functionality(o r underlying
>> protected functionality for virtuality). However, that is my personal
>> POV.[/color]
>
> I don't follow. How is the use of non-public interfaces different from
> non-public class members? Are you also opposed to private fields and
> methods? :)
>[/color]
Merely that they are interfaces. Its not so much a necessity as a goal I
strive to reach. I don't like to implement internal interfaces on public
classes, I'd rather rely on managers\factor ies and implement the interfaces
there and write the public classes without interfaces designed for internal
usage.
I also do my best to avoid designs which rely on internal members(I can't
think of the VB keyword for this, but assembly only access). They are a
nessecery evil in many cases, but something I always look for other ways
around. I don't mean that protected methods or private method(which usually
are helpers for public or protected methods) shouldn't exist, just that when
possible an interface should strive to be public and if a class can't expose
all its externally required behaviour publically there is probably a better
design available. However, this is a guideline I try to follow, not a
steadfast rule; I have written more than one internal interface\metho d in my
lifetime.[color=blue]
> Jeremy
>[/color]
Comment