locked
menu content link in Backend VS menu content link in UI RRS feed

  • Question

  • Goal:
    Have a common and same menu content link (for instance Home, about, consumer product, support)  when you are using Angular, NativeScript and Android.

    Background:
    The menu contain seven different name. Each name is distinguish.
    The backend is .net core with SQL server.

    Problem:

    Two approaches:

    First solution:
    Should the name from the menu should be located inside of backend? In order words, you retrieve the content of the menu from the backend and display in each UI (angular, android etc.)
    Cons:
    You use the concept DRY and less maintenance.

    Second solution:
    The second one is to have the content of the menu in each UI without request for the content of the menu at backend.


    The main question is:
    What experience have you been through in this situation.

    Which of these two solution should I go and why? 
    Any pros and cons?

    Thank you!
    Tuesday, September 22, 2020 5:18 PM

Answers

  • In regards to the question of whether the UI should just hard code the menu item info or not then the answer is it should. This is for a variety of reasons.

    1) Performance. Do you really want to stall the display of a UI while you load menu information from a database?

    2) How often is the text going to change? If it rarely or ever will change then you've gained nothing by putting it into a database. You would do better to create a resource file at best.

    3) Localization. Putting UI into a database is going to cause problems as the UI changes and/or localization comes into play. You simply cannot store a single text value and expect it to work for all UI components.

    4) Maintainability. Suppose you add a new option a year from now. Unless you update all your apps at the same time then some apps will have some new option that they aren't coded for yet. How would that look to the end user? Unless you completely abstract away all functionality you are going to have to touch each app to add any new behavior anyway. Adding the text at that point is not a big deal. 

    5) Differing UIs. There is simply no good way to determine the text that should be used for all cases. Different UIs display things differently based upon the native behavior of the app framework. This can cause differences in how things look and are worded. Thus storing a single text for all UIs doesn't make sense. It also becomes harder to manage if you need slight variants.


    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by Sakura Data Tuesday, October 6, 2020 11:07 AM
    Wednesday, September 23, 2020 1:29 PM

All replies

  • Sorry but this looks like an interview question and that, like homework, we don't provide answers for. If you cannot answer this question yourself then getting the answer from someone else isn't going to help. As an interviewer I would know you did this and then ask you very specific questions while interviewing you to ensure that you didn't know. Then I'd dismiss you from the interview process. But that is just me.

    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, September 22, 2020 6:17 PM
  • Sorry but this looks like an interview question and that, like homework, we don't provide answers for. If you cannot answer this question yourself then getting the answer from someone else isn't going to help. As an interviewer I would know you did this and then ask you very specific questions while interviewing you to ensure that you didn't know. Then I'd dismiss you from the interview process. But that is just me.

    Michael Taylor http://www.michaeltaylorp3.net

    Oh, I was surpised that my questions looks more like a interview question. I was not expected about it. I'm doing my own pet project and looking for advice. I strongly believe in knowlege management.

    Thank you for taking your time to read my message.

    Wednesday, September 23, 2020 5:24 AM
  • In regards to the question of whether the UI should just hard code the menu item info or not then the answer is it should. This is for a variety of reasons.

    1) Performance. Do you really want to stall the display of a UI while you load menu information from a database?

    2) How often is the text going to change? If it rarely or ever will change then you've gained nothing by putting it into a database. You would do better to create a resource file at best.

    3) Localization. Putting UI into a database is going to cause problems as the UI changes and/or localization comes into play. You simply cannot store a single text value and expect it to work for all UI components.

    4) Maintainability. Suppose you add a new option a year from now. Unless you update all your apps at the same time then some apps will have some new option that they aren't coded for yet. How would that look to the end user? Unless you completely abstract away all functionality you are going to have to touch each app to add any new behavior anyway. Adding the text at that point is not a big deal. 

    5) Differing UIs. There is simply no good way to determine the text that should be used for all cases. Different UIs display things differently based upon the native behavior of the app framework. This can cause differences in how things look and are worded. Thus storing a single text for all UIs doesn't make sense. It also becomes harder to manage if you need slight variants.


    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by Sakura Data Tuesday, October 6, 2020 11:07 AM
    Wednesday, September 23, 2020 1:29 PM
  • Thank you for your advice!
    Tuesday, October 6, 2020 11:07 AM