c# - Best method for centralised common code across MVC web application? -


I rewriting classic ASP web app using ASP.NET MVC 5.

Currently included in common code files that are required for me to replicate in my new application.

I have done a lot of research and believe that there is a way to go through static methods.

Use a static method for utilities that only use local data or input parameters (in addition to objects)

I plan to use the example methods for utilities I am in need of those others to initialize objects etc.

My question is:

Setting On In InProc with IIS, are the steady ways themselves included or can they be unknowingly referred to by other users?

This app will be installed on a single server, there is no collection of any web form or server etc.

I have also mentioned expansion methods, but Microsoft recommends using them. After all, is there a better way to change the normal code, in which the files are in addition to static methods?

Thanks for reading. Separation of the architecture debate (the lack of data access to utility processes in classic ASP was a common place - I do not think you want to duplicate that MVC, it is better to design some nice layers and all the figures that handle in your model).

To answer the main question to you, yes, static methods are self contained unless you reach a global variable. Ie

  public static string somestring = "xyz "; Public static zero DoSomething () {somestring = "some more"; }  

will literally suck, and a multi user will fly in the environment.

And to answer your final question, see my first paragraph, the best way is to develop the model (data is all used in a domain model), as well as the data access layer is a horizontal in it. At very low refactors, on data access methods in some forms of data access power, behind a set of interfaces - and even if you do not have the time better to rewrite the data / data You are ready to program against a line of at least sand. In this way, you will stop the old crack, which will get you into the new code.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -