A
A
andrew87122015-01-24 16:02:20
iOS
andrew8712, 2015-01-24 16:02:20

How to properly use services in a layered iOS app architecture?

I read an excellent article from robots about the layered architecture of an iOS application: habrahabr.ru/company/redmadrobot/blog/246551
There was a question regarding this item:

Services must be as autonomous as possible, which does not prevent you from building logical dependencies between them. For example, it is quite logical that the application has a service responsible for authorizing and maintaining a session with the server, and other services depend on it - they use the token provided by it to generate requests.

How can one service access another service? Through the ServiceLayer or by creating a new instance of the desired service?
And the same question regarding parsers - how should they handle arrays of nested objects? Initialize the parser for these objects yourself, or do it through their service?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question