We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byJaylynn Harbottle
Modified about 1 year ago
O RPHANS, A DOPTION, AND S URROGATES S INGLETONS Josh Mason June 1, 2009
A DOPTION AND O RPHAN Adoption Taken ownership of object Orphan Relinquish object What’s the purpose? Deciding where to put adoption/orphan functions Component? Leaf? Composite? Case by case basis.
S INGLETON Creational Pattern Restricts instantiation of a class to a single instance
U SES To implement other patterns Abstract Factory Builder Prototype Façade State Objects
S INGLETON - B ENEFITS Single Instance Controlled Access Reduced Namespace Lazy Initialization Easily extends to allow for a variable number of instances. Can assist in making thread safety simpler.
S INGLETON - E XAMPLES Traditional static MyClass* Instance(); Alternative 1 static MyClass* Instance(int i_id); static MyClass* Cleanup(int i_id); Alternative 2 static Create(int i_val, float i_val2); static MyClass* Instance(); static Cleanup();
S TINKLETON * - I SSUES Why not just use global variable? An anti-pattern? Creation Cleanup Tight coupling * Robert Penner
Creational Design Patterns. Creational DP: Abstracts the instantiation process Helps make a system independent of how objects are created, composed, represented.
PHP functions What are Functions? A function structure:
OOP Abstraction Classes Class Members: Properties & Methods Instance (object) Encapsulation Interfaces Inheritance Composition Polymorphism Using Inheritance.
Classes & Objects INTRODUCTION : This chapter introduces classes ; explains data hiding, abstraction & encapsulation and shows how a class implements these.
Design Patterns. General reusable solution to a commonly occurring problem in software design software design – Not a finished design that can be transformed.
1 Design Patterns. 2 Agenda - Design Patterns What is a design pattern Motivation for patterns Pattern Categories Pattern Examples.
Written by Paul Pu All Right Reservedwww.torontocollege.com Controlling Access to a Member(Java) public, private, protected (default)
Architectural and Design Patterns CS577b Nupul Kukreja 1.
Systems Architecture Use Case Diagram, System Overview, Class Diagram Design Patterns (weve used) Refactorings (weve used) Table of Contents.
Optional Static Typing Guido van Rossum (with Paul Prescod, Greg Stein, and the types-SIG)
Object Oriented Intro. Objectives Why Object-Oriented? Real-World Object/Programmed Objects? What we want in objects? Object Relationships?
Object Oriented Programming INTRODUCTION : The object oriented programming paradigm is the latest in the software development and the most adopted one.
Sml2java a source to source translator Justin Koser, Haakon Larsen, Jeffrey Vaughan PLI 2003 DP-COOL.
1 Software Design Patterns Department of Computer Science Kent State University.
(2-Tier) (n-Tier) (Component) (Business Components)
1 Object Systems Methods for attaching data to objects, and connecting behaviors Doug Church.
Peter Norvig, Harlequin, Inc. 1 Object World, May 5, 1996 Design Patterns in Dynamic Programming Peter Norvig Chief Designer, Adaptive Systems Harlequin.
Click to edit Master title style Ibiza, June 4 th – 7 th 2011.
Generics Programming in C# Generics CSE 494R (proposed course for 459 Programming in C#) Prof. Roger Crawfis.
ANALYSIS MODEL. Analysis Model Actual system development start with this. Aims to structure the system independently of the actual implementation environment.
Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 4 Modular Programming with Functions.
OOP in VB. OOP Principles An object – in memory – has –Some data values members –Pieces of executable code methods Objects usually come and go during.
Introduction to Java 2 Programming Lecture 5 Inheritance.
Design Patterns. Patterns 1, 2, 3, … is a sequence that exhibits the pattern: The integers in their natural order.
Design Patterns based on book of Gang of Four (GoF) Erich Gamma, Richard Helm, Ralph Johnson, and John VlissidesGang of Four (GoF) Elements of Reusable.
Practical Session 6 Multitasking vs. multithreading Threads Concurrency vs. Parallelism Java Threads Thread confinement Object/Class Immutability.
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Abstract Classes & Interfaces Definitions –abstract methods = Methods that are declared, with no implementation –abstract class = A class with abstract.
Lecture 5: Interfaces. concept An interface is a way to describe what classes should do, without specifying how they should do it. It’s not a class but.
28-May-14 Everything You Ever Wanted To Know About Java O-O.
© 2016 SlidePlayer.com Inc. All rights reserved.