"Rick Elbers" <ri*********@ch ello.nl> a écrit dans le message de news:
6a************* *************** ****@4ax.com...
| Sorry to say. Bad advise both on parametrized classes as well as
| on Inheritance.
In your opinion maybe.
| Surely code bloat and absurd design will result.
Well, it never has over the past ten or so years for me.
| Bottom up design is
| famous for bad decisions. Let alone that "commonalit y" isnt even
| exactly defined. Use of the ADT approach is widely considered
| superior, and indeed that starts off with abstract AND related
| "superclass es" or interfaces. Thats far better then relate all kind of
| concrete classes and then refactor into some kind of hierarchie.
Not in my experience.
| There will never be a good framework without good abstract concepts
| definied into abstract classes and/or interfaces.
Correct, but that doesn't mean that you have to design the abstract classes
before the concrete ones.
| >So with generics, you should start by designing separate typed classes
and
| >then, if their behaviour is truly identical, replace them with a generic
| >type.
|
| Absurd. If you understand the parametrization and its forces.
Well, I have had no problems.
| very good generics beginners article Joanna. It has imho not a lot to
| do with the proffesional way of using parametrized classes though. The
| visitor pattern and all its parent double dispatchers is already
| something very obscure and not often used, let alone some absurd
| trivial ValueType class.
You seem to think a lot of things are absurd :-) The ValueType class is a
real world example of a metadata-rich framework for object persistence and
UI presentation of objects.
| Proffesional use of generics will mostly be valuable by people wrting
| framework code to be used by others. They will know and understand
| the use as they will do with inheritance and delegation because they
| have to do design.
Frameworks form a large part of my work, which is why I have found so much
use for generics
| Most people
| seem to use c# as vb, but some are using it like c/c++ and they will
| fully appreciate the generics..
Coming from a C/C++/Delphi background, I can't really say what a VB
programmer thinks of C#. I find it a very nice Cesque version of Delphi;
capable of most things from drag and drop RAD development right through to
complex fully OO model driven frameworks and utilities.
| For really strong examples you probably should look into delegates
| and other observer implementations and in abstract factories instead
| of the OO defeating visitorpattern.
The article was the first in a series of articles on design patterns in C#
using generics; other articles cover things like the Observer pattern and
other patterns.
I find your comment that the Visitor pattern is OO defeating quite odd, as
it is a pattern that allows you to maintain the integrity of a hierarchy
whilst adding common behaviour throughout the hierarchy in a type specific
manner.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer