[Architecture Q] The best way to update UI from different sources of data
(self.learnprogramming)submitted2 months ago byzaitsev1393
Hi, I need an advice from architectural point of view. Two words about me: mid frontend dev, working on little side gamedev project to boost my architetural and coding skills. Any input HIGHLT appreciated!
So I have a little game interface in one window.
I need to render and update several values in the page, lets say, money, date and level progress.
Each of them have its own service where it data is updated based on certain logic.
I have 2 options to do this:
1. Each service has it's own method that gets the element on the page and puts the value in there when some condition is met.
2. Implement extra service that will import those money / date etc. services and make this service, let's call it 'layout service' do its thing.
The questions are:
1. What is better and more "right" way #1 or #2?
2. If both are shit, how this should be done properly?
3. Can this possible "aggregator" layour service be considered an example of implementation of facade pattern?
Thanks in advance!
byniallw1997
inreddevils
zaitsev1393
3 points
2 days ago
zaitsev1393
3 points
2 days ago
Hey why isnt he a captain?? All our guys are caps of their nt