开发者

Administration section design decision

I am writing an admin component of a web app. The admin tasks involve CRUD operations on a complex object.

The object has many sections, each section has many categories, each category has many subcategories.

Administrators should be able to make change to the object at any level. E.g. Adding/edit/delete section, category or subcategory.

I am using MVC3 and found three possible solution to make the front end.

  1. Use Razor View engine
  2. Use jQuery template plugin to list the items and use JQuery UI dialog to do create/edit screen.
  3. Use jQr开发者_C百科id to display data in a Parent/child grid and jQgrid provides builtin create/edit/delete operations.

I have trouble deciding which is the best way to go, could anyone please shed some light?


This is a pretty broad question and a few will likely cite it for being subjective, but there are a number of considerations around your design that might let you lean toward one decision or another.

The Razor view engine allows you to keep your UI extremely light in terms of server script but still lets you do a lot of the heavy lifting (especially around data binding) on the server end. It would likely require less front-end coding in terms of your jQuery and CSS.

jQuery templates are the next step "down". They still keep a reasonable degree of decoupling between application logic and presentation, but require a lot more front-end coding that will likely still need to be supported by the more JsonResult calls than you might have otherwise had. Depending on how you expose your data, you might find that using jQuery templates provide more flexibility in terms of UI and rendering than you might otherwise have had.

jQGrid isn't really designed for managing this degree of nesting of child entities (objects). It'll work of course, but is probably more suited to cleaner arrays of data than you seem to want to use here. I would suggest you might be opening up a world of pain if you took this design route.

So in summary - and without having any further detail to work with - I would recommend one of the first two options you're considering, depending on your UI needs.


In my opinion the choice between tree ways which you describes should depend on two additional aspects: 1) your know-how in all the technologies and 2) the time and comfort factors. Do you need more quick and dirty solution or you want to defign your backend in general? The more the time factor important for your the more you should make your choice mostly based on your current know-how.

I could suggest you one more way which I personally prefer. I like to have clear separation of data and business interface from the visualization of the data on the web site. So I design RESTful WFC service having the user authenthication and authorization and which implement the whole business logic of the site. I publish the WCF service as the part of my web site (see here for details). If needed one can write Unit Tests to test the WCF service as the core of the site.

After you have WCF service you can choose the presentation part of your site. I personally know and like jqGrid. It has many features which allows you create very comfortable GUI on the web site. The grids for admin components can have both toolbar searching and advanced searching. Sorting by the column, resizing of the grid columns, reordering with drag&grop, hiding unneeded columns and so on can be implemented very easy. The filtering of data for advanced searching or/and toolbar searching will take more your time for programming on the server, but you will can use this feature in all your grids. It's important, that to be able to use server side paging and filtering you should extend the interface of the web service with the methods having information about paging, sorting and filtering.

If you decide to use jqGrid your MVC Views can contain mostly empty tables and one JavaScript per the grid. The JavaScript will use jqGrid which call WCF service to fill the grid. The in ASP.NET MVC you can mostly construct menu and workflow, which can be user dependend (depend on the user rights on the site).

So I think that you should make your choice yourself based on requiremetns which you have, your know-how in all the technology, the time factor and the comfort requirement to the site. In all situations you will need to decide how you should design the site to show and make possible to modify all categories, subcategories and other hierarchical and dependend objects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