asp magically supports two syntaxes: JScript and VBScript
I've never seen anyone do ASP's MVC haha, I guess it must be a pain in the ass for those who implement it:
My opinion is:
Unified entry point
Analysis module and action
Then use regular expressions and FileSystemObject to process the module and action asp files and generate them in the runtime directory,
Then call these files under runtime every time.
Of course you have to implement things like import require include etc.
Don’t ask me this question: Does it hurt or not? I only know that I feel bad. Haha
Of course, those who use ASP are generally small-scale systems. For example, cms or something, don’t expect it to be large-scale, so I am doing this under small-scale conditions
给我你的怀抱2017-05-16 17:08:51
In fact, it is not necessary to unify the entry points. Let asp analyze the url... If there are many url rules, the efficiency will be too low... If you don't care about the url, you can also use get to get the action.
In fact, the purpose of mvc is to divide labor into layers. If this purpose can be achieved, it will be ok.
If there is a script with the URL /articles.asp and the corresponding file is D:projectwebarticles.asp, then this file can be regarded as a controller. If there is a model file D:projectmodelarticles.asp that can obtain data, and this file defines There are several methods to obtain articles data, and the view file D:projectviewarticles.asp, the controller can be written like this:
<!--#include file="..\model\articles.asp"--> set articles = getArticleList(); <!--#include file="..\view\articles.asp"-->
高洛峰2017-05-16 17:08:51
Have you tested it? I thought about doing this (single entry) in 2005, but after testing, ASP 3.0 does not support dynamic include. Writing like this will not take effect, include will not pay attention to the previous if/else:
if (condition a)
include a.asp
else if (condition b)
include b.asp
I wonder if the new version of ASP supports this feature after 6 and a half years