comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: fyi, very interesting Ada paper OOP vs. Readability
Date: Wed, 23 May 2012 20:39:45 +0200
Date: 2012-05-23T20:39:45+02:00	[thread overview]
Message-ID: <qfkyz1st690s$.1d2dvxrgwbxi8.dlg@40tude.net> (raw)
In-Reply-To: jpj7cd$iqa$1@speranza.aioe.org

On Wed, 23 May 2012 17:39:25 +0000 (UTC), NatarovVI wrote:

>>> do you really need other relations?
>> Sure. The relationships should:
>> 1. reflect relevant relationships of the entities from domain space
>> which values of these types model.
> 
> maybe data relations will be better represented in relational db
> or just some datastructure like graph?

That has nothing to do with types. Data relations are ones between
individual instances = between *values*. All RDB relations are values of
just one type. (There was C. Date's "third manifesto" to change that, but
so far not much happen)

Relations between types is a very different thing. Compare:

1. 5 and -5 are in relation as a value and its additive inverse.

2. N (integers) and R (reals) are related numeric types, latter is a
continuation of the former. R is a field = implements the interface of a
field. N is a ring etc.

> program structure can always be builded flat and modular.

No, that would be unmaintainable with the programs sizes common today and
technically impossible too, due to lack of even minimal reuse.

>> 2. serve purpose of software design per types decomposition, e.g. reuse,
>> readability, maintainability etc.
> 
> yep. small number of dependencies == good reuse, readability, 
> maintainability.

Reuse is impossible without substitutability. Substitutability
automatically means that the corresponding types are related =
substitutable.

>>> type is builded from set's.
>> Certainly not. Which type is {-3, 'a', Pi, Employee}? A type cannot be
>> inferred from its values domain set. It need not to be. This is what
>> gives so much power to this abstraction. You can model galaxies on a PC
>> because of that.
> 
> type = set of values for type plus set of operations on type

q.e.d.
 
>>> directly. parent, changing youself, can do any changes on child
>>> functions.
>> No. In a strongly typed language there is no way to have this scenario.
>> It is a type error.
> 
> all OOP is "technology of patches", dedicated to one-way
> developing. grow and grow. only from parents to childs, no other way.
> no return to correct errors. only completely rewrite...

I don't see any relevance.

>>> child incapsulation broken, because it contains parts defined
>>> elsewhere.
>> This is called modular design. In any case it is fully applied to
>> containment/aggregation. When you put an integer into a record, that
>> brings with it integer arithmetic defined elsewhere. I find it good.
> 
> hehehe...
> such architecture is not "modularity". it's "student modularity".
> 
> modularity is about independently developed replaceable parts of system,
> not about _internal structure_ of this parts.

So, integer components are not modular? What is your point?

> how do you think, why all OOP gurus now recommends limit use of 
> inheritance to one-level inheritance from abstract base classes.

They must be eating or smoking something...

I don't care much about OOA/D literature. 90% of it is just garbage, in my
humble opinion of course.

>> Note also there is no way to override operations inherited for integer
>> components, because their type is sealed. On the contrary, inheritance
>> allows some operations re-implemented.
> 
> how do you think, what is safer:
> 1) provide access to all, then let dumb programmer deny access to some 
> parts by sealing, "protected", etc. let state what parts are changed or 
> replaced. formulate system as "old base plus patches".
> 2) from begin provide only needed access and only real current 
> functionality. fearlessly drop old unused parts to archive completely
> and formulate only "current base".
> so?

I don't see how this question proves your point, which was, I quote: 

"child incapsulation broken, because it contains parts defined elsewhere."

Operations of an integer component are defined *elsewhere*. So, why a thing
from "elsewhere" is good when composed and bad when inherited?

>>> types represents categories of expressions.
>> Egh, which category of what expression Boolean is?
> 
> forgive me my country Humpty-Dumptyness of terminology))
> maybe you do not attack my each word, sir?))

In order to understand the point, yes. There is nothing wrong with any
terminology when explained. But we seem agreed that type is a set of values
+ operations.

>>> yep. data exist independently, and we attach types to it at any time.
>>> and make propositions and state invariants from that moment.
>> No, that is no data. Data is a definite state which means something for
>> the agent consuming them. Without a type, there is no meaning and no
>> data.
> 
> ...maybe you just confirm that data is not always typed and _can_ exist 
> without types?

Data are *always* typed. This is why there is no data without a type. It is
meaningless to talk about a value without any operations defined. Because
without them you cannot operate it. You cannot copy it, you cannot compare
it, you cannot tell if it the same value, you cannot do anything.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-05-23 18:39 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 13:06 fyi, very interesting Ada paper OOP vs. Readability Nasser M. Abbasi
2012-05-09 13:19 ` Nasser M. Abbasi
2012-05-09 13:36   ` Dmitry A. Kazakov
2012-05-09 13:39     ` Patrick
2012-05-09 13:55       ` Egil Høvik
2012-05-10  2:33 ` Randy Brukardt
2012-05-10  6:33   ` Simon Wright
2012-05-12  0:37     ` Randy Brukardt
2012-05-30  2:09       ` BrianG
2012-05-30  7:29         ` Niklas Holsti
2012-05-30  7:54           ` Yannick Duchêne (Hibou57)
2012-05-30  7:59             ` Dmitry A. Kazakov
2012-05-30 12:45               ` stefan-lucks
2012-05-30 13:12                 ` Dmitry A. Kazakov
2012-05-30 19:11           ` Jeffrey Carter
2012-05-30 23:00           ` BrianG
2012-06-21 16:06             ` Randy Brukardt
2012-05-10  8:43   ` Maciej Sobczak
2012-05-15  6:16     ` Simon Wright
2012-05-10 11:46   ` Dmitry A. Kazakov
2012-05-10 14:23     ` Georg Bauhaus
2012-05-10 14:47       ` Nasser M. Abbasi
2012-05-10 15:11         ` Adam Beneschan
2012-05-10 16:06         ` Georg Bauhaus
2012-05-10 18:41           ` Niklas Holsti
2012-05-11  8:20             ` Georg Bauhaus
2012-05-10 20:11           ` Nasser M. Abbasi
2012-05-10 21:17             ` tmoran
2012-05-10 18:07         ` Jeffrey Carter
2012-05-11  7:32         ` Maciej Sobczak
2012-05-10 12:31 ` J-P. Rosen
2012-05-10 13:32 ` Yannick Duchêne (Hibou57)
2012-05-10 13:38   ` Nasser M. Abbasi
2012-05-10 23:42     ` Zhu Qun-Ying
2012-05-11  6:05   ` J-P. Rosen
2012-05-11  3:01 ` NatarovVI
2012-05-11  7:14   ` Dmitry A. Kazakov
2012-05-11  7:32     ` Nasser M. Abbasi
2012-05-11  7:58       ` Dmitry A. Kazakov
2012-05-13  3:11         ` NatarovVI
2012-05-13 10:03           ` Georg Bauhaus
2012-05-16 15:00             ` NatarovVI
2012-05-16 18:01               ` Georg Bauhaus
2012-05-21 16:35                 ` NatarovVI
2012-05-21 17:56                   ` Georg Bauhaus
2012-05-23 16:01                     ` NatarovVI
2012-05-23 16:12                       ` NatarovVI
2012-05-16 15:31     ` NatarovVI
2012-05-16 16:40       ` Dmitry A. Kazakov
2012-05-21 17:23         ` NatarovVI
2012-05-21 18:53           ` Dmitry A. Kazakov
2012-05-21 19:21             ` Nasser M. Abbasi
2012-05-23 17:59               ` NatarovVI
2012-05-23 18:45                 ` Dmitry A. Kazakov
2012-05-23 17:39             ` NatarovVI
2012-05-23 18:39               ` Dmitry A. Kazakov [this message]
2012-05-11  3:09 ` NatarovVI
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox