"Smalltalk’s object-based hierarchy does not work so well".Also c#??


i read book , "thinking in c++".at pg:694( introduction templates) writes:
"the smalltalk solution. smalltalk (and java, following its
example) took simple , straightforward approach: want to
reuse code, use inheritance. implement this, each container
class holds items of generic base class object (similar the
example @ end of chapter 15). because library in
smalltalk of such fundamental importance, don’t ever create
a class scratch. instead, must inherit an
existing class. find class close possible 1 you
want, inherit it, , make few changes. obviously, a
benefit because minimizes effort (and explains why you
spend lot of time learning class library before becoming an
effective smalltalk programmer).
but means classes in smalltalk end being part of a
single inheritance tree. must inherit branch of tree
when creating new class. of tree there (it’s the
smalltalk class library), , @ root of tree class called
object – same class each smalltalk container holds.
this neat trick because means every class in the
smalltalk (and java1) class hierarchy derived object, so
every class can held in every container (including container
itself). type of single-tree hierarchy based on fundamental
generic type (often named object, case in java) is
referred “object-based hierarchy.” may have heard this
term , assumed new fundamental concept in oop,
like polymorphism. refers class hierarchy object
(or similar name) @ root , container classes hold
object.
because smalltalk class library had longer history and
experience behind did c++, , because original c++
compilers had no container class libraries, seemed good
idea duplicate smalltalk library in c++. done an
experiment c++ implementation2, , because it
1 exception, in java, of primitive data types. these made non-
objects efficiency.
2 oops library, keith gorlen while @ nih.
16: introduction templates 695
represented significant body of code, many people began using it.
in process of trying use container classes, discovered
a problem.
the problem in smalltalk (and other oop languages
that know of), classes automatically derived single
hierarchy, isn’t true in c++. might have nice
object-based hierarchy container classes, you
might buy set of shape classes or aircraft classes another
vendor didn’t use hierarchy. (for 1 thing, using that
hierarchy imposes overhead, c programmers eschew.) how
do insert separate class tree container class in your
object-based hierarchy? here’s problem looks like:"

and diagram
and writes:

"because c++ supports multiple independent hierarchies,
smalltalk’s object-based hierarchy not work well."

is true?
i have 2 questions
1-)can same thing for  c#?(i mean: c#’s object-based hierarchy not work well).what c# 's solution?
2-)we know c# very differnet c++.someone , see everyline of code ended ";" says:"c# similiar c++".but not true.
can accept author's expression "showing differences  between c++'s oo fashion , c#'s oo fashion"

what opinions.
i looking answers.

it true. c++ supports multiple inheritance, means derrived class can inherit multiple base classes. therefore, in c++, not restricted single hierarchy. class specialization diagram can end looking web rather tree :-)

c# (like java , smalltalk) supports single inheritance - exact kind of hierarchy author talking here.

c#'s syntax comes c(++), java, simplified (just java) avoid of messy looking syntax , memory management, among other things. c# lot more java language than c++.

however, don't think author talking @ c# here (where's c# reference?). there differences in oo approach between c++ , c#, particularly single inheritance hiearchy of c# vs. multi-inheritance of c++.



Archived Forums V  >  Visual C# Language



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'