And Dll mode on my local machine, because if you would use Pure Live locally, IntelliSense will not work.
It's quite annoying to use Dll mode locally if you do a lot of changes in the backend, but I usually do not change a lot in the backend :) that's why I don't need to regenerate the model and that's why it's better for me locally to use Dll mode.
I like the AppData or API options since you get the page models as class files that include you in your project. API option is if you want the models in a separate reference project rather than in your web project.
I think some of the reasoning behind it is to allow people to use Umbraco without having to compile code in Visual Studio. But I think all the options can be confusing to new developers.
Api means the site acts as an API server, and can return models to the Visual Studio Extension - which brings models right into your Visual Studio solution - and they compile with the solution - the API can also be used with a console tool
AppData means that the site produces models source code - when you ask it to (you need to click a button) or on every change (LiveAppData) - but you then have to compile these files somehow
Dll means that the backoffice produces a Dll containing models - when you ask it to (you need to click a button) or on every change (LiveDll) and then the site restarts
PureLive means that the backoffice produces an in-memory assembly containing models, on every change - and the site does not restart
PureLive was created because it looks cool. And it is cool to use during development phases. It has some drawbacks, though: models can only be used in views. Plus, it is more or less like having your application code files in the App_Code folder: anytime the site restarts, some compilation has to happen. For that reason, usage of PureLive in production is not recommended.
So what should you use? (Or, what do I use?)
I use the API mode with the Visual Studio Extension in all my projects. As soon as you have a Visual Studio solution for your project, I think that is the easiest way. And, the extension is going to evolve in the future, with better error reporting etc.
If your project does not have a Visual Studio solution... or you don't use Visual Studio... then LiveAppData is a good way to generate the files and include them when building the site. It can be "live": it saves a click, and does not hurt.
I know some people also use Dll. And then copy the dll over to their project. But I (and they, at times) find it somewhat confusing, and would avoid it.
Models Builder: Which are the options and why?
Models Builder: Which are the options and why? Explain your opinions and experience. Thanks.
Hello Biagio
Usually, I use Pure Live option on the live site.
And Dll mode on my local machine, because if you would use Pure Live locally, IntelliSense will not work.
It's quite annoying to use Dll mode locally if you do a lot of changes in the backend, but I usually do not change a lot in the backend :) that's why I don't need to regenerate the model and that's why it's better for me locally to use Dll mode.
Thanks, Alex
I like the AppData or API options since you get the page models as class files that include you in your project. API option is if you want the models in a separate reference project rather than in your web project.
Regards, Magnus
Thanks. Why a lot options?
I think some of the reasoning behind it is to allow people to use Umbraco without having to compile code in Visual Studio. But I think all the options can be confusing to new developers.
Regards, Magnus
I know that some options are good for us , developers like API or AppData, but ...
Hey,
I'm Stephan, MB creator and maintainer.
Because people asked for them ;-)
Seriously:
PureLive was created because it looks cool. And it is cool to use during development phases. It has some drawbacks, though: models can only be used in views. Plus, it is more or less like having your application code files in the
App_Code
folder: anytime the site restarts, some compilation has to happen. For that reason, usage of PureLive in production is not recommended.So what should you use? (Or, what do I use?)
I use the API mode with the Visual Studio Extension in all my projects. As soon as you have a Visual Studio solution for your project, I think that is the easiest way. And, the extension is going to evolve in the future, with better error reporting etc.
If your project does not have a Visual Studio solution... or you don't use Visual Studio... then LiveAppData is a good way to generate the files and include them when building the site. It can be "live": it saves a click, and does not hurt.
I know some people also use Dll. And then copy the dll over to their project. But I (and they, at times) find it somewhat confusing, and would avoid it.
Thanks
is working on a reply...