Tuesday, December 31, 2013

atomic vs nonatomic in iOS / atomicity in iOS / what is atomic in iOS / what is nonatomic in iOS / what is @atomic in iOS / what is @nonatomic in iOS/

Atomicity: you have likely seen “nonatomic” in property declarations numerous times. When you declare a property as atomic, you usually wrap it in a @synchronized block to make it thread safe. Of course, this approach does add some extra overhead. To give you an idea, here is a rough implementation of an atomic property: // If you...

NSAutoreleasePool in iOS / why NSAutoreleasePool needed ?

NSAutoreleasePool:- The NSAutoreleasePool class is used to support Cocoa’s reference-counted memory management system. An autorelease pool stores objects that are sent a release message when the pool itself is drained. Why NSAutoreleasePool is needed?:-  To minimize the peak memory footprint. Use in block of code when you feel that...

Thursday, December 19, 2013

Bridge pattern - Structural Design Pattern

Bridge Pattern Bridge Pattern Ref:- http://www.tutorialspoint.com/design_pattern/bridge_pattern.htm http://www.codeproject.com/Articles/42762/Bridge-Design-Pattern Its a structural design pattern. Just like how printers work with computers. If we have a USB...

Wednesday, December 18, 2013

Adapter pattern - Structurel pattern

Adapter Pattern Adapter design pattern allows you to make an existing class work with other existing class libraries without changing the code of the existing class. Maximum times we needed that methods of the existing class should work with other existing class...

Prototype pattern - Creational Design Pattern

Prototype Pattern Its a creational design pattern. Its normally used to create duplicate objects.  This pattern is used normally when the creation of object is costly.  Example:- Object created and have lots of expensive operation like sql query etc  When next...

Builder Design Pattern - Creational Design Pattern

Builder Pattern Ref:- http://www.tutorialspoint.com/design_pattern/builder_pattern.htm Its creational design pattern. Builder pattern builds a complex object using simple objects and using step by step approach. The builder is independent of other objects. Example:- This...

Singleton Design Pattern - Creational Design Pattern

Singleton Design Pattern Its creational design pattern.  Singleton pattern is to ensure that a class has only one instance and provides global point of access it. Implementation Singleton class have its constructor as private and have static instance of itself. Class...

Abstract Factory Pattern - Creational design pattern / Abstract Factory tutorial / Abstract Factory example

Abstract Factory Pattern Its a creational design pattern.  It's extension to factory method. It creates more level of abstraction to factory (factory method) so called Abstract Factory Pattern. This factory is also called as Factory of factories. In this interface...

Factory method design pattern - Creational design pattern

Factory method Its a Creational design pattern. Definition: “The factory pattern is used to replace class constructors, abstracting the process of object generation so that the type of the object instantiated can be determined at run-time.” Define an interface for...

Tuesday, December 17, 2013

Design pattern tutorial / Design pattern with example / Design pattern fundamentals / Creational Design Patterns / Structural design Patterns / Behavioral design pattern

Design pattern  Design pattern is a general repeatable solution to a commonly occurring problem in object-oriented  software design. its like  library of solution to desired problem.  These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time.  Design...

About

Powered by Blogger.