Posts

Showing posts from February, 2018

Core Data

Image
Core Data is an object-graph management and persistence framework Core Data stack A Core Data stack is composed of the following objects: one or more managed object contexts connected to a single persistent store coordinator which is in turn connected to one or more persistent stores. A stack contains all the Core Data components you need to fetch, create, and manipulate managed objects. Minimally it contains: An external persistent store that contains saved records.  A persistent object store that maps between records in the store and objects in your application.  A persistent store coordinator that aggregates all the stores.  A managed object model that describes the entities in the stores.  A managed object context that provides a scratch pad for managed objects.  Managed object A managed object is a model object (in the model-view-controller sense) that represents a record from a persistent store. A managed object is an instance...

Design Patterns

Image
Bridge Pattern Abstraction and implementation are not bound at compile time Uses composition over inheritance. Abstractions and implementations should be changed independently Abstraction not tied to the Implementation: The abstraction interface (or abstract class with most of the behavior abstract) would not know/contain the implementation interface reference The intent is to completely decouple the Abstraction from the Implementation What is an abstraction? It’s a generalized way of looking at something that makes it so you don’t have to know the details of how that thing is implemented. A car steering wheel is an abstraction on top of a car. The car steering wheel abstracts away what is really going on to make a car change direction. https://simpleprogrammer.com/design-patterns-simplified-the-bridge-pattern/ https://springframework.guru/gang-of-four-design-patterns/bridge-pattern/ Strategy Pattern Define a separate (strategy) object that e...

UML Diagrams

Image
UML Diagram Symbols                   Structural UML diagrams Class diagram Package diagram Object diagram Component diagram Composite structure diagram Deployment diagram Behavioral UML diagrams Activity diagram Sequence diagram Use case diagram State diagram Communication diagram Interaction overview diagram Timing diagram Composition vs Aggregation: In Aggregation, a child cannot exist without parents existence.

UI-based Application Architecture

Image
For reducing coupling between model, view and business logic to increase unit testing compatibility different architectures are used. I am studying in the perspective of ios platform. MVC: Model-View-Controller Model:  Model classes are just data structure and manager of data structures like core data model classes and user-defined all model classes. The handler of core data models and json parser. View:  Storyboards, xibs, UIView classes, Controller: UIViewController classes. which contain all business logic and presentation logic so this becomes a clumsy class and incompatible for unit testing. MVP: Model-View-Presenter Presenter - For solving the problems with Controller of MVC presenter is used in MVP. The controller class is partitioned in different view classes with its own business logic so controller class is reduced in smaller size in presenter pattern.  But this also breaks SRP and unit testing problem does not solve yet using pre...