Created
May 30, 2017 05:42
-
-
Save josedlpozo/1b65d09b78559fc6904d662ec9a1f056 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
protocol CommonAssembler { | |
func resolve() -> LocalRepository | |
func resolve() -> ProfessorRepository | |
func resolve() -> SubjectRepository | |
func resolve() -> CareerRepository | |
func initViewController() -> UIViewController | |
} | |
class DependencyFactory : CommonAssembler { | |
internal lazy var localRepository : LocalRepository = LocalDataRepository() | |
internal lazy var repository : DataRepository = DataRepository(localRepository: self.localRepository) | |
func initViewController() -> UIViewController { | |
return HomeViewController() | |
} | |
func resolve() -> LocalRepository { | |
return localRepository | |
} | |
func resolve() -> ProfessorRepository { | |
return repository | |
} | |
func resolve() -> SubjectRepository { | |
return repository | |
} | |
func resolve() -> CareerRepository { | |
return repository | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment