07.06.2013 Views

Classi astratte ed interfacce - Dipartimento di Ingegneria Informatica ...

Classi astratte ed interfacce - Dipartimento di Ingegneria Informatica ...

Classi astratte ed interfacce - Dipartimento di Ingegneria Informatica ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A. Longheu – Linguaggi M-Z – Ing. Inf. 2009-2010<br />

<strong>Classi</strong> <strong>ed</strong> Interfacce innestate<br />

Un possibile membro <strong>di</strong> classi e <strong>di</strong> <strong>interfacce</strong><br />

potrebbe essere un’altra classe o interfaccia; in tal<br />

caso essi sono definiti innestati<br />

L’innesto è ortogonale rispetto all’er<strong>ed</strong>itarietà; un<br />

membro innestato è in<strong>di</strong>pendente dalla classe o<br />

interfaccia entro cui si trova; viene er<strong>ed</strong>itato in<br />

caso la classe/interfaccia contenitrice venga estesa<br />

L’innesto solitamente viene effettuato per<br />

connettere in modo semplice <strong>ed</strong> efficace oggetti<br />

correlati logicamente, caratteristica utilizzata<br />

ampiamente dal sistema AWT<br />

è ammesso l’innesto in profon<strong>di</strong>tà, ma se ne<br />

sconsiglia l’uso<br />

34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!