首页 Soft PlugIn RAN乱 Dev开发 Info资料 English WAP 留言 登陆 注册
-
Posted by Yippee | 评论(0) | 引用(0) | 阅读159次
20080317 app_data 配置管理

20080317 app_data 配置管理
http://www.shengfang.org

DataDirectory是什么?

asp.net 2.0有一个特殊目录app_data,通常Sql server 2005 express数据文件就放在这个目录,相应的数据库连接串就是:
connectionString="…… data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|data.mdf;User Instance=true"
这里有一个DataDirectory的宏,他表示什么意义呢?

DataDirectory 是表示数据库路径的替换字符串。由于无需对完整路径进行硬编码,DataDirectory 简化了项目的共享和应用程序的部署。例如,无需使用以下连接字符串:
"Data Source= c:\program files\MyApp\app_data\Mydb.mdf"
通过使用 |DataDirectory|(包含在如下所示的竖线中),即可具有以下连接字符串:
"Data Source = |DataDirectory|\Mydb.mdf"
这里的一篇文章Working with local databases详细的解释了DataDirectory 的意义,不仅仅是Sql server 2005 express中使用,也可以在其他的文件数据库中使用,例如Sqllite数据库文件的连接字符串:
<add name="DefaultDB"
connectionString="DriverClass=NHibernate.Driver.SQLite20Driver;Dialect=NHibernate.Dialect.SQLiteDialect;Data Source=|DataDirectory|\data.db3" />

Overview

In Visual Studio 2005 we added a number of features to help developers build and deploy applications that need a local data store. Here's a quick peek at how it works.

In order to work with a local database file, you can simply add the file to your project (e.g. using the Project/Add Existing Item... menu). We currently support adding SQL Server data files (.mdf), Jet (Access) data files (.mdb) and SQL Mobile data files (.sdf). Note that in order to be able to use .mdf files, you need to have installed SQL Server Express. SQL Express is available on the VS CD or at http://go.microsoft.com/fwlink/?LinkId=49251. With SQL Server Express installed, you will also be able to create new databases through 'Project/Add New Item…/Database'.

Once the database file is in the project, VS will do a few things:

      1. It will automatically add a connection in the Database Explorer so you can edit the database schema or the data.

      2. It will make sure that the connection strings are serialized using a relative path (more on this below).

      3. The first time the file is added, VS will also launch the Data Source wizard to create a new typed dataset.

 

Full path vs relative path

One of the reasons why it was hard to work with database files before is that the full path to the database was serialized in different places. This made it harder to share a project and also to deploy the application. In this version, the .NET runtime added support for what we call the DataDirectory macro. This allows Visual Studio to put a special variable in the connection string that will be expanded at run-time. So instead of having a connection string like this:

      "Data Source=.\SQLExpress;AttachDbFileName=c:\program files\app\data.mdf"

You can have a connection string like this:

      "Data Source=.\SQLExpress;AttachDbFileName=|DataDirectory|\data.mdf"

This connection string syntax is supported by the SqlClient and OleDb managed providers.

By default, the |DataDirectory| variable will be expanded as follow:

      - For applications placed in a directory on the user machine, this will be the app's (.exe) folder.
      - For apps running under ClickOnce, this will be a special data folder created by ClickOnce
      - For Web apps, this will be the App_Data folder

Under the hood, the value for |DataDirectory| simply comes from a property on the app domain. It is possible to change that value and override the default behavior by doing this:

      AppDomain.CurrentDomain.SetData("DataDirectory", newpath)

目前几款重要的项目管理软件除了Rational ClearCase还有Microsoft Visual Sourcesafe、CVS、SVN等。以上几款软件中,CVS和SVN在功能和使用上基本一致,也可以说SVN是从CVS发展而来的一个比CVS更新的版本,因此下面的比较CVS和SVN将都以SVN来代表。对于这些软件,个人都有过学习和使用的经验,相较而言,CC是了解得最少的一个,而SVN是使用时间最长的一个。下面就个人经验谈谈对几款软件的认识:

1.         从软件架构来看,CC和SVN是典型的C/S模式,而VSS则不是。因此CC和SVN都可以通过建立服务器来达到在局域网甚至internet进行项目管理的目的,而VSS只能在局域网中使用,并且VSS的数据库必须存放在一个共享的文件夹内,这给安全性带来隐患;

2.         ClearCase的权限管理集成域控制机制,这既可以说是CC的一个优点也可以认为是CC的一个不方便之处;

