Abstract: One key difference between writing object-oriented software and writing procedural software is the notion of object construction. Objects must be instantiated before they can be used. This is much more than a technical detail, it is at the very core of OO's usefulness.
By separating an object’s construction from its usage, we can encapsulate an object’s type during construction, so that it can be used without revealing its type. This gives an object testability, extensibility, and modularity. Building a program's object graph separate from using those objects simplifies software construction and reduces dependencies so that code is simpler to work with.
One key distinction—and therefore opportunity—of object-oriented programming over procedural programming is that objects have two phases in their lifecycle: creation and use. By separating these two phases so that certain kinds of tasks are done when objects are created, and other kinds of tasks are done later during usage, we can build software that’s more modular and extensible.
In this session, we’ll explore how you can leverage object instantiation to build decoupled, extensible and maintainable systems. We’ll cover several common antipatterns in instantiation along with replacement patterns that drop the cost of ownership for software built in object-oriented languages such as Java, C Sharp, C++, etc.
Learning Outcomes: - Leverage object instantiation to write more decoupled and testable code
- Learn how to use the object-oriented model to build maintainable software
- Recognize instantiation anti-patterns that make code harder to extend
- Apply instantiation patterns that improve testability and extensibility
- Know when to use factories and how to construct them efficiently
- Encapsulate construction to improve an object’s testability and extensibility
Attachments: