Hi,
If i try to map the ASP.NET model to the JSP+Servlet model, would it be
metaphorically correct to map the .aspx page to a JSP, and the 'code behind'
to the 'controller' or servlet , in a MVC kind of architecture ?
Regards,
Chak.
No, it's incorrect. JSP corresponds to the older ASP architecture, where
the code (script) and the HTML code were mixed in a single file (and
also included files).
In ASP.NET, the ASPX file is a front-end for the UI components (in HTML
form), and the code-behind contains an intermediate layer between the UI
and the business layer. The business layer can be anything, DLLs, EXEs,
etc...
In other words, ASP.NET presents a cleaner separation between UI
components and code for the presentation layer.
Note however that it is still possible to write .NET code directly in
the ASPX page, thus coming closer to the ASP model, but it's not
recommended for a number of reasons.
Servlets are a different kind of "animal", they are more similar to
exposing an EXE through an URL. When called, the component examines the
HTTP requests, and creates a HTTP response, but it doesn't have a HTML
front end like in ASP, JSP or ASPX. I would compare servlets more to a
web service, which ASP.NET also has.
These concepts are a little difficult to explain without a schema, so I
apologize if I wasn't clear enough (or if I misunderstood one concept or
the other).
HTH,
Laurent