-2

In a recent MVVM mobile app project I wrote a set of API classes and Database classes where there was a clear flow of logic between both api and db code. To enforce the way api and db interacted I created an additional abstraction/proxy layer.

For instance the login process was to call this new layer Login function that then:

Call api.Login -->
     on successful login --> 
     clear user table and insert new user details into DB
<-- only then return a successful login

The issue I am having is that I called this layer Database Controller which I do not like as it controls APIs as well as Databases and left me with out a proper name for the actual database controller code.

tl;dr: What do I call a code layer that controls both API and DB controller code?

  • Infrastructure layer? API is kinda vague. API's for what? – candied_orange Nov 6 '17 at 6:09
  • 1
    A simple code example would help your question immensely, though I'm not sure were in the business of helping you name things. – Robert Harvey Nov 6 '17 at 18:32
  • You are the best person to be able to name your own program's components, we simply do not have the domain knowledge, which is why your question is going to suffer from a lack of answers or downvotes. On the interest of being friendly though, you could just call it a DatabaseWrapper, if all it handles is interactions with the DB. – Erdrik Ironrose Nov 7 '17 at 8:47
  • @ErdrikIronrose Thanks for the suggestion, its a lot better than anything I have come up with. I wasn't sure when I posted this here if it was on topic or not. The question was meant to be fairly generic in nature hence the pseudo-code example i supplied. If you want internet points use it as an answer and ill mark it as correct. – Roland Nov 7 '17 at 22:34
  • @Roland I've added it as an answer and expanded a little. :) I hope that's alright. – Erdrik Ironrose Nov 8 '17 at 9:46
-1

As requested, I'm adding my comment as an answer:

You are the best person to be able to name your own program's components, we simply do not have the domain knowledge, which is why your question is going to suffer from a lack of answers or downvotes.

I'd recommend reading up on How can I expand my vocabulary to improve my variable names and possibly further searching this site (or others) for more generic approaches to naming things in your program.

Sometimes a design pattern can help with a name, or help avoid a name such as the case you have here as it's not quite a controller.

On the interest of being friendly though, you could just call it a DatabaseWrapper, if all it handles is interactions with the DB. Keep things simple when you can.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.