June 2008 - Posts
摘要: 由于本人的博客申请了阿里妈妈的广告栏,所以有的时候经常上去看看,由于这些年来的职业习惯养成了我只要上一个网站都要习惯性的打看一个网页源程序看看,由于今天上午比较轻闲所以就打算盗版一下阿里妈妈的登录页面,不成想,阿里妈妈的登陆页面里面用到了一个我非常喜欢的CSS技巧,所以也就引出了这一篇真心盗版阿里妈妈了。 首先让我们先打开阿里妈妈的登录页面看一下:在上面重点的划框的地方就是我们今天要盗版的地方,
阅读全文
[新闻]阿里巴巴挖人升级电子商务平台
一.概述:
留言簿是网站的一个重要组成部分,是访问者发表意见的场所,也是网站管理员了解网站基本运行情况的有力工具,所以留言簿在现在的网站中扮演了十分重要的角色。
不过在以前开发一个留言簿并不是一件容易的事,开发者的工作量往往会很大。而现在随着微软推出VS.NET,相应的技术也推陈出新。特别是XML技术在.NET Framework中的广泛运用,使得整个.NET构架具有十分优越的基础。而ASP.NET中推出的崭新的编程模型更使得开发Web应用程序变得非常容易。本文就结合ASP.NET技术和XML技术的优点向大家介绍如何打造一个属于自己的留言簿。
二.实现方法:
一个基本的留言簿应至少包括两个功能:接受用户输入的信息并保存该信息到后台数据库;显示用户输入的信息。用户输入的信息一般包括用户名、Email地址、QQ号码、用户主页、留言信息等,这些信息通常是保存在后台数据库的某个表中的,不过本文要运用一个XML文件来存储这些信息。显示用户输入的信息时一般得把所有的信息都显示出来,这里的方法就是从XML文件中读取数据并运用XSLT技术对其进行格式转换,最后以HTML的形式显示在浏览器中。
这样,我们的留言簿就需要两个Web页面,一个用于接受用户的输入信息,另一个用于显示用户已经输入过的信息。而存储信息的XML文件(guestbook.xml)则需具有如下的结构:
<?xml version="1.0" encoding="GB2312"?>
<guestbook>
<guest>
<name>令狐冲</name>
<email>doose@etang.com</email>
<qq>10102350</qq>
<homepage>www.doose.com</homepage>
<comment>本留言簿由"令狐冲"创建,希望你能喜欢哦:)要知道如何创建一个属于自己的留言簿,那么就请仔细阅读《运用ASP.NET和XML技术打造留言簿》一文!</comment>
</guest>
</guestbook> |
下面我们先来创建用于接受用户输入信息的Web页面-GuestBook.aspx。根据前面所提的基本要求,该Web页面包括了以下几个部分:留言簿标题、"用户名:"标签及输入框、"Email地址:"标签及输入框、"QQ号码:"标签及输入框、"个人主页:"标签及输入框、"留言信息:"标签及输入框、一个"确定"按钮、一个"重置"按钮、一个"查看留言簿"按钮,同时该页面还包括了两个验证按钮,分别用于验证用户名以及Email地址是否为空,若为空,则提醒用户输入。同时,为使留言簿具有良好的用户界面,我运用了表格进行页面布置,这样留言簿中的各个成分就能有条有理,层次分明了。有关该Web页面的详细代码请参考文后附带的源代码,这里就不给出了。页面布置的图示如下:

图1
完成了该Web页面的布置,我们仅仅是完成了一部分的工作,到此为止我们并没有进行过真正的编码。我想大家对ASP.NET中的代码后置技术肯定是了解或熟悉的,它将Web页面的布置工作和后端的编码工作区分开来,达到了良好的分离效果。下面我们就为该Web页面中的三个按钮分别编写消息相应函数:
private void btnOK_Click(object sender, System.EventArgs e)
{
SaveXMLData();
name.Text = "";
email.Text = "";
qq.Text = "";
homepage.Text = "";
comment.Text = "";
}
private void btnReset_Click(object sender, System.EventArgs e)
{
name.Text = "";
email.Text = "";
qq.Text = "";
homepage.Text = "";
comment.Text = "";
}
private void btnView_Click(object sender, System.EventArgs e)
{
// 显示所有用户的留言信息
Response.Redirect( "ViewGuestBook.aspx" );
} |
其中,第一个按钮是最重要的,它能将用户的输入信息存储到XML文件中,调用的方法就是SaveXMLData();而第二个按钮仅仅完成文本框的重置清空工作;第三个按钮的作用是运用另一个Web页面显示所有的用户输入信息。同时,第一个按钮在成功保存信息后也会将浏览器导向到显示所有用户输入信息的页面。
下面我们来详细分析一下SaveXMLData()方法,其实现如下:
private void SaveXMLData()
{
try
{
// 创建一个XmlDocument对象,用于载入存储信息的XML文件
XmlDocument xdoc = new XmlDocument();
xdoc.Load( Server.MapPath( "guestbook.xml" ));
// 创建一个新的guest节点并将它添加到根节点下
XmlElement parentNode = xdoc.CreateElement( "guest" );
xdoc.DocumentElement.PrependChild( parentNode );
// 创建所有用于存储信息的节点
XmlElement nameNode = xdoc.CreateElement( "name" );
XmlElement emailNode = xdoc.CreateElement( "email" );
XmlElement qqNode = xdoc.CreateElement( "qq" );
XmlElement homepageNode = xdoc.CreateElement( "homepage" );
XmlElement commentNode = xdoc.CreateElement( "comment" );
// 获取文本信息
XmlText nameText = xdoc.CreateTextNode( name.Text );
XmlText emailText = xdoc.CreateTextNode( email.Text );
XmlText qqText = xdoc.CreateTextNode( qq.Text );
XmlText homepageText = xdoc.CreateTextNode( homepage.Text );
XmlText commentText = xdoc.CreateTextNode( comment.Text );
// 将上面创建的各个存储信息的节点添加到guest节点下但并不包含最终的值
parentNode.AppendChild( nameNode );
parentNode.AppendChild( emailNode );
parentNode.AppendChild( qqNode );
parentNode.AppendChild( homepageNode );
parentNode.AppendChild( commentNode );
// 将上面获取的文本信息添加到与之相对应的节点中
nameNode.AppendChild( nameText );
emailNode.AppendChild( emailText );
qqNode.AppendChild( qqText );
homepageNode.AppendChild( homepageText );
commentNode.AppendChild( commentText );
// 保存存储信息的XML文件
xdoc.Save( Server.MapPath( "guestbook.xml" ));
// 显示所有用户的留言信息
Response.Redirect( "ViewGuestBook.aspx" );
}
catch( Exception e ) {}
} |
该方法主要运用了XmlDocument类、XmlElement类以及XmlText类等,这些类都是包含在System.Xml命名空间中的,所以请在代码文件的开头处添加using System.Xml的语句。该方法运用了一个try-catch语句块,在try部分首先通过创建一个XmlDocument对象来载入XML文件,然后创建根节点的儿子-guest节点并在guest节点下添加存储信息所必须的五个子节点。所有这些子节点都是XmlElement对象,它们是通过XmlDocument对象的CreateElement()方法来获取的。同时,XmlDocument对象还通过CreateTextNode()方法来获取文本信息并在后面将其添加到相对应的节点中。在合理的添加guest节点及其子节点以及文本信息后,XmlDocument对象通过Save()方法将用户输入的信息保存到XML文件中。最后,浏览器会导向到显示所有用户输入信息的页面。这样,该Web页面运行的效果如图2所示:

图2
下面我们来创建用于显示所有用户输入信息的页面-ViewGuestBook.aspx。在该Web页面中,我们要运用到XSLT技术,它能将前面创建的XML文件中的数据以HTML的形式显示出来。由于是运用XSLT技术显示用户输入信息的,所以在设计该Web页面时我们无需添加任何Web控件,只要重载该Web页面的Load()方法即可。
private void Page_Load(object sender, System.EventArgs e)
{
// 创建一个XmlDocument对象以载入存储信息的XML文件
XmlDocument xdoc = new XmlDocument();
xdoc.Load( Server.MapPath( "guestbook.xml" ));
// 创建一个XslTransform对象并导入XSL文件
XslTransform xslt = new XslTransform();
xslt.Load( Server.MapPath( "guestbook.xsl" ));
string xmlQuery = "//guestbook";
XmlNodeList nodeList = xdoc.DocumentElement.SelectNodes( xmlQuery );
MemoryStream ms = new MemoryStream();
xslt.Transform( xdoc, null, ms );
ms.Seek( 0, SeekOrigin.Begin );
StreamReader sr = new StreamReader( ms );
// 显示输出结果
Response.Write( sr.ReadToEnd() );
} |
该方法首先创建一个XmlDocument对象用于载入前面创建的XML数据文件,之后创建一个XslTransform对象并导入相应的XSL文件。通过该XSL文件中的内容它能将原来的XML文件中的数据格式化为HTML的形式并显示在浏览器中。因为其中运用到了XSLT转换,所以我们还得在代码文件的开头处添加using System.Xml.Xsl的语句。
下面便是XSL文件的源代码,其中最重要的部分是<xsl:template match="name">……</xsl:template>一块。
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<table border="1" style="border-collapse: collapse" bordercolor="Teal" align="center" width="505" height="34">
<tr>
<td valign="middle" align="center" bgcolor="Teal" colspan="2" width="505" height="85">
<font style="color:White;background-color:Teal;font-family:华文行楷;font-size:X-Large;font-weight:bold;">欢迎访问"令狐冲"的留言簿!</font>
</td>
</tr>
<tr><td width="505" height="26" align="left" colspan="2"></td></tr>
<xsl:for-each select="//guest">
<xsl:apply-templates select="name"/>
</xsl:for-each>
<tr>
<td valign="middle" align="center" colspan="2" width="505">
<font>
本留言簿由<a href="mailto:0024108@fudan.edu.cn">王凯明</a>开发! </font>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="name">
<tr>
<td width="95" height="26" align="right">
<font>用户名:</font>
</td>
<td width="400" height="26" valign="middle" align="left">
<font><xsl:value-of select=''.''/></font>
</td>
</tr>
<tr>
<td width="95" height="26" align="right" bgcolor="e0e0e0">
<font>Email地址:</font>
</td>
<td width="400" height="26" valign="middle" align="left" bgcolor="#e0e0e0">
<font><a HREF="mailto:{../email}"><xsl:apply-templates select="../email"/></a></font>
</td>
</tr>
<tr>
<td width="95" height="26" align="right">
<font>QQ号码:</font>
</td>
<td width="400" height="26" valign="middle" align="left">
<font><xsl:apply-templates select="../qq"/></font>
</td>
</tr>
<tr>
<td width="95" height="26" align="right" bgcolor="#e0e0e0">
<font>个人主页:</font>
</td>
<td width="400" height="26" valign="middle" align="left" bgcolor="#e0e0e0">
<font><a HREF="http://{../homepage}" target="_blank"><xsl:apply-templates select="../homepage"/></a></font>
</td>
</tr>
<tr>
<td width="95" height="26" valign="top" align="right">
<font>留言信息:</font>
</td>
<td width="400" height="26" valign="top" align="left">
<font><xsl:apply-templates select="../comment"/></font>
</td>
</tr>
<tr><td width="505" height="26" align="left" colspan="2"></td></tr>
</xsl:template>
</xsl:stylesheet> |
这样,当用户点击"查看留言簿"按钮或是成功输入信息后浏览器便导向到该显示所有用户输入信息的Web页面,其运行效果图示如下:

