Created
May 30, 2017 05:49
-
-
Save josedlpozo/e5dbd996117a90de47398b343da8da75 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, ProfessorsModule { | |
internal lazy var localRepository : LocalRepository = LocalDataRepository() | |
internal lazy var repository : DataRepository = DataRepository(localRepository: self.localRepository) | |
private lazy var professorsDelegate : ProfessorsModule = ProfessorsModuleAssemblerDelegate(commons: self) | |
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 | |
} | |
func resolve() -> ProfessorsViewController { | |
return professorsDelegate.resolve() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment