PDA

View Full Version : Designing first application



ErrantVenture
28 Jun 2013, 6:32 AM
Hey folks,

just trying to get a handle on how best to design a 'fairly simple' application as far as building it using MVC.

There are two primary 'pages,' a login page and the dashboard. If the user has a valid cookie, which is checked as the page loads, the dashboard is shown instead.

The dashboard consists of a top bar with four buttons + a logout button, which of course logs out and sends the user to the login page, and a content area taking up the rest of the screen. The content area has four possible views, which the buttons at the top will switch between. Two of the sections will be displaying data via a grid, though in each case there are going to be a couple of columns which have custom html generated (such as clickable links/icons) which will not be common between the grids.

My initial thought was to use nested card layouts. Basically the viewport would have a card layout with two cards, the login page and the dashboard. The dashboard would have a top bar panel and a content panel, with the content panel also being a card layout with four cards representing the four sections.

This seems like it would be fairly easy to break down as far as matching the controllers up to the views go, but I was wondering what the cons would be to creating this sort of application architecture, and if there is a better alternative.

slemmon
30 Jun 2013, 11:05 PM
The card layout in the viewport with card A being the login and card B being the application content is one approach I've seen others adopt and it seems sound. Another possible approach is to have the login dialog be presented to the user and once authenticated the call to Ext.application() is called so the app is never really constructed unless the user is first authenticated.