图3
三.总结:
这样,一个具有基本功能的留言簿就完成了,从中我们可以体会到运用ASP.NET技术开发Web应用程序是相当容易的,同时在结合了XML技术之后,ASP.NET可以变得更加强大。还有文章中介绍的XSLT技术是非常有用的,你可以参考其它相关的更多资料以使它成为你开发过程中的一个有力工具。
[新闻]AMD推出下一代笔记本电脑平台Puma 称比Intel性能高三倍
使用VB构建程序逻辑
在用户界面完成以后,现在做些有用的代码——比如,在按钮中显示当前时间。
在Solution Explorse中双击Page.xaml.vb文件,在代码编辑器中载入它。
在Page_Loaded()小段中,增加如下行:
以下是引用片段:
Partial Public Class Page
Inherits Canvas
Public Sub Page_Loaded(ByVal o As Object, ByVal e As EventArgs)
'' Required to initialize variables
InitializeComponent()
Me.Timeline1.Duration = New Duration(New TimeSpan(0, 0, 1))
Me.Timeline1.Begin()
End Sub
|
在代码中,Timeline1每秒触发一个事件(Completed事件),通过Duration对象设置。Timeline对象和Windows程序员熟悉的Timer控件很类似。Begin()方法开始倒计时,一秒后Completed事件触发。
下一步是在Completed事件完成后干什么,你可以在代码编辑器里选择Timeline1对象,然后选择Completed事件,如图14。
498)this.style.width=498;"> |
| 图14 |
编写如下Completed事件代码:
以下是引用片段:
Private Sub Timeline1_Completed( _
ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles Timeline1.Completed
Dim textBlk As TextBlock = Me.btnTime.Children(1)
textBlk.Text = Now.ToString
Me.Timeline1.Begin()
End Sub
End Class
|
基本的,你通过获取嵌入在canvas(btnTime)中的TextBlock控件来设置当前时间及其Text属性。Canvas有两个孩子:
◆Children(0): Rectangle control
◆Children(1): TextBlock control
在显示时间后,你呼叫Begin()方法来开始重新倒计时。
好,完成了!在VS2008中按下F5,你将看到IE中显示当前的Silverlight程序。如果你在Firefox浏览器中调用,效果也是一样的。如图15.按钮每秒更新一次时间。
498)this.style.width=498;"> |
| 图15 |
变化
现在你有第一个Silverlight程序运行着了,试着做一些动画吧。作为例子,让我们来修改它,使其旋转和更新时间。
使用相同的工程,在Expression Blend2 中增加一个新的Timeline到XAML文件中。在增加了新的Timeline之后,你的XAML代码看起来是这样的:
以下是引用片段:
Partial Public Class Page
Inherits Canvas
Public Sub Page_Loaded(ByVal o As Object, ByVal e As EventArgs)
'' Required to initialize variables
InitializeComponent()
Me.Timeline1.Duration = New Duration(New TimeSpan(0, 0, 1))
Me.Timeline1.Begin()
End Sub
|
在Page.xaml.vb文件里,声明一个名为degrees的私有成员变量:
以下是引用片段:
Partial Public Class Page
Inherits Canvas
Private degrees As Integer = 0
|
[新闻]商业周刊:诺基亚Symbian免费开放帮了Google
为了使得按钮显示当前时间,你需要每秒刷新一下时间。增加一个Timeline到你的XAML文件中。点击Objects和Timeline组中的>箭头,按照+按钮的指示。图11所示。
498)this.style.width=498;"> |
| 图11 |
你会被要求命名新的Timeline。使用缺省的名称Timeline1点击OK。
你的XAML文件现在看起来像图12所示。保存XAML文件。
498)this.style.width=498;"> |
| 图12 |
当你转回到VS2008时,它会询问你是否重新载入Page.xml因为它在编辑器以外被修改了。当你重新载入之后,XAML内容如下:
以下是引用片段:
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="parentCanvas"
Loaded="Page_Loaded"
x:Class="OurFirstSilverlightProject.Page;assembly=ClientBin/
OurFirstSilverlightProject.dll"
Width="640"
Height="480"
Background="White"
>
Stroke="#FF000000" StrokeThickness="3" RadiusX="8"
RadiusY="8"/>
Canvas.Top="11" Text="TextBlock" TextWrapping="Wrap"
FontFamily="Comic Sans MS"/>
|
如图13所示。
498)this.style.width=498;"> |
| 图13 |
为了使得canvas对象可以通过编程访问,增加x:Name属性,并设置位btnTime,像这样:
以下是引用片段:
Canvas.Left="8" Canvas.Top="8">
|
注意在Expression Blend2中,你可以切换Design和XAML视图(如图13)。不幸的是,目前XAML视图中不支持IntelliSense。
[新闻]澳洲电讯或将整合皓辰及泡泡网实现整体上市
现在我们为这个页面增加一写控件。首先,创建一个圆角按钮,如图6所示。有了这个按钮,你可以在上面增加一些文字描述信息。
498)this.style.width=498;"> |
| 图6 |
首先,点击Canvas控件(如图7)并且将其增加到页面上。Canvas将会作为容器来包含所有组成这个按钮的控件。
498)this.style.width=498;"> |
| 图7 |
为了创建按钮的边框,增加一个Rectangle控件到页面上,覆盖你刚才增加的canvas。图8。
498)this.style.width=498;"> |
| 图8 |
为了创建四个圆形边角,点击Direction Selection图标并且选择你刚增加的Rectangle控件。如图9所示,设置Rectangle的属性如下:
◆RadiusX - 8
◆RadiusY - 8
◆StrokeThickness - 3
498)this.style.width=498;"> |
| 图9 |
另外,你也可以设置背景为黄色,如图9所示。
为了显示按钮中的文字,你需要增加一个TextBlock控件到canvas上,如图10。同时,设置字体为Comic Sans MS。
498)this.style.width=498;"> |
| 图10 |
[新闻]唐骏出任港澳资讯董事长 自称不会离开IT业
在Solution Explorer中,点击Show All Files按钮来查看所有VS自动生成的代码。图2显示了所有文件。
498)this.style.width=498;"> |
| 图2 |
下面一节包含了该Silverlight工程里的基本文件的讲解:
TestPage.html
这是一个测试页,用来测试Silverlight程序。它包含了Silverlight控件并引用了两个JavaScript文件:Silverlight.js和TestPage.html.js。下面是Testpage.html的内容:
包含Siverlight控件的HTML页面页可以包含通常的HTML元素来构成一个web页面。当你双击Solution Explorer中的Testpage.html,VS2008将会在一个分离视图里展示页面,这是VS2008的新特性。使用分离视图,你可以在浏览HTML代码时同时预览它在浏览器中的效果。如图3。
498)this.style.width=498;"> |
| 图3 |
TestPage.html.js
这个文件包含了一个Javascript函数,装载Silverlight控件到web页上。它也引用了一个包含Silverlight程序的用户界面定义的XAML文件。
以下是引用片段:
// JScript source code
//contains calls to silverlight.js, example below loads Page.xaml
function createSilverlight()
{
Silverlight.createObjectEx({
source: "Page.xaml",
parentElement: document.getElementById("SilverlightControlHost"),
id: "SilverlightControl",
properties: {
width: "100%",
height: "100%",
version: "1.1",
enableHtmlAccess: "true"
},
events: {}
});
// Give the keyboard focus to the Silverlight control by default
document.body.onload = function() {
var silverlightControl = document.getElementById(''SilverlightControl'');
if (silverlightControl)
silverlightControl.focus();
}
}
|
每个HTML页面应该有一个相应的Javascript(.js)文件来装载一个相关的XAML文件中的Silverlight控件。
[新闻]百度偕诺基亚推移动搜索业务
Page.xaml
这个文件包含了你的Silverlight应用程序的用户界面。下面列出了VS2008创建的缺省内容。
注意这里x:Class属性。它指定了目前类名为OurFirstSilverlightProject.Page(OurFirstSilverlightProject是工程的缺省根命名空间而Page是类名),它对应的程序集在ClientBin/OurFirstSilverlightProject.dll.。
VS2008提供了支持XAML内容的IntelliSense,当你手写XAML时是一个很不错的辅助。
Page.xaml.vb
这个文件包含了Silverlight应用程序的被管理的代码。缺省的VS产生的类名是Page。
以下是引用片段:
Partial Public Class Page
Inherits Canvas
Public Sub Page_Loaded(ByVal o As Object, ByVal e As EventArgs)
'' Required to initialize variables
InitializeComponent()
End Sub
End Class
|
Page.xaml.vb文件是你写你的被管理的代码的地方。当准备部署Silverlight应用程序时,只有被编译过的程序集需要被部署。不需要部署源代码。
Silverlight.js
这是微软提供的创建所有的必要的部分用来确保目标浏览器可以运行Silverlight程序。通过将此文件包含在你的应用程序中,目标Web浏览器将会在未安装Silverlight运行时的情况下要求安装必须的运行时(每个Silverlight程序必须包含这个文件)。在使用许可的规定下,你不得修改这个文件。在运行多个Silverlight程序的Web服务器上,你可以只放置一个该文件的拷贝,并且将所有包含Silverlight内容的页面指向这个页面。
使用XAML创建用户界面
VS2008具备支持XAML内容的IntelliSense。这使得界面开发更有效率了,但是当前这里所用的VS2008版本没有一个XAML内容的查看器。这就是说,每次开发时必须运行一遍来查看其内容。
好消息是你可以使用微软的另外一个工具——Expression Blend来创建XAML界面。微软Expression Blend是一个专业级的设计工具,用来为Windows程序设计专业级的用户界面。最新的Blend版本,Expression Blend 2 August Preview,允许你创建基于Silverlight的程序。
使用Expression Blend2打开Page.xml,右击选择Open in Expression Blend…。图4所示。
498)this.style.width=498;"> |
| 图4 |
Expression Blend2将会启动,你可以看到一个类似VS的界面。图5。
498)this.style.width=498;"> |
| 图5 |
[新闻]《Diablo III》首席设计师访谈
微软的Silverlight浏览器插件使得开发者能够运行富因特网程序(RIAs)——包括动画,矢量图形和视频回放等等。看看如何进行Silverlight开发,并且感受一下这种新的开发方式吧!本文代码下载:http://assets.devx.com/sourcecode/20341.zip。
经过多年发展,我们看到了Web应用程序的繁荣。早期的Web站点仅仅支持静态的HTML页面,图片和文字信息。然后,服务器端技术如CGI,ASP和JSP等使得Web硬哟程序变成了现实,用户突然可以在Web上做很多事情了,比如在线购买商品,预订等等。客户端技术如Javascript等帮助提高了用户的Web应用体验,使得它们更加具备响应性。尽管AJAX的相关技术已经成熟很多年了,但也就是在最近几年人们才开始花费大量时间开发AJAX的Web应用程序。所有这一切都是为了同一个目标——使得Web应用程序交互性和响应能力更强。
今天,又出现了一个新名词——RIA,是Rich Internet Applications的缩写。对于微软来说,RIA实际代表着Rich Interactive Applications。微软最近启动了一个相关的技术/产品名为Silverlight。原名为Windows Presentation Foundation/Everywhere(WPF/E)的Silverlight是一个浏览器插件,能够使得开发者创建RIA程序包括动画,矢量图形和视频回放等等。
这篇文章帮助你了解Silverlight的开发,希望给你一个很好的关于Silverlight开发的讲解。
Silverlight现状
目前,有两个版本的Silverlight:1.0(发布版)和1.1(alpha发布),主要的区别在于是否支持.NET语言1.1版本。对于1.0版本,你必须使用Javascript来写你的程序逻辑。在1.1版本里,你可以使用C#或者VB进行程序逻辑开发,通过CLR来运行。
Silverlight运行时目前支持下列浏览器:
◆Internet Explorer 6/7
◆Firefox 1.5/2.0
◆Safari 2.0
本文着重讲解Silverlight1.1的内容。
获取开发工具
为了开发Silverlight应用程序,你必须获得以下运行时/工具:
运行时:
为了在浏览器里查看Silverlight应用程序,下载如下内容:
Microsoft Silverlight 1.0 Release Candidate
◆Mac
◆Windows
◆Microsoft Silverlight 1.1 Alpha Refresh
◆Mac
◆Windows
◆Microsoft ASP.NET Futures (July 2007)
ASP.NET Futures下载包含了用于支持Silverlight程序的最新ASP.NET控件。
开发工具
最简单的进行Silverlight开发的工具是Visual Studio 2008,当前下载版本是Beta 2。你可以从http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx下载。
当你下载并安装了VS2008Beta2之后,下载Microsoft Silverlight Tools Alpha Refresh for Visual Studio (July 2007),这是一个用来创建Silverlight程序的VS2008增强包。安装它会为VS2008Beta2增加如下特性:
1、VB和C#工程模板
2、IntelliSense和XAML代码生成器
3、Silverlight程序的调试
4、Web引用支持
5、和Expression Blend的集成
另外,你还需要如下专业工具来进行Silverlight开发:
◆Expression Blend 2 August Preview: 专业级Silverlight用户交互开发工具。
◆Expression Media Encoder Preview Update: Microsoft Expression Media的特性之一,允许你创建和增强视频。
◆Expression Design: 用来创建Silverlight程序的专业插图和绘图设计工具。
最后,你需要下载下列包含文档和例程代码的SDK :
◆Microsoft Silverlight 1.0 Software Development Kit Release Candidate
◆Microsoft Silverlight 1.1 Software Development Kit Alpha Refresh
开始编程
当安装好上述工具之后,你可以创建你的第一个Silverlight程序了。打开VS2008,创建一个新工程。工程类型选择Silverlight,选择Silverlight工程模板:如图1所示。将工程命名为OurFirstSilverlightProject。
498)this.style.width=498;"> |
[新闻]NHibernate 2.0.0.Beta1发布了
摘要: RSS新闻聚合现在好像很流行哦,让我们也来玩一下,不过我们要玩的是:用ASP.NET编写一个在线RSS新闻聚合器。
阅读全文
[新闻]IT史上最伟大的十大存储发明
摘要: 您可能习惯了在ASP程序中使用JMAIL组件收发邮件,Asp.net在System.Web.Mail名称空间中有一个发送email的内建类,但这仅是cdosys的一个假象。开发者能使用一个替代的它smtp邮件服务。在这篇文章里面,我将会展示如何创建一个用于asp.net的功能齐全的smtp邮件服务。
阅读全文
[新闻]优酷网获4000万美元投资 来自原有四家投资方
ps: 这是我在hp写的命题作文,E文不好,请见谅。
Abstract
Scrum is an iterative incremental process of Software development
commonly used with Agile Software Development. Especially, Scrum will
help us to manage the project more efficiently because it is an
adaptive process. However, applying the Scrum Methodology should depend
on the different situation during the process of project development.
It’s a big issue to solve. This article gives an example to elaborate
how to manage the project with Scrum.
Introduction
Software development is a complex endeavor. So the most difficult
problem is how to handle the complexity through by the science of
project management. Many scientists and software engineers raised a
great number of methodologies for project management such as Waterfall,
UP and Agile. In contrast to the heavy methodologies including
Waterfall and UP, Agile is enough flexible to embrace the change, more
light to be mastered by project team members, and more focuses on the
communication and release of the usable software rapidly. Agile
methodologies include eXtreme Programming, Scrum, Feature Driven
Development and Crystal etc.
Scrum was raised by Hirotaka Takeuchi and Ikujiro Nonaka in 1986. The skeleton is shown in Figure 1.
Figure 1
The lower circle represents an iteration of development activities that
occur one after another. In Scrum, it was called Sprint. Each Sprint is
an iteration of 30 consecutive calendar days. The output of each sprint
is an increment of product. The upper circle represents the daily
inspection that occurs during the sprint, in which the individual team
members meet to inspect each others’ activities and make appropriate
adaptations.
There are three roles in Scrum including ScrumMaster, Product Owner and
Team. The ScrumMaster is responsible for the Scrum process, for
teaching Scrum to everyone involved in the project, for implementing
Scrum and ensuring that everyone follows Scrum rules and practices. The
Product Owner is responsible for representing the interest of
stakeholders and creating the project’s initial overall requirement
which was called the Product Backlog, for using the Product Backlog to
ensure that the most valuable functionality is produces first and built
upon. The team is responsible for developing functionality. Teams are
self-managing, self-organizing, and cross-functional, and they are
responsible for figuring out how to return Product Backlog into an
increment of functionality within an iteration and managing their own
work to do so.
Problem Statement
Without doubt, Scrum is one of most popular agile methodologies now.
It, however, is not easy to apply it to project management. Considering
about the following situations please:
1. If the culture of your organization is contradictious with Scrum,
and your leader always interrupts you during the process of project
development, what should you do?
2. If your team members are not familiar with Scrum, and they don’t understand the heart and rules of Scrum, what should you do?
3. Furthermore if your team members didn’t master the basic skills of
Agile developing such as pair programming, Test Driven Development etc,
what should you do?
4. If your customers always change their requirement, they are not clear what they want even, what should you do?
Our Solution
In fact, we can’t find out the “Silver Bullet” to solve these problems.
We know Scrum is an adaptive process. Scrum makes many rules which
should be followed, but not hidebound. It’s agile and flexible. It
allows us to adjust the way to achieve the goal of project.
The answer to the first question is operating within the culture of the
organization. Don’t fight against the culture of your company. If you
are ScrumMaster, you’d better walk a fine line between the
organization’s need to make changes as quickly as possible and its
limited tolerance for change. You can adopt Scrum by starting small. At
the same time, you should try your best to persuade your leader to
support you. Sometimes your leader will build the bridge between the
agile world and non-agile for you. Of course, it needs change, but
these changes must be culturally acceptable. If not, you must
acquiesce. The ScrumMaster is a sheepdog of the team, and his job is to
protect the team from impediments during the Sprint. Remember that the
precondition of which everything is going on well is that the sheepdog
cannot be dead. After all, Scrum is the art of the possible.
Right, we hope our team members are all software craftsman so that
everything is Ok. Unfortunately, the real world is not as good as that
we expect. In fact, the situation in which most of team members are all
apprentices is more common. It is true that it is difficult to hire the
experienced software engineer in this industry. So the problem we must
solve is how to train them. We should draw up a training plan. Before
it, we must understand the skill set of everybody. We need to assign
the mentors to the fresh guys. Of course, the best way of training is
practice. We should assign the task to them according to their ability.
At the same time, we have to add the task duration because they are not
familiar with the related skills. Besides, Pair programming is a good
way to handle it.
The great character of Scrum is enough flexible to embrace the change.
Scrum is an iterative and incremental process. The iteration is very
short (30 days) so that we can change our plan in time. The incremental
development will provide the good policy to submit the release rapidly.
The increment product can give our customers confidence. And the
customers can understand the difference between what they want and what
we provide though by the running software. Scrum emphasis on the
communication between the team and customers. Product Owner of Scrum is
responsible for communicating with the customers and creating the
product backlog. In case the customers changed their requirements, the
Product Owner will discuss with ScrumMaster and Team. If the change is
acceptable, it is added into the product backlog. If the change is
within the sprint which the team is developing, the sprint has to halt,
and re-open the new sprint. Beside, the daily scrum will help each team
member understand the current statue of the project, and the sprint
review meeting will show the result of the sprint to the customers in
order to get the feedback from the customers, the sprint retrospection
meeting will prompt the Scrum process framework and practices.
Evidence that the Solution Works
Now we complete the first sprint of the project on time. In a month, we
went through the whole lifecycle of the software development from the
requirement analysis to designing, coding and testing. Each member is
familiar with the Scrum gradually. Everything is going on well such as
Daily Scrum, Team Work and Sprint Development. In the end of this
sprint, we submit the increment product to our customers and get the
feedback from the customers. The most important achievement is that our
customers approve our approach to develop the product.
Competitive Approaches
We don’t follow the rule of Agile Methodology strictly. For instance,
most of team members are accustomed to the TDD (Test Driven
Development), so we adopt the traditional way to design and develop the
software such as Use Case Driven Development instead of TDD. But we
require everybody must write the test case for classes and components.
We organize the pair programming group to prompt each other.
Because our customers are off-site, so we require our Product Owner
must be in-site and cooperate with them in full time. We create the
communication schedule for the customers to understand the customers’
requirement. The Product Owner is empowered to handle everything with
requirement.
Especially, the ScrumMaster of our project protects the team from the
rest of the non-agile world. We get the enough resources and backup.
For example, we have our own agile coach to direct how to apply the
Scrum to our project. He can help us to solve the key problem when we
are confused of Scrum Methodology.
Current Status
The project is going on well. The first sprint is very successful. Team
members are all confidence. They regard the Scrum as the effective and
enjoyable process. The customers are satisfied with our process. Most
of risks had already solved because we emphasis on them and add them as
the tasks into the sprint backlog.
Next Steps
Next month, we are going to hold the Sprint retrospective meeting to
find out the existed problems in the first sprint. Then we will create
the backlog for next sprint. In this sprint, we will develop the most
important domain module and let it workable.
Conclusions
Scrum is an excellent agile methodology to release the software product
rapidly and correctly. It gives all team members the new management
responsibilities. The process of the project management is visible and
controllable. The ScrumMaster and Product Owner don’t need to write the
redundant documents and draw up the unrealistic project plan. The team
members become more active due to self-organizing and self-managing.
References
1. Agile Project Management with Scrum, Ken Schwaber
2. Software Craftsmanship, Pete McBreen
3. Applying UML And Patterns, Craig Larman
捷道·敏捷堂发布:http://www.agiledon.com/post/2008/07/Scrum-Practice-In-PM.aspx
[新闻]比尔走后,微软前路艰难?
摘要: 朋友F接到一个项目,开发一个地级市的人事管理信息系统。分布式的终端用户约100个,人员数据量约4万条,5年内数据增长后不会超过10万条。我们组建了一个四人小团队,X(就是我啦)、H和K。
阅读全文
[新闻]56网恢复外链相册视频功能 近期将推出新版
SQLite是一个老牌的轻量级别的文件数据库,完全免费,使用方便,不需要安装,无须任何配置,也不需要管理员。
它是开源的嵌入式数据库产品,是同类产品中的后起之秀,2005年获得了开源大奖,而且最新的PHP5也内嵌了SQLite。相比另一款著名的嵌入式数据库——Berkely DB。SQLite是关系型数据库,支持大部分SQL语句,这是它比BDB优秀的地方。
作为一款嵌入式数据库,SQLite与Berkely DB一样,以库的形式提供,通过C函数直接操作数据库文件。(也支持其他的访问方式,比如Tcl)。下载包中有SQLite3.dll和 SQlite3.def,def可以用VC的lib工具生成链接库,当然也可以直接链接dll文件。
SQLite不是Server,所以和SQLServer等不同,它和程序运行在同一进程。中间没有进程间通信,速度很快,而且体积小巧,易于分发。适合运行在单机环境和嵌入式环境。(随便说一下,腾讯的QQ中可能就用到了SQLite数据库来保存信息)
支持事务机制和blob数据类型。支持大部分SQL92标准.一个完整的数据库保存在磁盘上面一个文件.
同一个数据库文件可以在不同机器上面使用,最大支持数据库到2TB.
源代码开放, 代码95%有较好的注释,简单易用的API.
现在已经发展到了SQLite3版本,目前最新版本是SQLite3.3.4.
资源下载:
Sqlite .net 支持 http://www.cnblogs.com/Files/snow365/SQLite-1.0.31.0-binary.rar
哎,找到好久,终于找到了一个sqlite的图形管理工具SharpPlus Sqlite Developer 。 SQLite Spy 也不错,界面很美观,我感觉功能少了点。
SQLite的源码:http://www.sqlite.org/sqlite-source-3_3_4.zip(包括sqlite3.h)
SQLite编译好的dll及def文件:http://www.sqlite.org/sqlitedll-3_3_4.zip
SQLite提供一个命令行shell的工具用以访问数据库,下载windows下的SQLite命令行工具sqlite3.exe,
下载地址:http://www.sqlite.org/sqlite-3_3_4.zip。
网上有一款针对SQLite3的 UI工具-SQLite Spy。下载地址:www.yunqa.de/delphi/sqlitespy/
如果想通过ODBC来访问操作SQLite数据库,需要安装第三方组件库的SQLite ODBC Driver,
可以到"http://www.patthoyts.tk/sqlite3odbc.html"或者"http://www.ch-werner.de/sqliteodbc/"去下载.
也可以直接下载其ODBC的驱动安装程序:"http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe"
现在SQLite ODBC Driver的版本为0.65.
然后在C++程序中就可以使用OTL来统一对数据库的访问。
SQLite的官方主站:http://www.sqlite.org/
SQLite的中文网:http://sqlitecn.feuvan.net/index.html
OTL的官方主站:http://otl.sourceforge.net/home.htm
其它参考:
http://www-128.ibm.com/developerworks/cn/opensource/os-sqlite/index.html?ca=dwcn-newsletter-opensource
http://blog.donews.com/limodou/archive/2004/03/21/7997.aspx
[新闻]阿里巴巴挖人升级电子商务平台
More Posts
Next page »