Hey! Got a problem and I cant think of an elegant ...
# android
n
Hey! Got a problem and I cant think of an elegant and clean solution. Basically in a mutli feature (module) project I have a restaurant Menu feature and an Order feature to preview and confirm the selected items. The problem lies in notifying the Feature Order about adding a new item while keeping them decoupled as much as possible. You select an item from the Menu and it should give a notice or something to the Order module. Single activity, bottom nav bar so cannot use the fragment arguments. Modules are VMs,Fragments and their data layers.
d
What about creating a component OrderItems. There you can have an observable model - your items. Menu feature can add items while Order feature can observe that model. You can even add two interfaces. One will expose method to add items. Second one will expose method to observe items. Then, you just use the same implementation behind different interfaces in both features
n
@Denis Buketa What exactly do you mean by a Component in this context?
d
Class with interfaces