Ext.Net for MVC - How useful it can be?

Page 1 of 2 12 LastLast
  1. #1

    Ext.Net for MVC - How useful it can be?

    Hi,
    We have converted one of our applications in MVC recently. We are trying to learn the new ways of Ext.Net and MVC and so far have been successful. However, The more I develop in MVC, the more I try to figure the importance of Ext.Net in Views. I have the following questions, which I would realy appreciate if you can answer:

    1) Why should I not directly code in ExtJS for Views vs Ext.Net? There is a nice Eclipse plugin which can be used for syntax highlighting and intellisense. Also Sencha Architect does a wonderful job of creating UI by Drag and Drop, something that has been missing in Ext.net since the beginning.

    2) One of the biggest features of Ext.Net is DirectEvents and DirectMethods, but we can create a tiny framework to communicate with controllers on Server side. A little effort, but will work well.

    3) We are removing all dependencies on the server side for any client requirement. We would be sending simple objects which can be consumed on client side. So no use of X.GetCmp or X.Msg.Alert, etc.

    4) ExtJS views will be quick to respond vs Ext.Net since Ext.net will need to render 1st into ExtJS.

    So where else Ext.Net going to be useful?

    We have been planning a sencha touch UI for sometime now. In that case,
    1) We are forced to code in Javascript UI. So why not just learn one way to build UI with ExtJS.
    2) Cannot use Ext.net specific code in Controllers apart from Direct Methods. So no X.GetCmp (ofcourse can be use if the component names are same and function same, but very few components). So we are forced to use only JSON object based response, to maintain independence across different Views.

    Can you give me your views on the same? The questions have been in my mind for sometime but since we are so used to using Ext.Net its difficult to take a call.

    However, I would like you to know that, I absolutely love Ext.Net and its convenience and have used it in many projects so far. All the apps are made in WebForms, and hence can't even think of replacing Ext.Net with ExtJS anytime soon. We will surely be using it as long as you guys maintain it.

    As for MVC, its our 1st project and hence we have been thinking of how useful it can be in MVC scenario.

    Thanks,
  2. #2
    Well I use VS2010 with Razor syntax, Ext.net allows me to code heavily client side with the aid of intellisence have no other code in my views apart from ext razor infact.
  3. #3
    Here's one thing that I like being able to do. Perhaps there's a different way, but I work with the following very nicely with Ext.NET.

    Authorization for component display based on Role.

    Decorating a Action with the decided upon roles allows or disallows the entire view from rendering and thus I can easily control the configuration via Razor in a nice fluent way + have a view which can use the page life cycle if need be.

    In the next app that I am working on, I intend to use partial views like this (more than I have) and I think it will be much easier to manage UI injection by role based management.
  4. #4
    @OriCoder
    Hi,
    I am not doubting Ext.Net's capability as a toolkit in VS. My argument is about creating UI in Ext.Net V/s in ExtJS. When you have a project with multiple views, and same same controller, where will Ext.Net fit. Like in my case Sencha Touch and Ext.Net syntax.

    I might as well use same syntax coding for both views which can be done with JS.

    Until unless, if Ext.Net has a surprise coming through in the form of SenchaTouch.Net

    @jlosi
    I believe this can be done for any kind of view. Not just Ext.Net. Still if this is unique to Ext.Net, its a really good feature.
  5. #5
    Quote Originally Posted by amitpareek View Post

    @jlosi
    I believe this can be done for any kind of view. Not just Ext.Net. Still if this is unique to Ext.Net, its a really good feature.
    No, this is not unique to Ext.NET, but having a view with all your configured Ext.NET controls on it allows you to use both the ASP.NET page life-cycle AND the MVC architecture to dynamically create your UI.
  6. #6
    Hi @amitpareek,

    Fair enough. I will do my best answering your questions.

    First, some quick comments.

    Quote Originally Posted by amitpareek View Post
    1) There is a nice Eclipse plugin which can be used for syntax highlighting and intellisense.
    I have not used it and can't provide any noteworthy feedback on this.

    Quote Originally Posted by amitpareek View Post
    1) Also Sencha Architect does a wonderful job of creating UI by Drag and Drop, something that has been missing in Ext.net since the beginning.
    Yes, it is a big Sencha advantage. Unfortunately, we don't have such a solution and, honestly, I doubt we will be able to implement it any time soon due to limited resources. Currently, apart from maintaining Ext.NET and support, we are focusing on improving of learning resources. Regarding Architect. I just can say that such kind of solutions have issues. It might be nice to design some simple layout from scratch, but it will 100% require some manual tweaking to meet all the requirements. But sure, it can speed up the development process. At least, at the first stages. Though, personally, according my current level of Ext.NET and ExtJS experience I would prefer to implement everything from scratch manually.

    Quote Originally Posted by amitpareek View Post
    2) One of the biggest features of Ext.Net is DirectEvents and DirectMethods, but we can create a tiny framework to communicate with controllers on Server side. A little effort, but will work well.
    Sure, you can. But, anyway, it can be considered as an advantage of Ext.NET since it already has a ready solution.

    Quote Originally Posted by amitpareek View Post
    3) We are removing all dependencies on the server side for any client requirement. We would be sending simple objects which can be consumed on client side. So no use of X.GetCmp or X.Msg.Alert, etc.
    It is a nice design you are following. I would also do client side as much as possible. Ideally, getting from server only data. Well, the same as you are going to do.

    Quote Originally Posted by amitpareek View Post
    4) ExtJS views will be quick to respond vs Ext.Net since Ext.net will need to render 1st into ExtJS.
    Agree, a fair point. Though I think that this difference is going to be insignificant.

    Quote Originally Posted by amitpareek View Post
    We have been planning a sencha touch UI for sometime now. In that case,
    1) We are forced to code in Javascript UI. So why not just learn one way to build UI with ExtJS.
    2) Cannot use Ext.net specific code in Controllers apart from Direct Methods. So no X.GetCmp (ofcourse can be use if the component names are same and function same, but very few components). So we are forced to use only JSON object based response, to maintain independence across different Views.
    A very fair point. I can't say much here except that I don't think something like Ext.NET Touch will appear any time soon. But it is something we are looking into and, hopefully, one day we get required resources to start such a project.

    By the way, I think you could reuse Ext.NET DirectEvent/DirectMethod API here. At least, client side to call controller actions.

    Quote Originally Posted by amitpareek View Post
    However, I would like you to know that, I absolutely love Ext.Net and its convenience and have used it in many projects so far. All the apps are made in WebForms, and hence can't even think of replacing Ext.Net with ExtJS anytime soon. We will surely be using it as long as you guys maintain it.
    Thank you for the kind words! We are happy that such a strong member is with us.

    Quote Originally Posted by amitpareek View Post
    1) Why should I not directly code in ExtJS for Views vs Ext.Net?
    ...
    So where else Ext.Net going to be useful?
    ...
    The important thing you will have to decide is a View Engine which you are going to use. ASPX (WebForm) or Razor. Ext.NET fully supports both. Though, Razor engine is more powerful by itself. Sure, you will be able to use Razor without Ext.NET, but Ext.NET provides many built-in things. So, if you choose Razor, you will get more options.

    So, what Ext.NET has special for MVC.

    1. Layouting (including dynamic layouting).

    • ItemsFrom... helpers: ItemsFromPage, ItemsFromPartial, ItemsFromSection, ItemsFromAction. (Razor Only)


    • Dynamic Partial Rendering (Razor and ASPX)

    2. Models support

    • Data Annotations built support.


    • FormPanelFor, GridPanelFor, StoreFor, TextFieldFor and other fields "For" helpers (Razor only)


    • ModelStateStore (Razor only)

    3. Predefined controller result classes: DirectResult, StoreResult, FormPanelResult and others. And predefined convenient controller extenssion methods to return those results with ease.

    4. There are other nice little things like Button.DirectClickAction, CheckBox.DirectCheckAction, etc. It allows to refer a controller action as simple as possible. Though, sure, not a big deal. Just nice little things.

    5. Also I think it is very important that we are always open for any suggestiongs to implement, improve something. Generally, here I am taking about our Support. Someones thinks it is better than Sencha support;)

    Also do not forget that Ext.NET has a rather big JavaScript code over ExtJS which tweaks, extends and somewhere fixes ExtJS. It is actual for MVC as well.

    I might forget something, but that seems to be all I can provide you with at the moment.

    Whatever you will decide, again, we are happy you are with us and will understand any your decision.
    Last edited by Daniil; May 31, 2013 at 6:15 AM.
  7. #7
    Quote Originally Posted by jlosi View Post
    No, this is not unique to Ext.NET, but having a view with all your configured Ext.NET controls on it allows you to use both the ASP.NET page life-cycle AND the MVC architecture to dynamically create your UI.
    Hi @jlosi,

    Thank you for your feedback and attention to this thread.

    I just want to share my opinion regarding page life cycle in MVC. Personally, I would prefer to avoid using it at all as much as possible since it doesn't meet the MVC concept. Even issues might appear here. I recall some issue when some "page/control life cycle" thing just stops working in MVC 3, but it works in MVC 2. So, I don't think Microsoft supports much page/control life cycle in MVC.

    Also the important thing that page/control life cycle looks not actual for the Razor View Engine at all.
  8. #8
    Quote Originally Posted by Daniil View Post
    Hi @jlosi,

    Thank you for your feedback and attention to this thread.

    I just want to share my opinion regarding page life cycle in MVC. Personally, I would prefer to avoid using it at all as much as possible since it doesn't meet the MVC concept. Even issues might appear here. I recall some issue when some "page/control life cycle" thing just stops working in MVC 3, but it works in MVC 2. So, I don't think Microsoft supports much page/control life cycle in MVC.

    Also the important thing that page/control life cycle looks not actual for the Razor View Engine at all.
    Good to know. I had used it in MVC2 and everything I did in MVC3 avoided the page life-cycle so I didn't know it was "removed". I've been "stuck" in webforms land trying to keep an old app maintained while I prep for the next app. MVC4 is quite the improvement and I love the razor engine and what you guys did with Ext.NET and supporting it.
  9. #9
    Quote Originally Posted by amitpareek View Post
    @OriCoder
    Hi,
    I am not doubting Ext.Net's capability as a toolkit in VS. My argument is about creating UI in Ext.Net V/s in ExtJS. When you have a project with multiple views, and same same controller, where will Ext.Net fit. Like in my case Sencha Touch and Ext.Net syntax.

    I might as well use same syntax coding for both views which can be done with JS.

    Until unless, if Ext.Net has a surprise coming through in the form of SenchaTouch.Net

    @jlosi
    I believe this can be done for any kind of view. Not just Ext.Net. Still if this is unique to Ext.Net, its a really good feature.
    in case you have more views, you can create and fill your components in controller bagging them in viewBag and debag in view.
  10. #10
    Even if we dont use any of the server controls by Ext.NET, we will still output Ext.NET js files for its many nice enhancements to the ExtJS framework. We still use webforms, but we try to stuff as much UI stuff to client side js files as possible. The server code behind and aspx page are really to just do the initial page rendering. After page loads, pretty much everything happens in js files and direct methods.
Page 1 of 2 12 LastLast

Posting Permissions