This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Use singleton to create no-field-constructor for all repos \firebaseRep #17
Labels
discussion
Discuss on the topic
Comments
I think this would come useful but not quite sure how to do it. Makes it easy to import the repositories. The part I'm not sure here is how we can provide |
Since they are all using firebaseRepo as their first config couldn’t we just make internal instance in constructors?
So for example for artworkRepo we pass in firebaseRepo only and using firebaseRepo to create a PeopleRepo instance.
… On Feb 11, 2019, at 23:20, Clarence Castillo ***@***.***> wrote:
I think this would come useful but not quite sure how to do it. Makes it easy to import the repositories. The part I'm not sure here is how we can provide FirebaseRepository the config object which contains the API keys.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Wouldn't that result in circular dependency? ArtworkRepo needs FirebaseRepo for PeopleRepo which has an ArtworkRepo instance which needs FirebaseRepo and so on... Or am I missing something? 😆 |
PeopleRepo depends on Artwork? How’s that happening?
But yea last time I try with this approach I do get circular dependency error.
I’m thinking of factory and builder pattern but not exactly how to implement those. Need to sit down and think though.
…Sent from my iPhone
On Feb 11, 2019, at 23:48, Clarence Castillo ***@***.***> wrote:
Wouldn't that result in circular dependency? ArtworkRepo needs FirebaseRepo for PeopleRepo which has an ArtworkRepo instance which needs FirebaseRepo and so on... Or am I missing something? 😆
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Oh, my mistake, it was just an example. A bad one! 🤣Or we do something like dependency injection like in Angular. I am also not sure how to implement those haha. If complicated, we can keep this in view first and work with other features. |
thats true a good improvement to think about as well.
…Sent from my iPhone
On Feb 12, 2019, at 00:03, Clarence Castillo ***@***.***> wrote:
Oh, my mistake, it was just an example. A bad one! 🤣Or we do something like dependency injection like in Angular. I am also not sure how to implement those haha. If complicated, we can keep this in view first and work with other features.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
No description provided.
The text was updated successfully, but these errors were encountered: