论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > asp教程
Tag:入门,文摘,实例,技巧,iis,表单,对象,上传,数据库,记录集,session,cookies,存储过程,注入,分页,安全,优化,xmlhttp,fso,jmail,application,防盗链,stream,组件,md5,乱码,缓存,加密,验证码,算法,ubb,正则表达式,水印,,日志,压缩,url重写,控件,函数,破解,触发器,socket,ADO,初学,聊天室,留言本,视频教程

jsp强于asp,但不是asp.net

文章类别:asp | 发表日期:2008-10-5 20:16:40

By Corey Roth, Senior Web Developer
Special to ZDNet

Fo r a while, the Java 2 Enterprise Edition (J2EE) architecture looked like the best way to develop multi-tiered applications. Java Server Pages (JSP) and servlets had many advantages over the Active Server Pages (ASP) and Component Object Model (COM+) platforms. However, I think that is about to change with Microsoft .Net on the horizon. Microsoft .Net is providing a similar platform but with more functionality, and it quite possibly could have the foundation for being cross-platform at some stage. According to Sun, JSP is better than ASP for the following reasons: It has platform and server independence, it has extensible JSP tags and ASP is interpreted. Luckily, ASP .Net changes all of this.
The biggest argument why Java is superior is that it is a cross-platform environment. Having cross-platform is great, but at what cost? Java is slow by design. With Java, every time you run your program it goes through the Java Virtual Machine, an interpreter, which then converts the Java byte codes to native code. Microsoft may end up having support for platform independence with the way programs are compiled with Microsoft .Net.

When a program is compiled with .Net, it is compiled into a DLL or EXE in Microsoft Intermediate Language (MSIL) format, a processor independent assembly language. MSIL does not contain any dependencies on any particular operating system or architecture. The first time this EXE is executed, it uses Just In Time (JIT) compilation to convert the MSIL into native code. So the first time you run it, it may be slower, but subsequent executions will be faster. As you can see, this has the potential for adaptation to a cross-platform situation, but Microsoft hasn't made any promises of that yet.

Now, I don't know if Microsoft will ever actually convert .Net to work on other platforms, but they are putting the support in there for it. My response to cross-platform is: Who cares? For Java, all that means is that it works on 50 different types of Unix. As far as I am concerned, the Intel platform is the only one that is worth bothering with. Designwise it may be inferior to the Sparc or Alpha, but the Intel platform is the only one Microsoft develops for.

Of tags and scripts
ASP 3.0 does not have extensible tags, an advantage that JSP has held over ASP for quite some time. Now with ASP .Net, extensible tags are available. Through the use of Web Forms, ASP .Net is able to do data binding, form validation and more without the developer having to write any script at all. Developers even have the ability to write their own custom Web Form controls to suit their own needs.

Another problem in the past with ASP was that it was an interpreted language, whereas JSP pages are compiled into servlets the first time the JSP page is accessed. What Sun neglects to mention is that the servlet is still interpreted with the Java Virtual Machine. With ASP .Net, pages will now be precompiled to MSIL and then use JIT compiling, just like JSP. The difference is .Net gets compiled once into native code, and servlets are interpreted every time they are executed. In the long run, I think this will result in .Net code being more efficient.

Microsoft's .Net may not be perfect. Since it still is in beta, it may change quite a bit before it is actually released. However, I think it is a great alternative to what we had before. In the past, using COM and the Microsoft Transaction Server (MTS) was a nightmare for developers and using J2EE was slower than death. I admit for a long time, the J2EE platform was superior to ASP and COM+. With .Net coming soon, Sun should be looking for new ways to improve its platform and remain competitive. Otherwise, it may be losing future developers.

Corey Roth is a Senior Web Developer for Word Spinners, a Tulsa, OK-based Web development company. He has five years of experience in developing Web sites, and started his Web development career at Creative Labs. Corey is also considered a local expert in Microsoft technologies, including Active Server Pages, COM+ and Microsoft Site Server.

Disclaimer: 'Your Turn' is a commentary column written by a ZDNet News reader. The opinions expressed herein are those of the author, not those of ZDNet, ZDNet News nor its editors.


视频教程列表
文章教程搜索
 
Asp推荐教程
Asp热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058