The story of "pain" and how we fix it

I will introduce myself, Malyugin Platon Android Lead at Dejavoo Systems. This story is about our "pain" with which we have been fighting for a year and the evolution of our architecture. The main profile is cash terminals for retailers and restaurants, so a lot is tied to the specifics of the industry.



In any case, changing the architecture for an application not only complicates it, but increases the amount of documentation and requires support. Therefore, it is worth considering whether it is necessary to do this now? Do you have enough experience and the number of blocking tasks?



Why now? You can continue to suffer and touch this screen as little as possible, since it works, why break what is working now? Everything is simple, a large number of blocking tasks have accumulated, for which it is necessary to remake the current order structure for a more complex but flexible one. You can't do without alterations.



Description of the problem



We use one Activity for ordering, which supports both tablet and phone versions. It's easier for us to work with dialogs (our dialogs are Activity), and there are a lot of them on this screen and we wouldn't want to duplicate them.



This is what the tablet version looks like:



Tablet version



We collect the version for phones from the same elements, but with a different navigator.



Phone version



I will describe what the screen consists of:



  • Items - fragment
  • Departments - fragment
  • Line Items and Amount - Fragment
  • Order Parameters is a separate view


50, , , OrderPresenter .





Current architecture



, Use case, . . , , , .



, , , , , . , ( Use case).



:



  • ,
  • ,
  • , ,
  • ,
  • , , ""
  • ,




" " — , 2- . :



  • "" ( )
  • ,
  • ,


, , , , .



, , . :







  • ( 2 ) ,
  • UI
  • Rx




New architecture



, "" , , ( ), . .



Now, if the user will "hammer" on the screen very quickly. then we will be able to process all operations, albeit with a slight delay (although for the eye this will be less noticeable than the "freezing" of the screen)



Brief UML diagram of the repository:



Brief UML diagram of the repository



Outcome



We may have invented a bicycle, but the architecture, in my opinion, simplifies the work and allows you to support more complex cases. We continue to work on it.




All Articles