Презентация Prefer interfaces to abstract classes. (Item 18, 19) онлайн

На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему Prefer interfaces to abstract classes. (Item 18, 19) абсолютно бесплатно. Урок-презентация на эту тему содержит всего 8 слайдов. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Устройства и комплектующие » Prefer interfaces to abstract classes. (Item 18, 19)



Оцените!
Оцените презентацию от 1 до 5 баллов!
  • Тип файла:
    ppt / pptx (powerpoint)
  • Всего слайдов:
    8 слайдов
  • Для класса:
    1,2,3,4,5,6,7,8,9,10,11
  • Размер файла:
    42.76 kB
  • Просмотров:
    82
  • Скачиваний:
    0
  • Автор:
    неизвестен



Слайды и текст к этой презентации:

№1 слайд
Item Prefer interfaces to
Содержание слайда: Item 18: Prefer interfaces to abstract classes

№2 слайд
Existing classes can be
Содержание слайда: Existing classes can be easily redesigned to implement a new interface Steps to add a new interface for several classes: add an “implements interfaceName” in each class add the required methods for each class What about abstract classes? Two classes should extend the same abstract class –> Place the abstract class high up in the type hierarchy after an ancestor of both classes –> Great damage to the type hierarchy.

№3 слайд
Interfaces are ideal for
Содержание слайда: Interfaces are ideal for defining mixins. Mixins provides some additional behavior (For example Comparable) Class can implement several mixins as interfaces Class can have only one superclass – there is no place in hierarchy for mixins as abstract classes

№4 слайд
Interfaces allow the
Содержание слайда: Interfaces allow the construction of nonhierarchical types interface Singer + interface Songwriter = interface SingerSongwriter extends Singer, Songwriter The alternative is a bloated class hierarchy containing a separate class for every supported combination of attributes (2n possible combinations).

№5 слайд
Interfaces enable safe and
Содержание слайда: Interfaces enable safe and powerful increasing of functionality + Using an interface – enable to use composition - Using an abstract class – no alternative but to use inheritance

№6 слайд
Abstract skeletal
Содержание слайда: Abstract skeletal implementation class Combination: Skeletal implementation = Interface + Abstract class Skeletal implementations are called AbstractInterface (AbstractCollection, AbstractSet, AbstractList, AbstractMap) Simulated multiple inheritance Simple implementation

№7 слайд
Advantage of abstract classes
Содержание слайда: Advantage of abstract classes: It is far easier to evolve an abstract class than an interface + All existing implementations of the abstract class will then provide the new method - Once an interface is released and implemented, it is almost impossible to change

№8 слайд
Item Use interfaces only to
Содержание слайда: Item 19: Use interfaces only to define types Don’t use constant interfaces, it’s antipattern. Use utility classes for constants and static import. Constant interfaces in the Java platform libraries, such as java.io.ObjectStreamConstants - should be regarded as anomalies

Скачать все slide презентации Prefer interfaces to abstract classes. (Item 18, 19) одним архивом: