From: Arved Sandstrom on
markspace wrote:
> Arved Sandstrom wrote:
>
>> IOW, inheritance (all sorts: implementation and public, concrete base
>> classes and abstract base classes) may get used a fair bit in the
>> _implementation_ of an application or a library, but that doesn't mean
>> that it gets used a lot across API boundaries.
>
>
> This may also depend on the style of the application and the API. For
> example, I'd expect a lot more inheritance in a Swing application than
> what you observed in your J2EE app.

You're right. I can only comment on J2EE applications and applications
without GUIs, since I haven't written a Swing application for over five
years. But I do recall doing a fair bit of sub-classing. OTOH, Swing and
suchlike probably represent the most common use of lots of inheritance,
in the sense of subclassing a provided API.

AHS
From: Arved Sandstrom on
Mike Schilling wrote:
> markspace wrote:
>> Arved Sandstrom wrote:
>>
>>> IOW, inheritance (all sorts: implementation and public, concrete
>>> base
>>> classes and abstract base classes) may get used a fair bit in the
>>> _implementation_ of an application or a library, but that doesn't
>>> mean that it gets used a lot across API boundaries.
>>
>> This may also depend on the style of the application and the API.
>> For
>> example, I'd expect a lot more inheritance in a Swing application
>> than
>> what you observed in your J2EE app.
>
> Inheritance gets used a lot for callbacks, which are quite common in
> Swing and other event-driven programs. That is, there's usuually an
> interface that defines the callback with a standard implementation
> that that provides default behaviiors, and almost all user
> implementors subclass it. In J2EE, for instance, all servlet classes
> are subclasses of HttpServlet, so that they can be called when
> requests arive. (In this case, there isn't even an interface.)

Right, and I mentioned HttpServlet. :-) Although in the J2EE app I
called out as an example, indeed in almost every J2EE app I've helped
write recently, servlets don't figure prominently in our code. The app I
mentioned has precisely one servlet: FacesServlet, and we didn't write
it; we have zero JSPs. Another J2EE application I helped write recently,
of moderate size, has two servlets only - both related to PDF forms
handling.

AHS
From: Alessio Stalla on
On Oct 12, 3:55 pm, Rzeźnik <marcin.rzezni...(a)gmail.com> wrote:

> This is nice, powerful construct. Are you aware of any language that
> uses composition is this way?

No, I'm not aware of any language supporting this construct. However,
I don't really know any languages outside the "C-like" OO camp (C++/
Java/C#), with the exception of Common Lisp and a tiny bit of Prolog.
From: Tom Anderson on
On Mon, 12 Oct 2009, markspace wrote:

> Tom Anderson wrote:
>
>> I suspected this, but am disappointed. I would love 'ominous' to become a
>> technical software engineering term.
>>
>> public final void append(ominous String s) ...
>
> No no no... sheesh.
>
> Use annotations:
>
> @Ominous
> public final void append( String s ) ...

Is that Coin thing still open for proposals?

tom

--
skin thinking
From: Tom Anderson on
On Mon, 12 Oct 2009, Andreas Leitgeb wrote:

> Lew <lew(a)lewscanon.com> wrote:
>> If you declare a class 'final', then it is obviously known that it
>> will not be subclassed. [...]
>> No prediction needed - it is a dictatorship.
>
> The prediction is what a developer may do for user's wishes.
>
> The Lew-designer would design streets like trails - only at switches
> is it even possible to change direction. Every possible future need for
> direction-changes has to be *predicted* at trail-build time, or the
> trail cars just will not (dictatorship-enforced) be able to turn
> right, later, where the trail passes by his own house.
>
> The Rze?nik-designer designs streets as they are, at the risk of each
> car to slip off the road, maybe even fall down the bridge, at the
> car-driver's freedom and full responsibility.
>
> And in Lew's view, Rze?nik probably would design trails like streets,
> and let the trains go any direction never meant for them to go...

For future reference, Schienen in english are 'rails' rather than
'trails'. As in 'Ruby on Rails'.

Trails means badly-defined paths that go to obscure places and are
difficult to follow. As in 'The Java Tutorials [...] are organized into
"trails"'.

tom

--
skin thinking