Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Biagio Paruolo 1472 posts 1611 karma points c-trib
    21 days ago
    Biagio Paruolo
    0

    Models Builder: Which are the options and why?

    Models Builder: Which are the options and why? Explain your opinions and experience. Thanks.

  • Alex Skrypnyk 5333 posts 19667 karma points MVP 3x admin c-trib
    20 days ago
    Alex Skrypnyk
    0

    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

  • Magnus Eriksson 89 posts 203 karma points
    20 days ago
    Magnus Eriksson
    0

    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

  • Biagio Paruolo 1472 posts 1611 karma points c-trib
    20 days ago
    Biagio Paruolo
    0

    Thanks. Why a lot options?

  • Magnus Eriksson 89 posts 203 karma points
    20 days ago
    Magnus Eriksson
    0

    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

  • Biagio Paruolo 1472 posts 1611 karma points c-trib
    18 days ago
    Biagio Paruolo
    0

    I know that some options are good for us , developers like API or AppData, but ...

  • Stephen 766 posts 2260 karma points c-trib
    18 days ago
    Stephen
    1

    Hey,

    I'm Stephan, MB creator and maintainer.

    Why a lot of options?

    Because people asked for them ;-)

    Seriously:

    • 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.

  • Biagio Paruolo 1472 posts 1611 karma points c-trib
    1 week ago
    Biagio Paruolo
    0

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft