
Explore the prototype design pattern, creating objects by cloning an existing prototype into a clone, understanding benefits like avoiding expensive initialization, and managing shallow versus deep copies in Swift.
Some times we need to create a copy of existing instance. One simplest way is to create a new instance using the initialiser and set the property values using the existing instance. Look the below example.
let car = Car(name: "BMW", model: "1250", rate: 1000000)
let copy = Car(name: car.name, model: car.model, rate: car.rate)
Although the above approach is simple and works but there are some situations where calling the initialiser will perform some expensive task. For example what if the rate should be fetched from server based on the model name and set the rate inside the initialiser. Whenever we need a copy when we call the initialiser it will fetch data from server but we do not need this expensive operation as we are already having an existance instance with data and just need a copy of that data into new instance. So we need to create a copy without using the initializer.
So Prototype Pattern solves the problem of using expensive initialisation when we need an exact copy of a new instance from an existence instance.
Explore how shallow copying copies references in a prototype design pattern, contrasted with deep copying that duplicates content using a meeting and its location example.
Demonstrates deep copying within the prototype pattern by copying the actual content of referenced objects, so cloned meetings obtain separate location instances and independent state.
Define singleton as a single shared class instance across the app to share data and functionality, saving memory; with real-world examples like printers, and note only classes support singletons.
Implement a Swift singleton to share a color picker's data and random color function via a static shared instance, ensuring global access and consistent updates across classes.
Explore how final and @objc influence Swift performance by enabling static binding and Objective-C runtime exposure, and compare static, dynamic, and runtime dispatch to optimize method dispatch.
Explore core system design concepts, dependency graphs, and object oriented system dependencies, and learn how partial and direct dependencies affect maintainability, flexibility, and extensibility.
Manage dependencies in object oriented design with firewalls and abstraction, using protocols or interfaces to achieve loose coupling, flexibility, and easier maintainability and extendibility.
Emphasize dependency on abstractions rather than concrete implementations to keep code loosely coupled. Use inheritance or protocols to achieve abstraction and localize changes, increasing flexibility and maintainability.
Learn how the factory design pattern hides object creation behind a specification, delivering instances via abstraction to reduce coupling and boost flexibility, with a nod to the abstract factory variant.
Apply the factory design pattern by building a mobile interface and a mobile factory, enabling decoupled, switchable Apple or Samsung implementations.
Explain how abstract factory hides creation and selection by returning a collection of related objects through a factory of factories, all operating on a uniform interface.
Explore how to build computers with basic, standard, and advanced CPU, GPU, and display components using the abstract factory pattern, enabling flexible, extensible object creation.
Master the builder design pattern by separating object configuration from creation, using initialization data to build the object and return it to the caller.
Master the builder pattern by constructing a burger object with properties like name, toppings, ketchup, and cheese, separating configuration from creation and using default values when options are omitted.
Explore the object pool pattern by modeling a three-book library serving ten students, showing how get and return operations reuse resources, avoid expensive initialization, and boost flexibility.
Hide the creation logic from calling components to isolate changes. Use prototype and singleton patterns to avoid expensive initialization and reuse objects, reducing memory footprint and increasing flexibility.
Explore the adapter design pattern, a structural design pattern that converts one interface to another so two incompatible interfaces work together without changing existing code, with examples in Swift programming.
Explore the adapter pattern by converting a basic mobile interface into a smart mobile, enabling calling, disconnecting, and handling photo and video capture through a smart adapter.
This is a practical course that equip with all you need in order to understand and use Design Patterns and Software Design skills to develop code which is flexible, extendable and maintainable. We will be learning the Design Patterns with visualisation of how each pattern works internally and implement each pattern with scenario based examples with step by step approach in Swift Programming.
We we be also looking at various key concepts of Swift, Objective C and iOS SDK to understand the inner workings and insights during various stages of course. You will get good confidence to crack senior technical interviews that relates to Design patterns and Software Design landscape. We also cover most of the Design Principles one should aware to write code which is reusable and robust.
You will be learning the Creational Design patterns for efficiently creating objects in a flexible way that increases the extendability and maintainability of the code. You will master the Singleton, Prototype, Factory, Abstract Factor, Builder and Object Pool patterns as part of the Creational Design Patterns.
You will be learning the Structural Design patterns for assembling classes and objects to create larger structures in a decoupled way that increases the extendability and maintainability of the code. You will master the Adapter, Bridge, Composite, Decorator, FlyWeight , Proxy and Facade patterns as part of the Structural Design Patterns.
You will be learning the Behavioural Design Patterns which identifies and establishes communication between objects in a flexible and loosely coupled manner. You will master Chain of Responsibility, Strategy, Template, Observer, Command, State, Visitor, Mediator patterns as part of the Behaviour Design Patterns.
You will be also leaning most common Software Design Core Concepts and Terminology that we use for Designing reusable, flexible and extendable Software Components in day to day life of Software Development.