Презентация Prefer class hierarchies to tagged classes. (Item 20, 21, 22) онлайн

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



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



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

№1 слайд
Item Prefer class hierarchies
Содержание слайда: Item 20: Prefer class hierarchies to tagged classes

№2 слайд
Tagged class instances come
Содержание слайда: Tagged class – instances come in two or more flavors; contain a tag field indicating the flavor of the instance

№3 слайд
Содержание слайда:

№4 слайд
Tagged classes Bad
Содержание слайда: Tagged classes: Bad readability Spend to much memory (contain fields belonging to other flavors) Fields can’t be final (constructors don’t initialize irrelevant fields) Constructors must set the tag field and initialize the right data fields – compiler can’t control this. Type doesn’t gives a clue to its flavor.

№5 слайд
A tagged class is just
Содержание слайда: A tagged class is just imitation of a class hierarchy

№6 слайд
Содержание слайда:

№7 слайд
Item Use function objects to
Содержание слайда: Item 21: Use function objects to represent strategies

№8 слайд
Function object is An
Содержание слайда: Function object is – An instance of a class that exports exactly one method performing operations on other objects, passed explicitly to the method Example: Comparator

№9 слайд
Concrete strategy Comparator
Содержание слайда: Concrete strategy Comparator is concrete strategy for comparison Typical concrete strategy classes are stateless: has no fields => all instances of the class are functionally equivalent => should be a singleton

№10 слайд
Concrete strategy classes are
Содержание слайда: Concrete strategy classes are often declared as anonymous classes Note that using an anonymous class will create a new instance each time the call is executed

№11 слайд
Item Favor static member
Содержание слайда: Item 22: Favor static member classes over nonstatic

№12 слайд
Nested classes
Содержание слайда: Nested classes

№13 слайд
If you declare a member class
Содержание слайда: If you declare a member class that does not require access to an enclosing instance – always put the static modifier in its declaration Nonstatic static member class has reference to enclosing instance: it costs time and resources; it makes enclosing instance not available for garbage collection.

№14 слайд
Anonymous and local classes
Содержание слайда: Anonymous and local classes should be short – ten a fewer lines

Скачать все slide презентации Prefer class hierarchies to tagged classes. (Item 20, 21, 22) одним архивом: