Developer roadmap - 1. Moving to MVC. Your thoughts.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hi folks,

I've created this topic in order to know your thoughts about moving nopCommerce to MVC. Let's discuss and summarize advantages and disadvantages of this task in context of nopCommerce.

Advantages:
1. We can create a really extensible and pluggable framework.
2. A better design of the code
3. Follows the stateless nature of web. No viewstates.
4. SEO friendly URL
5. TDD
6. A lot of work for nopCommerce team and contributors =))
P.S. I've sorted them by priority - it's my view

Disadvantages:
1. SEO friendly URL...yes, it's a disadvantage in context of upgrading. It'll affect all existing sites powered by nopCommerce. But of course, we can find a workaround for this issue.
2. A lot of work for existing store owners because moving to MVC is a really great and time-consuming task
3. You'll lose an opportunity to use existing rich ASP.NET WebForms controls (MVC is still very young)

We can also discuss whether we should move to MVC 2 or wait MVC 3 (or wait further MCV releases).

P.S. You can go and vote for this task here

UPDATE:
After having a discussion with the other team members we decided to move nopCommerce 2.00 to MVC 3 with a Razor view engine.
13 years ago
Hello Andrei,

It's great that nopCommerce team is thinking about taking nopCommerce to further level using latest technology.

I have worked on  ASP.NET MVC Framework..and i think ASP.NET MVC is growing but still it is not mature enough that complete nopCommerce project should be migrated to ASP.NET MVC...

I have worked on the ASP.NET MVC framework and let me tell you that this is no walk in the park. There are only a handful open source projects available in ASP.NET MVC.

Disadvantages are as follows:

1) We all love nopCommerce because it can be customized easily. Talking about ASP.MVC app/project - It is not easy to understand the code and it requires a lot of time for customization. If anyone does frequent changes in the database, he/she may find it annoying to keep building application again and again. It may break several other parts of the application.  

2) If you are using Silverlight part of it, the data access is limited to Web Services/WCF/ADO.NET Data Services.  You cannot make direct calls via ADO.NET or stored procedures to a database.

3) ASP.NET MVC has no way of knowing that the post data is invalid which is a pretty major problem if you are just blindly binding data on the server side.

Advantages:

1) It support mutliple views.
2) ASP.NET MVC Framework is built upon a proven MVC design-pattern
3) No postbacks
4) Full control over every single bit of HTML, and CSS - which also acts as disadvantage as you have to enter the Web elements manually.

I think it will be better if we wait for ASP.NET MVC to become more mature and stable.

I also found an article where Dot Net Duke mentioned that they are not going to migrate their application to ASP.NET MVC:
http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/2464/ASP-NET-MVC-and-DotNetNuke.aspx
13 years ago
I agree wth Mike. MVC is still in its infancy. Since nopCommerce is also still in it's infancy per say, you would drastically cut back on the amount of developers that would write integrations for nopCommerce because of the lack of knowledge of MVC. I think time would be better spent making nopCommerce easier to integrate with the current structure.
13 years ago
Hi Andrei,

Here are my 2 cents.

I think many of us could agree that the major disadvantage to asp.net/forms vs MVC are the post backs and viewstate.  This is even more apparent on the admin side when doing lots of administrative work.

I think a better solution would be WCF and jQuery.  I know there are some who have an aversion to large client side libraries but I just don't see this as a negative anymore.  I spoke briefly with Mike (abc_1234) about web services and incorporating them into nopCommerce.  I am working on a site where I will provide some video and text tutorials on what I have found to be very promising solutions to expanding nopCommerce using WCF.

I think the first 2 items on your advantages list are not necessarily true.  I believe the existing code base is already well written and is pluggable.  I can empathize with the innate desire you have to perfect your code and find that 'perfect' solution.  This is a hallmark of any successful product or company.  However, I think for this platform to move to the next level will require more traditional approaches like support, customization, and marketing.  Not a revamp of the entire code base.

I am somewhat veering from the topic and perhaps we can discuss this in another post.  Suffice it to say, I think the existing platform is good and I would not recommend a change.
13 years ago
Many of you already know my thoughts on this - MVC all the way baby!

Andrei, regarding SEO friendly URL (using routing) - I will blog about using routing in nopCommerce (web forms) today.

Mike,

Regarding the disadvantages you stated

1) I disagree that ASP.NET MVC is not easy to understand. Don't get me wrong, it's quite a big learning curve if you've only ever worked with web forms, but one key advantage of MVC is a separation of concerns, that I think improves application architecture.

"If anyone does frequent changes in the database, he/she may find it annoying to keep building application again and again. It may break several other parts of the application"

This does not make any sense. Why would you have to keep rebuilding the application, and why would it make any difference whether you were using webforms or mvc in this case?

2) Using the MVC design pattern with Silverlight is different to ASP.NET MVC. The fact that you can not make direct calls to a database in a silverlight app has nothing to do with MVC. That's the nature of Silverlight. It's running on the client so has to communicate with your database via a proxy.

3) Not true. Read up on Model state. Validation (both server side and client side) in ASP.NET MVC is actually super easy.

"I think it will be better if we wait for ASP.NET MVC to become more mature and stable. "

As we are months away from the third iteration of ASP.NET MVC it's quite clear that MVC is becoming more mature all the time and it certainly is stable.


It seems to me that most people who are saying that ASP.NET MVC is not stable, mature or in it's infancy probably haven't used it excessively. If they had (and I have) you would have a completely different view (no pun intended).
13 years ago
This conversation could easily slip into the MVC vs WebForms debate that is raging all over the web.  There are more than enough resources out there to shed light on this question.

But for a second let's just assume that the MVC camp is 100% correct.  If you changed the code base to a different platform, what effect would that have on the current store owners who want to upgrade?  What effect would that have on the developers who know web forms but not MVC?

There are hundreds of eCommerce platforms in the marketplace.  nopCommerce is still very young and has a long ways to go before it has the numbers that say Magento has.  Do you want to risk the progress you have made so far for a platform that essentially has a better so/C?

When it comes to shop owners all they care about is, "Does it work?".  When it comes to developers most only care, "Can I quickly develop a module that someone will buy?".  I believe that nopCommerce is getting closer to both of these concerns.  With a little refinement and longer periods of stability between releases, I think this can be achieved.

I don't know what the long term goals are for the nopCommerce team.  Maybe an open source platform that eventually morphs into an enterprise edition.  Maybe a custom development business.  Maybe nothing but purely altruistic reasons.  Whatever the reason, ignoring the business concerns is a fatal step and will ultimately render this project moot.  The fact is that very few open source projects ever succeeded without some business, money making component.  Linux has RedHat.  Mozilla has Google.  MySql is now with Oracle.  Instead of talking about what new and fancy platform we can improve to, I think the conversation should be more about  what types of usability, support, and developer friendly refinements can we make to grow the existing platform.

I don't want to come across as  anti-MVC.  I  have worked on a few projects that used this platform and I found it more in tune with what the web was meant to be.  I hate how web forms does things behind the scenes that can be hard to control.  I hate all the viewstate bloat and long rendered server control id's.  But I have learned to work around these and separate my code in a way I feel is clean and better in tune with best practices.  This is all possible with web forms.  It is very easy to write sloppy code in MVC and start introducing logic, markup, etc. where it doesn't belong.  Bad coding practices are possible with any platform.

I just hope that the nopCommerce team looks at what they have and how far the journey has been to this point and then ask, "What are the ramifications of switching to a new platform".  I welcome any comments.
13 years ago
Trevor,

I totally agree that many of these things can be done with webforms, it's just they can be done better/easier in MVC - take DI and unit testing as an example.

That said, there are many improvements that can be made without making this move. The persistence layer needs to be re-factored to follow a more DDD approach. Currently we are using EF in a very database driven way. Improving these things will make it easier if/when we switch to MVC.
13 years ago
Hi Ben,

Unit testing is sort of the 800 pound gorilla in the room for web forms.  Don't get me wrong I get wanting things to be built on the strongest cleanest platform you can build.  I can't tell you how many projects I've had where I wasted time wanting things to be just 'so'.  If the team decides to make the switch then I would say start yesterday.  I'll switch.

