DEV Community

Discussion on: I have no idea what I'm doing, but here Goes #0

 
jamonjamon profile image
Jaimie Carter

Thanks Fernando, I was thinking of using Mongo for the dev environment. Thanks for the tip with super class and sub class. I'll look that up first thing in the morning. I really like the look of firebase to get an idea what your concept will turn out like, so I'm super keen to get across at least a bit of what it has to offer.

Thread Thread
 
thefern profile image
Fernando B 🚀

No worries, yeah the idea with a super or even an abstract class is that you keep all the database methods in one place.

Examples:

  • FetchUser
  • WriteData
  • ReadData
  • Etc

Of course these methods would be based on your app, but then on the subclass implementation you can actually focus on mongo in one class, and firebase on another. And somewhere on a configuration file you can easily switch between the two.

Thread Thread
 
jamonjamon profile image
Jaimie Carter

Excellent!! Thanks for this.