construction and cloning kirk scott. adonis from wikipedia, the free encyclopedia jump to:...

18
Construction and Cloning Kirk Scott

Upload: pearl-roberts

Post on 04-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

Construction and Cloning

Kirk Scott

Page 2: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• Adonis• From Wikipedia, the free encyclopedia• Jump to: navigation, search • For the Syrian poet, see Adunis.• For other uses, see Adonis (disambiguation).

Page 3: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• Adonis, in Greek mythology, is the god of beauty and desire, and is a central figure in various mystery religions. His religion belonged to women: the dying of Adonis was fully developed in the circle of young girls around the poet Sappho from the island of Lesbos, about 600 BC, as revealed in a fragment of Sappho's surviving poetry.[1]

Page 4: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• Adonis is one of the most complex figures in classical times. He has had multiple roles, and there has been much scholarship over the centuries concerning his meaning and purpose in Greek religious beliefs. He is an annually-renewed, ever-youthful vegetation god, a life-death-rebirth deity whose nature is tied to the calendar. His name is often applied in modern times to handsome youths, of whom he is the archetype. Adonis is often referred to as the mortal god of Beauty.

Page 5: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see
Page 6: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• Kylix (6th century BC) depicting Dionysus among the sailors transformed to dolphins after attempting to kidnap him

Page 7: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see
Page 8: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• This is an introductory unit.• These are the units/chapters belonging to this

section of the course:• Unit 3, Singleton, book chapter 8.• Unit 4, Prototype, book chapter 18.• Unit 5, Builder, book chapter 15.• Unit 6, Proxy, book chapter 11.

Page 9: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• What will be given next is an extremely brief overview of these topics.

• The idea is to show that according to the organizational scheme for the course, they can be treated as belonging together, even though the book’s organizational scheme put them into chapters that were separated from each other.

Page 10: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

Singleton

• Book definition:• The intent of the Singleton pattern is to ensure

that a class has only one instance and to provide a global point of access to it.

• Comment mode on:• In other words, the singleton design pattern

puts a constraint on the construction of objects.

Page 11: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

Prototype

• Book definition:• The intent of the Prototype pattern is to

provide new objects by copying an example rather than by bringing forth new, uninitialized instances of a class.

• Comment mode on:• In other words, the prototype design pattern

bases the construction of a new object on an already existing object.

Page 12: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

Builder

• Book definition:• The intent of the Builder pattern is to move the

construction logic for an object outside the class to be instantiated.

• Comment mode on:• In other words, the builder design pattern

moves the logic and code of construction into another class which becomes responsible for generating instances of a given class.

Page 13: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

Proxy

• Book definition:• The intent of the Proxy pattern is to control

access to an object by providing a surrogate, or placeholder, for it.

• Comment mode on:• In other words, the proxy design pattern

provides a stand-in for a desired object

Page 14: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• Client code has access to the stand-in while a reference to the desired object is being obtained, for example, whether through construction or from an external source.

• Even after a reference to the desired object is obtained, client code may continue to use the proxy as the “interface” to that object

Page 15: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

In summary:

• Singleton puts a constraint on construction.• Prototype basically means making a copy

method and is closely related to cloning.• Builder puts the responsibility for construction

into an outside class.• Proxy substitutes one object for another,

desired object.

Page 16: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• In one way or another, these patterns all have something to do with cloning or construction

• More specifically, they have to do with replacing simple construction with something else which also provides a reference to an object meeting the needs of the code.

Page 17: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

• These are concise mnemonic devices for these design patterns:

• Singleton: One to a customer.• Prototype: Partial copy.• Builder: Offload and delay construction.• Proxy: Placeholder or stand-in.

Page 18: Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see

The End