分享
 
 
 

[英文]利用Visual Studio.NET 进行 ASP.NET的WEB开发

王朝asp·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

导 读:本文作者从一个WEB 开发者的角度谈了VISUAL STUDIO.NET 的一些优点,同时还为ASP程序员向.NET 编程转变提出了一些建议.

Web Enabling Visual Studio.NET

If we go back and reflect over recent years, we know Microsoft have been heavily promoting the Internet, often introducing somewhat confusing 'marketure' terms like ActiveX (which is basically just COM) to reflect the fact that their technologies have been internet-enabled and/or refocused/revised to take the internet into account. Microsoft have involved the internet in just about everything they've done since 1996. Although late to enter the internet game, their vision was, and is, still pretty simple: one day soon we won't think twice about developing web-enabled applications, the Web is the future of just about everything so why treat it as anything other than a function of an application? If we start treating the Web as just another deployment platform or feature of an application, and use the same tool set to develop both regular WIN32 applications and web applications, life would be a lot easier.

Microsoft are getting very close to achieving their vision with Visual Studio.NET. At the moment tools like Visual InterDev are web-specific, and tools like Visual Basic and Visual C/C+ are more focused on traditional WIN32 application development. This means to create a web application we have to think differently, and typically learn different object models, programming paradigms and use different toolsets. For example, today I typically use VBScript and/or JavaScript in ASP pages to create web applications. Furthermore I typically have to use Visual Interdev to create the HTML pages.

The fact that I have to use so many tools is a pain. I spend a lot of time developing non-web applications and web applications. Why can't I just use VB or C/++ in my ASP pages ? Why can't VB have the same features Visual Interdev uses so I can use it to design pages without using another app ? OK, I can use components to bridge some of these gaps, but I still have to use ASP script as the glue, and I'm still restricted in what I can do. For example, ASP pages have to use late binding (so COM's multiple interface paradigm is all but useless), and I can't use elementary COM features like events. This is a pain. The good news is that Visual Studio.NET and ASP.NET address these problems.

The release of the next version of Visual Studio (to be called Visual Studio.NET) has merged the development tools we use. For example, VB.NET has all of the features of Visual Interdev (which will probably be depreciated) and can now be used to create ASP applications. Along with these unifications come lots of improvements too: ASP pages can be written in VB or C/C++, ASP pages can use server side events, the new IDE has lots of nice features such as HTML auto tag completion, more MSDN integration, loads more XML support, precise HTML page layout that maps into HTML 3.2, specific browser targeting with fuzzy red underlining logic for HTML tags that won't work with your targeted browser.

Microsoft are making it easier for us to use the web, and the net effect should be more people will embrace it as a standard platform and/or feature. Whilst the Visual Studio.NET toolset are some months away from being released, ASP.NET is probably one of the most signifcant changes. As ASP developers you'll finally be able to use the full power of Visual Studio to aid your development.

Probably the most significant change in ASP.NET is the focus on web forms. The basic idea is you'll design your forms for ASP.NET just as you do for VB or any other language. You'll visually drag and drop UI elements (web controls) and hook up event handlers. The clever bit in ASP.NET is that once the form is rendered in the client browser, interaction with the client form is fired back to the server side form as events, where your code is then executed. ASP.NET provides all the management for the event passing between the client and server. With ASP today, you have to write this routing code yourself.

As part of web forms, ASP.NET also introduces the ability to separate visual HTML/Script elements from code. The model is implemented pretty much as per VB, and greatly improves code management and navigation. The code can still manipulate the HTML page, and in many ways is similar to DHTML in that respect.

Web controls are in many ways very much like ActiveX controls today, except they are client server based, and they output HTML rather than drawing to the screen. VB.NET ships with a large number of web controls, which you can extend or write yourself. The data list control is one of the controls provided. It allows you to point it at a data source, tell it what fields go where, what colours you want and ASP.NET will do the rest, outputting all the various table and row HTML elements. As the control could in theory be browser-aware, it can also take on the responsibility of generating output differently depending upon the client.

Now we've given you a feel for what's coming in Visual Studio.NET and ASP.NET, here are five tips that can get you preparing for it today.

Getting Ready for ASP+

Tip 1 - Learn VB and/or C/C++/C#

ASP.NET allows you to develop pages using VB or C/C++/C#. What basically happens is that pages are compiled and executed on the server. This leads to a signifcant increase in page performances, and also means you can take advantage of COM features such as early binding and true interface based programming. If you don't already know VB and/or C/C++/C# very well, run out to your nearest book shop and start learning it over the next few months.

Tip 2 - Learn COM(+) and Use Components

One of ASP's main strengths is also its main weakness: ASP Script. Whilst inline script code is quick to write and can result in fairly rapid development of a site, it is still script. Script is interpreted, it is for the most part typeless so you use variants everywhere, and scripting engines can't take advantage of early binding, so every method call you make results in an additional call to determine if the method you are calling actually exists. Those are serious overheads.

I strongly suggest you start using COM+ components today, primarily for your business logic. Components resolve all the problems of script, and also provide you with several additional benefits like improved debugging tools. Use ASP script to interact with your business components and generate the UI.

There is some overhead in creating COM objects that does have to be considered, but component creation in IIS5/ASP 3.0 and especially IIS5/ASP.NET is much much quicker so the overheads are reduced.

If you need a primer on ASP components check out Beginning ASP components from Wrox Press. We've got a sample chapter from the book here: http://www.idevresource.com/asp/library/articles/begcom.asp.

Tip 3 - Learn XML

Visual Studio.NET and ASP.NET make far greater use of XML. You at least need to make sure you've got a basic understanding of the differences of XML and HTML, and you should ideally be comfortable with creating and reading XML files.

For an introduction to XML check out 'Professional XML' from Wrox Press (Click here for more details).

Tip 4 - Learn About Processes, Threads and General Concurrency Issues

Whenever you talk about components and the ASP session object you hear nightmares about threads being locked down and scalability dropping. VB.NET allows you to create components that are free threaded. These are basically the same as free-threaded components in C/C++ which can safely be put into the session object. To make sure of this new feature of ASP.NET you need to have a solid understanding of Windows Threading.

Tip 5 - Make sure you have used Visual Interdev

If you've have not used Visual Interdev it is worth your while playing with it. A lot of the features of VI and the controls of things like WFC are likely to be present in Visual Studio.NET. The whole concept of visual development (web forms) is the way ASP.NET is heading.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有