I’m using unity and I’m creating a class that wrapps it and I dont’ know how to call it, service locator or factory, both encapsulate the creation of the objects, so…. what’s the difference?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A factory creates objects for you, when requested.
Service locator returns objects that may already exist, that is services that may already exist somewhere for you.
Just think about the meaning of the names: