Презентация The Basics of Object Lifetime. Disposing objects (Java) онлайн

На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему The Basics of Object Lifetime. Disposing objects (Java) абсолютно бесплатно. Урок-презентация на эту тему содержит всего 20 слайдов. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Устройства и комплектующие » The Basics of Object Lifetime. Disposing objects (Java)



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



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

№1 слайд
The Basics of Object
Содержание слайда: The Basics of Object Lifetime. Disposing objects.

№2 слайд
AGENDA The Basics of Object
Содержание слайда: AGENDA The Basics of Object Lifetime Building Finalizable Objects Building Disposable Objects Dispose pattern

№3 слайд
The Basics of Object Lifetime
Содержание слайда: The Basics of Object Lifetime

№4 слайд
The Basics of Object Lifetime
Содержание слайда: The Basics of Object Lifetime

№5 слайд
The Role of Application Roots
Содержание слайда: The Role of Application Roots Root is a storage location containing a reference to an object on the managed heap: • References to global objects • References to any static objects/static fields • References to local objects within an application’s code base • References to object parameters passed into a method • References to objects waiting to be finalized • Any CPU register that references an object

№6 слайд
Object Generations Each
Содержание слайда: Object Generations Each object on the heap belongs to one of the following generations: • Generation 0: Identifies a newly allocated object that has never been marked for collection. • Generation 1: Identifies an object that has survived a garbage collection (i.e., it was marked for collection but was not removed due to the fact that the sufficient heap space was acquired). • Generation 2: Identifies an object that has survived more than one sweep of the garbage collector.

№7 слайд
Building Finalizable Objects
Содержание слайда: Building Finalizable Objects  Rule The reason to override Finalize() is if your C# class is making use of unmanaged resources via PInvoke or complex COM interoperability tasks. The reason is that you are manipulating memory that the CLR cannot manage.

№8 слайд
Building Finalizable Objects
Содержание слайда: Building Finalizable Objects You can’t override the Finalize() method directly in your class, but you may use of a destructor syntax to achieve the same effect. Destructor never takes an access modifier (implicitly protected), never takes parameters, and can’t be overloaded (only one finalizer per class).

№9 слайд
Building Disposable Objects
Содержание слайда: Building Disposable Objects

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

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

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

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

№14 слайд
Dispose pattern The Dispose
Содержание слайда: Dispose pattern The Dispose Pattern is intended to standardize the usage and implementation of finalizers and the IDisposable interface. √ DO implement the Basic Dispose Pattern on types containing instances of disposable types. √ DO implement the Basic Dispose Pattern and provide a finalizer on types holding resources that need to be freed explicitly and that do not have finalizers. √ CONSIDER implementing the Basic Dispose Pattern on classes that themselves don’t hold unmanaged resources or disposable objects but are likely to have subtypes that do.

№15 слайд
Dispose pattern Involves
Содержание слайда: Dispose pattern Involves implementing the System.IDisposable interface Declare the Dispose(bool) method that implements all resource cleanup logic to be shared between the Dispose method and the optional finalizer.

№16 слайд
Dispose pattern DO NOT make
Содержание слайда: Dispose pattern DO NOT make the parameterless Dispose method virtual. The Dispose(bool) method is the one that should be overridden by subclasses.

№17 слайд
Dispose pattern DO allow the
Содержание слайда: Dispose pattern √ DO allow the Dispose(bool) method to be called more than once. The method might choose to do nothing after the first call.

№18 слайд
Dispose pattern DO throw an
Содержание слайда: Dispose pattern √ DO throw an ObjectDisposedException from any member that cannot be used after the object has been disposed of.

№19 слайд
Dispose pattern CONSIDER
Содержание слайда: Dispose pattern √ CONSIDER providing method Close(), in addition to the Dispose(), if close is standard terminology in the area.

№20 слайд
Questions ?
Содержание слайда: Questions ?

Скачать все slide презентации The Basics of Object Lifetime. Disposing objects (Java) одним архивом: