-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ] 3 c Single Responsibility Principle

, 03 2017 . 17:47 +
Single Responsibility Principe .
. SPR , .

: Singleton


Singleton , , Single Responsibility Principle.

Singleton. IDE. Singleton , , , . Singleton- .

Singleton


Singleton- . , .

, (, ) , , . . , - , .

Singleton-


Singleton . . Singleton . , Singleton- .

Singleton


. Singleton , . . .


IoC. Dependency Injection .

Singleton


Singleton , . NSApplication.

Singleton , - .

:


. .

- .


- , , . , . SRP.

- - , , copy-paste. . , .

, .
.

MVC, MVP, MVVM


, . View Model. View Model- .


Controller-, Presenter- View-Model-. View - (Controller, Presenter View-Model).

View , , Controller, Presenter View-Model -. MVC iOS SDK MVC. UIViewController MVC- Controller-, .
MVC. UIViewController View, .

, , , Controller-, Presenter- View-Model- - . , -, , SRP.

.

, , .
, , .

. SRP Controller-, Presenter- View-Model- , , .

: NSNotificationCenter


iOS !

NSNotificationCenter , Singleton-. , (Communication Pattern), Singleton (Creational Pattern), Singleton-.

SRP.

:

, .

, , .

, .

.

, .

SRP:

  • .
  • ( ISP).
  • Singleton- SRP.
  • NSNotificationCenter ( )
  • .
  • , SRP.
  • , . .
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/330142/

:  

: [1] []
 

:
: 

: ( )

:

  URL