Everyday I get more and more inquiries about eCommerce related projects.  Most of the time I put clients in Magento.  I hate doing this.  Magento is a bloated nightmare.  But it works, it has a strong developer network, and most importantly shop owners can find 'bells and whistles' for their shop.

If Apple has taught us anything it's that bells and whistles (and clean design) matter.  Shop owners have zero concept of what is going on behind the scenes.  They just don't care.  I would go so far as saying they don't care about many of the features currently in nopCommerce (like QB integration, payment providers) UNTIL THEY NEED THEM.  

I am literally looking at an email I got 5 minutes ago from a client of mine on Magento who wants the manufacturer logo on each of their product description page.  They saw the idea on Magento Connect and it's selling for 50 bucks.  Love it or hate it, these are the types of things most shop owners care about.  With all of the changes to nopCommerce (I did like the change to EF- WAAYYY easier) I have a hard time putting clients in it because If I designed a custom module for them I couldn't be sure of what would change in the future.

I'm ranting.  I'll stop.  I love this platform and want it go forward.  IMHO fine tune the existing code base where you can, and let's see some developers start adding the bells and whistles that clients want.

This is a good discussion and as always I welcome any comments positive or negative.  Thanks for your feedback Ben.
13 years ago
Hello Ben,

First of all thank you very much for putting light on my views about ASP.NET Model-View-Controller (MVC)

Well whatever i mentioned above are my personal views , i am not someone who is against ASP.NET MVC or in other words "anti-MVC" just like Trevor mentioned in his post.

I have worked on few projects (using MVC framework), and things i mentioned above is what i understood after using this framework. I am not saying that i can't be wrong, i could be wrong because i don't have years of experience in MVC framework (as MVC is new ).

Just like Trevor mentioned above, there are many debates available online, some are in favour on MVC and some are against.

The reason i mentioned that "ASP.NET MVC is not easy to understand" because The MVC pattern introduces new levels of indirection and thereof increases the complexity of the solution. It also increases the event-driven nature of the user-interface code, which can become more difficult to debug.  (Again i would like to mention that i could be wrong i am not a perfect developer in MVC framework)

I know it's a learning curve, but at the same time it works like this - if i say "I know how to work in ASP.NET MVC framework" that doesn't mean all the developers who are working on projects based on nopCommerce know how to work in this new framework.

At the same time it doesn't mean that MVC is not good, ASP.NET MVC is the future of ASP.NET, and eventually all ASP.NET developers will migrate to MVC framework. It's just the matter of time "WHEN IS THE RIGHT TIME"

I am aware of many advantages of using model-view-controller (MVC) based architecture.

Whatever i mentioned above - By that i just wanted to convey a message that if nopCommerce project gets migrated to MVC framework very soon, we don't reach that point when we start feeling that it was too early and too much skills or knowledge have already been invested on the project to move it to this new framework.

Just like Trevor , i also want to mention  - " If you changed the code base to a different platform, what effect would that have on the current store owners who want to upgrade?  What effect would that have on the developers who know web forms but not MVC?"

It's good to think twice before going for any big change, if you have all the answers and solution for all these questions then it is the best time to migrate to this framework.
13 years ago
I didn't take the time to read all of the previous posts nor do I have an existing site, but what I would say about moving to MVC is that it would put nopcommerce in a unique position.  I am a software engineer with 10 years development in ecommerce solutions and think NOP is feature wise way ahead of many other ecommerce solutions (both commercial and open source).  To really differentiate NOP the move to MVC makes sense as it would give NOP the ability to market many commercial solutions as archaic and outdated.  I'm obviously a big fan of MVC because often times I'm handed an html design and it's expected that it would work easily in the chosen ecommerce solution (MVC makes that possible).  MVC is definitely not for everyone and in some ways I agree that it may be a bit immature in the .Net framework but I foresee Microsoft putting their eggs in this basket and if you are the first it would be advantageous to take advantage.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.