代码改变世界

【收藏】本周ASP.NET英文技术文章推荐[02/03 - 02/16]:MVC、Visual Studio 2008、安全性、性能、LINQ to JavaScript、jQuery

2008-02-18 10:15  Jacky_Xu  阅读(481)  评论(0编辑  收藏  举报

摘要

继续坚持,继续推荐。本期共有9篇文章:

  1. 最新的ASP.NET MVC框架开发计划
  2. Visual Studio 2008 Web开发相关的Hotfix发布
  3. ASP.NET安全性教程系列
  4. ASP.NET MVC的4个其他的View引擎
  5. 通过延迟加载提高ASP.NET页面的性能
  6. 如何成为一个更好的程序员?
  7. LINQ to JavaScript项目
  8. 在客户端JavaScript脚本中嵌入ASP.NET服务器端变量
  9. Visual Studio提供对jQuery语法的智能感知

 

[1] ASP.NET MVC Framework Road-Map Update (最新的ASP.NET MVC框架开发计划)

ASP.NET MVC框架成了香饽饽,很多人讨论得不亦乐乎。Scott也发奋图强大肆介绍,这篇文章中又给出了一些最新的开发计划:

  1. The ASP.NET MVC Framework can be deployed in the \bin directory of an app and work in partial trust
  2. Significantly enhanced routing features and infrastructure
  3. Improved VS 2008 Tool Support
  4. [ControllerAction] Attribute No Longer Required on Controller Action Methods
  5. New Filter Attribute Support for Controllers and Action Methods
  6. HTML Helpers Built-in
  7. Lots of Refactoring and Design Improvements
  8. Downloadable ASP.NET MVC Framework Source that can be Built and Patched

看来ASP.NET MVC框架得开发团队也非常努力啊,不断地添加新的功能,拼命追赶。再一次良好地发挥了微软公司的“优良”传统——敢为人“后”。

Scott在这篇文章中也顺带宣传了一下他其他的一些相关的Blog文章,感兴趣的朋友可以同时参考一下:

  1. Introducing the ASP.NET MVC Framework
  2. ASP.NET MVC Tutorial (Part 1)
  3. ASP.NET MVC Tutorial (Part 2: Url Routing)
  4. ASP.NET MVC Tutorial (Part 3: Passing ViewData from Controllers to Views)
  5. ASP.NET MVC Tutorial (Part 4: Handling Form Edit and Post Scenarios)

 

[2] VS 2008 Web Development Hot-Fix Roll-Up Available (Visual Studio 2008 Web开发相关的Hotfix发布)

Visual Studio 2008在IDE方面有了长足的进步,特别是在Web开发方面。最近发布的这些Hotfix补丁更是让其如虎添翼:

  1. HTML Source view performance
  2. Design view performance
  3. HTML editing
  4. JavaScript editing
  5. Web Site build performance

这个Hotfix可以在此下载:https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826

更多介绍可以参考:http://blogs.msdn.com/webdevtools/archive/2008/02/09/downloadable-hotfix-performance-and-editor-fixes-for-microsoft-visual-studio-2008-and-visual-web-developer-express-2008.aspx

 

[3] ASP.NET Security Tutorial Series (ASP.NET安全性教程系列)

ASP.NET内建了很多有关安全性的支持,这个刚刚开始的、官方的教程正是要介绍这部分特性。与那个《数据访问教程》非常类似(其实作者也是同一个人-_-)。

目前系列中已经有了三篇文章,每篇文章都提供了C#和VB两种不同的示例语言版本:

  1. Security Basics and ASP.NET Support
  2. An Overview of Forms Authentication
  3. Forms Authentication Configuration and Advanced Topics

感兴趣的热心朋友可以联系一下,并翻译出来。

 

[4] 4 Alternative View Engines for ASP.NET MVC (ASP.NET MVC的4个其他的View引擎)

ASP.NET MVC提供了一个默认的View引擎,不过也有替代品——这篇文章中就介绍了4个:

  1. Brail.  The Brail view engine from MonoRail has been ported to ASP.NET MVC and added to MvcContrib.  This view engine lives in MonoRail, but with MvcContrib, it can now be used with ASP.NET MVC Framework controllers.  Ported by Bill Pierce.
  2. NHaml.  Contributed by Andrew Peters.  NHaml provides an internal DSL for XHTML. 
  3. NVelocityAdapted by Hammet and added to MvcContrib with permission.
  4. XSLTContributed by Ivan Porto.

 

[5] Boost ASP.NET Performance with Deferred Content Loading (通过延迟加载提高ASP.NET页面的性能)

所谓延迟加载,其实就是先加载页面中比较“重要”的部分,而待其加载完毕后再用Ajax的方式加载页面的其他部分……

做法不难,文章介绍得也颇具条理,不过值得怀疑的是——这样做究竟能够“提高”多少性能呢?

作者为了说明他的理由,还画了个图(至于效果如何,还请各位读者自己判断吧):

FireBug graph of net requests

 

[6] How to be a better developer? (如何成为一个更好的程序员?)

虽然文章的内容和ASP.NET没什么关系,不过想必不少朋友都乐于讨论这个问题,于是也就放在这里了。

文中总结了几大要素,虽说比较新颖,个人还是感觉有些泛泛:

  1. 了解框架已经提供了什么功能,并恰当地使用
  2. 扩展轮子,而不是重复发明
  3. 写技术文章
  4. 做技术演讲
  5. 编写高质量的代码
  6. 避免编写“临时代码”
  7. 测试代码

 

[7] LINQ to JavaScript (LINQ to JavaScript项目)

LINQ 这个东西很有意思,这位老兄居然也把类似的东西引入到了JavaScript中,语法与“正统”的LINQ颇为神似:

var myList = [
            {FirstName:"Chris",LastName:"Pearson"},
            {FirstName:"Kate",LastName:"Johnson"},
            {FirstName:"Josh",LastName:"Sutherland"},
            {FirstName:"John",LastName:"Ronald"},
            {FirstName:"Steve",LastName:"Pinkerton"}
            ];
            
var exampleArray = From(myList).
                   Where("item.FirstName == 'Chris'").
                   OrderBy("item.FirstName").
                   Select("item.FirstName");

 

[8] Embedding ASP.NET Server Variables in Client JavaScript (在客户端JavaScript脚本中嵌入ASP.NET服务器端变量)

在ASP.NET页面中,我们经常会需要书写如下的代码:

var Company = '<%= Customer.Company %>';

Rick给出了一个辅助的小东西,帮助我们更加“优雅”地生成这部分代码:

protected void Page_Load(object sender, EventArgs e)
{
    wwScriptVariables scriptVars = new wwScriptVariables();
 
    // *** Add any values static or dynamic
    scriptVars.Add("name", "West Wind Technologies");
    scriptVars.Add("entered", DateTime.Now);
    scriptVars.Add("counter",12.22M);
 
    // *** A cleaner way to get ClientIDs into client code?
    scriptVars.Add("txtNameId", txtName.ClientID);
    scriptVars.Add("btnSubmitId", btnSubmit.ClientID);
 
    // *** Add a control's value
    scriptVars.AddDynamicValue("txtName", this.txtName, "Text");
 
    // *** Done
}

最后生成的客户端代码如下:

<script type="text/javascript">
//<![CDATA[
var serverVars = {
    "name": "West Wind Technologies",
    "entered": new Date(1202809550345),
    "counter": 12.22,
    "txtNameId": "txtName",
    "btnSubmitId": "btnSubmit",
    "txtName": ""
}
//]]>
</script>

 

[9] jQuery Intellisense in Visual Studio (Visual Studio提供对jQuery语法的智能感知)

这是本文第二条中介绍的那个VS Hotfix中引入的改进。让“诡异”的jQuery也有了智能感知的支持……不多说了,看图吧(各位jQuery的粉丝,还有什么理由能够拒绝VS的呢?):

newJquery

jqueryIntellisense[5]

jQueryFunctionDocs