3.         并行开发模式。项目管理的模式有Copy-Modify-Merge和Lock-Modify-Unlock两种。VSS支持Lock-Modify-Unlock模式,但在此模式下不支持并行开发,目前部门使用VSS采用的是这种模式。而VSS、CC和SVN都支持Copy-Modify-Merge模式。在Copy-Modify-Merge模式下,开发人员的协作将变得更加简单,各自的工作将不会受到其他人员的影响,只有在提交(注:这里的提交对VSS来说是Check in操作,但对CC来说既包括Check in操作也包括Deliver操作,且主要指Deliver操作,因为Check out和Check in在CC中主要发生在开发视图中,而开发视图一般不是并行的)修改的时候才可能需要处理版本上的冲突,而这种冲突可以很简单的通过好的文件结构来避免。比如Tom负责文件File1的更新,但File1依赖Kate负责的File2,由于File2的内部实现的复杂性,Tom不能直接使用File2进行测试File1的工作,那么Tom在开发的时候完全可以修改他的工作副本中的File2文件以保证File1的测试顺利进行,然后在他可以仅仅将File1的修改提交。CC有一个特别之处在于CC可以记录每个项目成员的所有工作,而VSS和SVN只能跟踪每个文件的每一次更新是由谁完成的,但不能集中的反映项目成员的所有工作。

4.         与开发环境的集成。VSS与开发环境集成较好,但是VSS有个缺点是VSS会修改sln和vsproj等文件来完成对项目文件的管理。CC在可以通过ClearCase Explorer来工作,也能够与Visual Studio集成,但他在可视化有一点缺陷,不能直观的反映出文件夹及其内容的状态。SVN的客户端是一个Windows Explorer的外壳程序,通过右键菜单便可以方便的完成项目的管理。SVN需要在每个工作副本下的文件夹添加一些隐藏的配置文件,但SVN提供从受控项目中获得干净的所有相关资源的命令。另外SVN对其控制的文件使用一套特别的图标来标识文件的工作副本目前与版本库的状态差异,这个人觉得是一个重要的优点。如下图:

5.         性能和易用性。VSS因为没有服务端,它对版本库的操作完全是对任一个VSS软件自由的,因此其性能不是太好,在数据量不大的情况下,可以接受。另外VSS版本库容易损坏,比如机器死机或者断电都可能造成版本库的某个部分不可用。CC服务器采用多线程机制,性能较好,但其安装、配置、使用相对较复杂,需要进行团队培训。SVN的服务端配置有一定难度,但其客户端使用简单直观。SVN的性能也较好。

从安装ClearQuest我体会到,Rational的产品的易用性差果然不是吹的。怪不得可以卖这么贵,怪不得培训也这么贵,怪不得会用rational产品的人的工资这么高,怪不得用了rational的公司那么神气,唉。

大家不要扔搬砖,我说的是肺腑之言。Linux难用,所以linux/unix的sys admin比win2000的sys admin吃香。Rational大致也有这个味道。

source control和bug tracking,市场上的工具至少有十几种,如果按照价格划分,基本可以分成三挡:高端,中层,低端。

高端的产品,基本上价格是几万以上,例如Rational的ClearCase(做source control的)和ClearQuest(做bug tracking)的
中层的产品,基本上价格是几千到几万,例如微软的VSS(做source control的)和微创的BMS XP(做bug tracking)的
低端的产品,基本上免费或接近免费,例如CVS(做source control的)和Bugzilla(做bug tracking)的

此外,还有PVCS的一套source control的,CA(就是冠群)也有一个source control的,还有很多commercial的bug tracking tool,都定位在中层。

http://extjs.com/learn/Ext_2_Overview_%28Chinese%29
欢迎来到Ext 2.0。在下列各章节中,你将会接触到Ext 2.0最新的改进,你也将会了解,有哪些新功能是为你所用的。虽然作为一份概述性的内容,本文不会讨论如何编写Ext 2.0应用程序个中细节,但是你可在下面提供的资源,找到你所需的内容:

http://www.cnitblog.com/seeyeah/archive/2008/02/25/40141.aspx
ASP.NET AJAX Controls and Extenders Tutorial

http://www.codeplex.com/ExtJsExtenderControl
ExtJs Extender Controls


字体:


Permanant URI永久地址 http://www.shengfang.org/blog/p/20080317app_datasvncvs.php
Trackback URI引用地址 http://www.shengfang.org/blog/tb.php?tb_id=1229162589

2008年12月13日18:03星期六  [Info资料] 追踪此文的RSS
提示:
此文还没有评论。

称呼:    登陆   注册
   不注册,但记住我的信息
邮件:
(非必须)
评论: [UBB代码帮助]
粗体 斜体 下划线 链接 水平线 引用



验证码: 请输入你看见的数字
关闭UBB      提交时自动将内容复制到剪贴板

公告
Fire and Motion!

统计信息
[Yippee]||[统计]||日志:1790
在线: 13||用户: 2562 [列表]
今日:2394||到访:2669341
Rss:837646||评论:1584

最新日志

最新评论

友情链接

日历

最新引用

搜索

归档

杂项
Get RSS Feed (Version 2.0)
Get Atom Feed (Version 0.3)
编码:  UTF-8