문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 softwareengineering.stackexchange
scroll top