For the record, I am not, as some are, arguing that one should not move to a
model where all of the code and tags are in a single page, but you that one
should realize the consequences of the decision.
Comments inline:
Alan Silver said:
II know this wasn't addressed to me, but I hope you don't mind if I
comment as I'm very interested in what you say.
NP
Please can you define what you mean by that <SNIPPED>
I mean single file per page. Apologies for the confusion.
Why is it not proper OO? The way I understand it, code-beside just
houses the scripting bits in the top of the same physical file as the
HTML. The two are still completely separate. The addition of one small
Ctrl-Z between them would result in code-behind.
Perhaps not the best choice of words, but the core concept behind my
statement is embedding everything in your tagged documents leads to an
obfuscation of your object model. This is not necessarily a bad thing, but
there is no easy way to explicitly derive from Page without a CodeBehind
file. In addition, you are hard pressed to create your own page hierarchy.
Again, I'm not sure what you mean here, please could you explain a bit
more.
Whether you embed all of your code in a single file or use two (ASPX +
CodeBehind), you are working with an object model. In the CodeBehind, the
inheritance is explicit:
public class WebForm1 : System.Web.UI.Page
{
}
When you work with a tagged page (ASPX) alone, you lose the explicitness of
the inheritance and allow the HTTP Runtime to supply inheritance for you. In
most situations, this is not a problem, but it is a factor.
Truth is that I probably wouldn't accept a large project. I like working
on my own. I am my own boss, I get to decide how the project should run,
I design and code to my own standards, and so on. There are
disadvantages, but on the whole I am much happier working like this.
I've been part of a team and I didn't like it. I like to be in control
of the whole thing and you can't do that with a large project.
And that is a decision you have to make. I just suggest that the decision is
made after weighing the factors. I have worked with .NET for about 5 years
now (PDC 2000 beta version) and have seen what can happen when one bucks the
system (not in this respect, however). From seeing plenty of bad ASP.NET, I
am leery of kludging the system.
I do disagree with some who are being far too hardcore, as one can make a
logical decision to move away from the "proper" model. I do not advise it,
but I am not about to blast someone for making a decision that makes sense to
him/her. I would just make sure the decision was one made after weighing the
risks and the rewards.
---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************