|
|
User Controls
|
New User
|
Login
|
Edit/View My Profile
|
|
|
|
ActiveMac
|
Articles
|
Forums
|
Links
|
News
|
News Search
|
Reviews
|
|
|
|
News Centers
|
Windows/Microsoft
|
DVD
|
ActiveHardware
|
Xbox
|
MaINTosh
|
News Search
|
|
|
|
ANet Chats
|
The Lobby
|
Special Events Room
|
Developer's Lounge
|
XBox Chat
|
|
|
|
FAQ's
|
Windows 98/98 SE
|
Windows 2000
|
Windows Me
|
Windows "Whistler" XP
|
Windows CE
|
Internet Explorer 6
|
Internet Explorer 5
|
Xbox
|
DirectX
|
DVD's
|
|
|
|
TopTechTips
|
Registry Tips
|
Windows 95/98
|
Windows 2000
|
Internet Explorer 4
|
Internet Explorer 5
|
Windows NT Tips
|
Program Tips
|
Easter Eggs
|
Hardware
|
DVD
|
|
|
|
Latest Reviews
|
Applications
|
Microsoft Windows XP Professional
|
Norton SystemWorks 2002
|
|
Hardware
|
Intel Personal Audio Player
3000
|
Microsoft Wireless IntelliMouse
Explorer
|
|
|
|
Site News/Info
|
About This Site
|
Affiliates
|
ANet Forums
|
Contact Us
|
Default Home Page
|
Link To Us
|
Links
|
Member Pages
|
Site Search
|
Awards
|
|
|
|
Credits
©1997/2004, Active Network. All
Rights Reserved.
Layout & Design by
Designer Dream. Content
written by the Active Network team. Please click
here for full terms of
use and restrictions or read our
Privacy Statement.
|
|
|
|
|
|
|
|
Time:
06:18 EST/11:18 GMT | News Source:
TechRepublic |
Posted By: Bill Roach |
Visual Studio .NET (VS.NET) provides a very intuitive Web development environment for Visual Basic developers. VB developers have been trained for years to drag and drop their visual interface on the design surface and then double-click on an element when they want to write code that controls it. I think one of the crowning achievements of VS.NET is the way that it has taken the Windows software design and message loop paradigm and mapped them to a stateless environment like the Web. Once you begin writing production applications, you quickly find that the mapping isn't perfect, but VS.NET's ability to bring Windows programmers into Web development quickly is nothing short of remarkable.
|
|
#1 By
1845 (12.209.152.69)
at
2/18/2003 8:50:38 AM
|
Of course you should use code-behind. The only draw back is when vs.net decides to delete your event wiring. If need be (particularly for data binding senarios) you can still inline code on the aspx page, even though the rest of your logic is in the aspx.cs.
|
#2 By
135 (209.180.28.6)
at
2/18/2003 9:59:36 AM
|
One thing I've noticed... If you have something like 75 aspx pages, and a code-behind DLL which is around 1.5 Megs in size...
It takes about 30 seconds for the first page to come up. After that it's pretty fast, but wow that initial compile takes a while. :)
|
#3 By
7390 (198.246.16.251)
at
2/18/2003 10:57:22 AM
|
#2 soda, unless you are debugging the application I don't that as an issue. Since as pointed out this occurs the first time that the app is compiled.
About the article, let me get this straight. The downside is that all of those non programmers that jumped to ASP have to learn structured programming?
as an MCSD and one studying for his MCAD this is "all good"
|
#4 By
2332 (65.221.182.3)
at
2/18/2003 12:33:57 PM
|
#2 - sodablue - 30 seconds seems a bit long.... but...
The process that ASP.NET goes through when first creating the pages is as follows:
1.) For each assembly in the /Bin folder, find all ASPX files reference them, and parse the files.
2.) Convert each aspx file to a class that inherits from the code behind abstract class specified in your page declaration.
3.) Once all aspx files (or ascx, etc.) have been converted to classes, compile these files into a new assembly that lives in \%SystemRoot%\Microsoft.NET\Framework\v1.0.nnnn\Temporary ASP.NET Files. (Along with lots of xml and tmp files that help ASP.NET figure stuff out.)
4.) Load up the class into the aspnet_wp.exe process, and execute the appropirate methods on the appropriate classes to render the page in question.
So since the assembly needs to contain all the class files for all the aspx pages in your site, that's why it takes so long the first time when there are tons of pages.
As long as you don't modify any of the aspx files (or the DLLs for that matter), ASP.NET simply uses the compiled assembly that lives in the temporary directory... so it's nice and fast.
|
#5 By
20 (24.243.41.64)
at
2/18/2003 11:25:48 PM
|
You shouldn't be using ASPXs in the first place.
ASP.NET has a wonderful, reusable, browser-independent object-oriented server control approach to presentation.
Why muck with that icky, unmaintainable, browser-specific tag-based approach?
My ASPX's have one line in them, it's a <%@ Page directive that points to the code behind which does very little but load up business objects and server controls.
Server controls are quite wonderful once you learn how to develop them and think in that pattern.
Everything in ASP.NET is a server control, ASPXs are even compiled to server controls on the fly (look at the generated source, they inherit from the code-behind which inherits from Page which is <drum roll> a Server Control!)
Save yourself the mess and horror of ancient tag-based crap like ASP, ASPX, and JSP.
|
#6 By
20 (24.243.41.64)
at
2/18/2003 11:28:17 PM
|
#6: It's crazy how few people know about the wonderful Server Control/Post-Back/Event-driven model of ASP.NET.
People are distracted (and MS is foolishly pushing) by ASPX tag-based designs when there's this great object-oriented model behind.
I've used Apache Struts in Java which was nicer than the basic JSP model, and I've used ASP and ASPXes, but I think the Server Control pattern is much more nice.
|
#7 By
2332 (65.221.182.3)
at
2/19/2003 9:14:46 AM
|
#7 - "You shouldn't be using ASPXs in the first place."
You don't put any presentation in your ASPX files? I think you're missing a big part of ASP.NET.
The reason ASPX/ASCX/ASMX/etc exist is so that the presentation can be changed without having to manually recompile your code. This allows for things like WYSIWYG editing of your presentation tier by developers without any knowledge of the business logic that powers that presentation. It's complete seperation of code and content.
The ASPX file is meant to be the first part of a 2 part presentation tier, with your code behind being the second part.
Indeed, your business objects should not live in your code behind... but instead in your middle tier, which is a set of seperate assemblies.
Lastly, how do you accomplish databinding with controls like the DataGrid (or any other data aware server control, for that matter)? While it's possible to do this 100% in the code behind, it's incredibly tedious and a huge waste of time.
You yourself said it! The ASPX is compiled into a class that adds these tags as literal/html/server controls to the control tree anyway... so why not take advantage of the capabilities a WYSIWYG editor gives you?
|
#8 By
20 (24.243.41.64)
at
2/19/2003 1:36:54 PM
|
#9
You don't put any presentation in your ASPX files? I think you're missing a big part of ASP.NET.
No, indeed I'm not. ASPX is a hack. The true model in ASP.NET is server controls. The tag-based unmaintainable crap from ASP is done for. ASPX is a hack to allow VB/ASP folks make an easier transition, but the world of web applications has moved on and there are now better object-oriented ways of representing display that doesn't involve a single line or tag of HTML.
The more you can seperate yourself from HTML, the better, and server controls do this very, very well. That's the *POINT* of ASP.NET, in case you missed it.
The reason ASPX/ASCX/ASMX/etc exist is so that the presentation can be changed without having to manually recompile your code.
Yes, that's great, but it's still hacky and that's not a valid reason to sacrifice browser-compatability, maintainability, and more consistent, clean code by not having to deal with tags.
This allows for things like WYSIWYG editing of your presentation tier by developers without any knowledge of the business logic that powers that presentation. It's complete seperation of code and content.
WYSIWYG with HTML is impossible. I have yet to ever see a WYSIWYG HTML editor (including DreamWeaver) that didn't produce completely incomprehensible HTML that was completely unmaintainable and VS.NET is probably worst among the bunch.
Unless you're developing a little mom-and-pop app, you would be very wise to completely avoid any tag-based approach and DEFINATELY avoid the "WYSIWYG" crap of VS.NET or WebMatrix.
VS.NET is more like WYGIWYG (What you get is what you get).
Compiling is not a problem, IMHO. Even during development when you're redoing it a lot. VS.NET compiles quickly, and VS.NET 2003 incredibly quickly and once the app is first started (which includes CLR initialization + app initialization), you just have to deal with app initialization from then on which is usually pretty small.
And on large apps that have to preload a cache or something that takes a long time during first app startup, I have a switch that turns on "development" or "debug" mode that skips any long processes on startup.
Do us all and yourselves a favor and avoid tag-based web application development! Its time has come and gone and anyone who's had to maintain an ASP application will tell you that it's none too soon.
|
#9 By
2332 (65.221.182.3)
at
2/19/2003 7:18:23 PM
|
#10 - "No, indeed I'm not. ASPX is a hack."
I couldn't disagree more.
"The more you can seperate yourself from HTML, the better, and server controls do this very, very well. That's the *POINT* of ASP.NET, in case you missed it."
No, I didn't miss that... it's ONE point, but you can go overboard. The POINT of ASP.NET is to make applications easier to develop, maintain, deploy, and reuse. Your strategy sacrifices all of these.
"Yes, that's great, but it's still hacky and that's not a valid reason to sacrifice browser-compatability, maintainability, and more consistent, clean code by not having to deal with tags."
Not a valid reason? It's one of the primary goals of ASP.NET. Seperation of code and content. Compatability is not sacrificed if you do a simple layout inside the ASPX. Maintainability!? You HAVE to be kidding me. It's easier to maintain HTML that's buried inside an assmebly than it is to simply modify some HTML in the ASPX file?
"WYSIWYG with HTML is impossible. I have yet to ever see a WYSIWYG HTML editor (including DreamWeaver) that didn't produce completely incomprehensible HTML that was completely unmaintainable and VS.NET is probably worst among the bunch."
No you're just being silly. Dreamweaver is EXCELLENT with the HTML it creates. I challenge you to provide me with HTML that Dreamweaver created that's not as good if not better than what could be done by hand. While the VS.NET WYSIWYG editor is iffy, I don't use it all that much. I do my presentation in Dreamweaver MX, and my codebehind in VS.NET.
"Unless you're developing a little mom-and-pop app, you would be very wise to completely avoid any tag-based approach and DEFINATELY avoid the "WYSIWYG" crap of VS.NET or WebMatrix."
I find it very hard to believe you've ever done any large scale applications that needed to be maintained and deployed in ASP.NET. If you had, you would never be saying what you're saying.
"Compiling is not a problem, IMHO."
Ok, how about this. All your assemblies are signed with a strong name. You see a simple spelling mistake on one of your pages. In your world, you would need to change it in the assembly, recompile, and resign. Resigning is not a trivial process in an environment where the key is closely guarded. (If you have your strong name key, you're not in a position to be talking about this... only one or two people in an entire company should have the key, and a developer should not be one of them.)
In my world (aka the real world), I simply make the change and save the file. Done. No resigning needed.
Now take all this one step further. You code goes through multiple steps after complication... binary checks, obfuscation, signing, etc. Now, to make your single spelling fix, you must involve multiple people, multiple steps, and multiple places for things to go wrong.
In my world, none of that applies.
"Do us all and yourselves a favor and avoid tag-based web application development! Its time has come and gone and anyone who's had to maintain an ASP application will tell you that it's none too soon."
Um... no. You don't appear to have a grasp of the importance of the seperation of code, content and presentation. Do us all a favor and keep these insane "strategies" to yourself.
By the way, you still haven't answer my data binding question.
|
#10 By
1845 (12.209.152.69)
at
2/20/2003 9:46:16 AM
|
i'll second RMD's comments and ask daz for a reference app. I just can't believe that you're saying what I think I'm understanding. Rather than jump to conclusions, I think I must be understanding something wrong and would like to see a sample of this design pattern.
|
|
|
|
|