Sitecore and MVC3 - asp.net-mvc-3

I am starting a project with Sitecore, I have looked for different possibilities. I have some experience with MVC but I don't understand why you want to combine this with Sitecore (6.4).
What are the benefits? Are there any examples of the implementation of (the code of) this (not the configuration on: http://sdn.sitecore.net/upload/sitecore6/64/integrating%20an%20asp.net%20mvc%20web%20application%20in%20sitecore%20cms-usletter.pdf)?
Or why shouldn't I use MVC with Sitecore?
So when should I use Sitecore 6.4 with MVC3 and when not? And are there any (code)examples?
Thanks in advance!

I've successfully implemented my own MVP implementation using Sitecore. MVP is a bit more forgiving than MVC, and can easily be integrated into web forms based applications. I used T4 templates to generate Models directly from Sitecore templates using the built-in webservices which worked really well.
Sitecore doesn't support MVC yet (in the recommended release), and trying to make it work is probably not worth the effort. I believe they are working on a version that supports MVC properly, which may be the link you provided. However it's probably also very new and there is a lot of functionality in the old version that relies on web forms. I'd like to see it working under MVC in an official capacity for a few more iterations.
Implementing patterns such as MVC and MVP are all about separating concerns and making your presentation layer unit testable. It also encourages more elegant design.
Just reading the doc it looks like this is a guide for running Sitecore in parallel with MVC. I can't see anything about new rendering mechanisms for Sitecore, which would make templating difficult in anything other than web forms. It would however allow you to use the Sitecore API to build your own templates via MVC Views, but you would loose the inline editing functionality that you get out-of-the-box with web forms.

Using mvp is probably the simplest way to go. I wrote a blog post about it here.
However, we have used MVC3 with Razor before and it worked very well. The only issue is you lose the ability to use Page edit mode as you have to do some hacking of sitecore to get it to work. I'm contemplating writing a blog post about it if people are interested.

Just to follow up.. MVC is now supported in 6.6, which will be released on November 5th 2012. We just saw a demo from John West at the Sitecore Symposium and it looks like a great framework. One of the best things about it is that you can use MVC side-by-side with Web Forms. You don't have to make an all-in bet for MVC, you can just slowly migrate or build new components in MVC, while still running Web Forms throughout your site.

Related

Is ReactiveUI.Blazor ready for use ? .. Are there any examples?

.. I'm new to ReactiveUI ..
trying to use ReactiveUI.Blazor .. in Blazor Server Side
.. it has been released but I can't see any examples in the solution
https://github.com/reactiveui/ReactiveUI/tree/master/src/ReactiveUI.Blazor
The only example I can find of Blazor with ReactiveUI
is https://github.com/Nethereum/NethereumBlazor and it's just using ReactiveUI .. not ReactiveUI.Blazor
Any one using ReactiveUI.Blazor ?
cheers in advance
Stu
ReactiveUI is never finished, but there are working samples for Blazor Server-Side (which is now released as of AspNetCore 3.1) and also working samples for Blazor Hosted and Blazor Client models in the ReactiveUI.Samples repository.
You can find the direct link here
TLDR: I had an amazing experience working with Reactive.Blazor in a WASM Blazor application and can absolutely recommend using it.
I used ReactiveUI.Blazor together with Blazorise in platform for managing offers in a more structured way to perform estimates based on the structured (meta)data of the offers.
I used the WASM version of Blazor and my experience was very good. Reactive functional programming (FRP) works well in React and Angular so it seemed like a good fit for Blazor as well.
My review:
The setup was pretty easy. I took a few notes from this arcticle and the code behind it.
I used DynamicData as well, which for me is somehow already part of the whole ReactiveUI stack. It fit very well into the whole application layout, although most of the components in Blazorise do not support the appropriate listeners for collection changes - there you need to support a bit with your code. I absolutely recommend using DynamicData as proxy/cache for your APIs though - state management has never been easier.
The easy form validation, which was a near natural fit for the Blazorise components was for me one of the major selling points - because I rely heavily on dynamic forms.
I am not too happy with the routing and IoC approaches yet. I am used to Autofac for most of my development, which I could easily use my services although for my views and viewmodels I had to rely on a service locator pattern (with Splat backed by Autofac).

Convert ASP .NET MVC 3 project to use CMS

I currently have a simple website that I want to convert to a CMS without losing any of the appearance or existing functionality. Also I would like to re-use my existing code for the site where possible and also make use of our in-house libraries and databases.
Orchard seems like a good bet because it also uses MVC 3 however it seems a bit bloated. There is a small project at atomicCMS which looks interesting. Has anyone used this?
Any hints or tips would be appreciated.
There should be a tag for this post called atomiccms but my account cannot create one.
There was a similar question, which you can find helpful.
Moving an ASP.NET MVC 3-based web application to Orchard is a fairly simple task. You just have to wrap it up in an Orchard module.
I have used both Orchard and N2 CMS. Both work on asp.net mvc.
I like the way Orchard is designed, but it is a rather steep learning curve. Also you will need to develop modules if you want to add your own custom functionallity.
After hearing a .netocks podcast on N2.CMS I decided to try it out for a recent project. It has a different approach/philosophy, you can think of it as a 'plugabble' CMS component. You basically keep your existing web app and can use CMS functionallity where it is required.
However, Orchard does have many more modules and skins available. I would definetly give N2.CMS a closer look, especially if you have an existing application.
In Orchard you must run as an orchard module (Mvc Area) and have no direct access to the root web.config. Depending on what you do in your existing app (wcf, etc...) this might be a limitation. With N2 cms you are not restricted in this manner.

What are the benefits of using MVC 3 framework?

We have started a new Asp .net web project. We plan to do in in MVC. Is it a good practice to use Microsoft's MVC 3 tool or is it good to define our own structure? Web site requirements are normal. Some people suggest if we use microsoft tool we will loose our control in the project????? Any problems that we may face when we use micosoft MVC 3 tool (Razor)?
no really, there isn't any problem -present and future; if you have deep knowledge about issues such as OOP, ASP.NET structure and how it works, MVC architecture, etc. I suggest you strongly use and enjoy ASP.NET MVC 3 and Razor :D
If you are new to MVC then I would suggest go through basic (or advance dependending upon how much you know) MVC tutorials before deciding arch. Things can be done in various ways and it differs from project to project. Once you build your knowledge about things like DomainModel, serviceLocator, IoC, ViewModel, Helpers, repository pattern etc. you will have better idea about which tool to use. I would start looking at some of the sample projects on the codeplex. (would not be too hard to find)
Good luck
If I said yes, would you go ahead and use it? The same goes for building a house or working on any project. What has worked for me, might not work for you. I would start from reading learning resources on here. I would also suggest reading about HTTP protocol and its stateless nature as well as looking at differences between web forms and mvc frameworks. Good luck.

ASP.NET MVC3 CSS framework

I'm wondering, which css framework is best suitable for ASP.NET MVC 3?
I've tried yaml and it has several drawbacks in my opinion, at least using with ASP.NET MVC 3:
uses inputs for buttons by default (so, not compatible with jquery ui, because jquery ui uses buttons in dialogs for example).
you need to adjust css for ASP.NET MVC 3 validation.
I don't like how they describe forms (well that is may be only my
subjective opinion regarding this, anyway you need to use custom
editors if you wish stick to yaml css style).
some css class names are not very intuitive.
Nothing, that would be show stoppers, but maybe there's better alternative - something, that is adapted for ASP.NET MVC specifics, or may be ASP.NET MVC project stub, adapted to yaml css framework.
Update: OOCSS looking good, is lightweight and good structured, worth checking out.
Update 2: TwitterBootstrap is getting popular too, you can get it for asp.net mvc here http://nuget.org/packages/Twitter.Bootstrap
I have used both Blueprint (http://www.blueprintcss.org/) and 960Grid (http://960.gs/) quite successfully with MVC.
But more recently I am leaning towards "BlueLess" (https://github.com/michaek/blueless) - a ".LESS" (http://lesscss.org/) version of Blueprint together with the simply excellent "Chirpy" (http://chirpy.codeplex.com/) VS2010 add-in which automagically converts and minimises CSS, Javascript, LESS, CoffeeScript etc. quite transparently. A simply wonderful tool.
Both Blueprint and 960Grid are for layout and typography ... for form design/styling I would look at the standard JQuery UI framework (http://jqueryui.com/) .. or perhaps the Telerik MVC Extensions (http://www.telerik.com/products/aspnet-mvc.aspx)
Hope this helps.

what are the advantages of MVC3 over MVC2

i am currently learning MVC2. actually working on my first MVC2 project.As the MVC3 beta is launched and available to download. please suggest me should i use MVC3(Beta) or continue with MVC2 and second thing is, if i move to MVC3 then what major advantages i will get from it.
My project is an ERP application.
Please suggest me what should i do.
Thanks
I suggest you take a look at this blog post from Scott Gu :
http://weblogs.asp.net/scottgu/archive/2010/11/09/announcing-the-asp-net-mvc-3-release-candidate.aspx
To name some advantages, you can use the Razor View Engine, which depending on your requirements, it will make your view code nicer. I believe that's the case for an ERP System.
This is not 100% mvc3 related, but with the RC you get NuGet installed with it, if you're planning on using external libraries to help you out, that's a great way to manage them.
Partial Page output caching is a great feature for systems that share bits and pieces across different ui's.
Unobtrusive JavaScript and Validation is also another great new feature that will help you keep your code's maintainability among other benefits.
MVC3 also has some benefits from the dynamic aspects of .NET 4, and that also helps you keep your view code cleaner.
And my end point would be, MVC3 is already on RC stage....it already has Go Live license and support...if you're learning, I would suggest learning the latest, you will get all the knowledge you need to use mvc 1 and 2, and also the new things about mvc 3.
One factor is the release date of MVC 3 compared to the release date of your application, i.e. you should not ship an application based on a beta version of MVC.
If you switch to MVC 3 beta, you should be aware that there may be changes in the final release, so you may have to make changes for each version until the relase, and your application is only guaranteed to work with one specific pre-release version, until the final release of MVC 3.

Resources