This is a migrated thread and some comments may be shown as answers.

SPA - best practices or how to design app

1 Answer 269 Views
SPA
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 07 Oct 2017, 03:48 AM

Hello,

I'm playing with Kendo just few days... yesterday I have start to investigate SPA app pattern and it implementation in Kendo. I understand how views, layouts and router plays together.

But I have a problem to design app as whole.

My example app is about customers. Imagine you have customers. Customers have services. And every (logged) user in my app can manage zero or more customers and their services.

In my app I have a 1 layout object rendered from template. This template have 1 combobox which can be used to select a customer and one div for "views". in this simple case imagine only 3 views, showing 3 different grids of some customer's data (for example services, log entries and contacts).

My questions:

1. one BIG model (instance of observable) or one model for layout and 3 smaller models for each views?

2. if more than one, how to synchronize "customer selection" and propagate this change down to views?

3. if i have not 3 but 100 views... will be all templates "rendered and synchronized" even if only one is active?

4. how to free memory from inactive views? each view have datasource for grid, grid's data are huge (500+ rows, more than 10 columns) ... if i enable row filtering, datasource is duplicated for suggestion autocomplete edit box. not sure if one model is good way.

 

I would be very happy if someone with more knowledge with Kendo SPA help me how to start :)

 

Peter.

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 10 Oct 2017, 11:57 AM
Hello Peter,

If I understand correctly, the main struggle is whether to use a big model or several models contacting with each other. The second, in terms of good practices, is better. 

However, how to control the data flow between them is achievable programmatically, by using the ObservableObject API:  https://docs.telerik.com/kendo-ui/api/javascript/data/observableobject

As for the other questions, they are mostly related to application structure that depends on the specific application requirements. 

Regards,
Ianko
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
SPA
Asked by
Peter
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or