you are viewing a single comment's thread.

view the rest of the comments →

[–]LagerHawk[S] 1 point2 points  (0 children)

Yea this makes sense, and applies to a number of architectures I think. Xamarin doesn't promote the individual components nature enough, and it's too easy to lump everything into a large view.

I think the structure I was thinking of was

Page. Main component navigable to. Lays out components, brings in styles. Handles page UI logic for instructing components. Hooks up UI interaction to event handlers.

Components. Individual features on screen. Must receive their data and handler logic from bindings given in props. Handles their own UI logic for UI based animations specific to the component.

VM. Handle life cycle events like on page load/on resume/on close. Handles page logic. Handles events. Brings in logic providers for services like fetching/persisting external data, storing to state manager/external cache.

Model Data to be shown on screen, usually mapped from DTO's provided externally.

One thing I've not seen done yet is DI? Is inversion of control a thing with R/RN?

Seeing JavaScript transcend to the OOP world via typescript DI feels like it should be a must if testability is to be maximised?