??xml version="1.0" encoding="utf-8" standalone="yes"?>
http://www.molss.gov.cn/gb/news/2007-06/30/content_184630.htm
B)?/span>?/span>人民共和?/span>力_合同?/span>?/span>施条?/span>(解释力_法实?/span>)
http://www.gov.cn/flfg/2008-09/19/content_1099500.htm
C)关于立力_关系有关事项的通知
http://www.law-lib.com/law/law_view.asp?id=92395
D)上v市女职工力_保护办法
http://www.shanghai.gov.cn/shanghai/node2314/node3124/node3125/node3133/userobject6ai655.html
· C)的相兛_容:
用h单位未与力_者签订劳动合同,认定双方存在力_关系时可参照下列凭证Q?/span>
(一)工资支付凭证或记?/span>(职工工资发放花名?/span>)、缴U_社会保险费的记录;
(?/span>)用h单位向劳动者发攄“工作?#8221;?#8220;服务?#8221;{能够证明n份的证gQ?/span>
· B) 的相兛_容:
W六?span style="font: 7pt 'Times New Roman'"> 用h单位自用工之日v过一个月不满一q?/span>未与力_者订立书面劳动合同的Q应当依?span style="color: blue">力_合同法第八十二条的规定向力_者每月支付两倍的工资Qƈ与劳动者补订书面劳动合?/span>Q劳动者不与用人单位订立书面劳动合同的Q用人单位应当书面通知力_者终止劳动关p,q依照劳动合同法W四十七条的规定支付l济补偿?/span>(1Q相当于l?/strong>2倍工资,2Q补合同Q?/strong>3Q如果辞退Q再按照有合同补偿)
W二十七条 力_合同法第四十七条规定?strong>l济补偿的月工资按照力_者应得工资计,包括计时工资或者计件工资以及奖?/strong>?/span>
· A)的相兛_容:
W四十二条 力_者有下列情Ş之一的,用h单位不得依照本法W四十条、第四十一条的规定解除力_合同Q?/span>
Q四Q女职工在孕期、期、哺x?/strong>
W四十七条 l济补偿按劳动者在本单位工作的q限Q?strong>每满一q支付一个月工资的标准向力_者支付。六个月以上不满一q的Q按一q计;不满六个月的Q向力_者支付半个月工资的经补ѝ?/span>
W八十二条 用h单位自用工之日v过一个月不满一q未与劳动者订立书面劳动合同的Q应当向力_者每月支付二倍的工资?/strong>
用h单位q反本法规定不与力_者订?strong>无固定期限劳动合?/strong>的,自应当订立无固定期限力_合同之日起向力_者每?strong>支付二倍的工资?/span>
W八十七条 用h单位q反本法规定解除或者终止劳动合同的Q应?strong>依照本法W四十七?/span>规定的经补?strong>标准的二?/span>向劳动者支付赔偉K?/span>
W十四条 无固定期限劳动合同,是指用h单位与劳动者约定无定l止旉的劳动合同?/span>
用h单位与劳动者协商一_可以订立无固定期限劳动合同。有下列情Ş之一Q劳动者提出或者同意箋订、订立劳动合同的Q除力_者提立固定期限劳动合同外Q应?strong>订立无固定期限劳动合?/strong>Q?/span>
Q一Q劳动者在该用人单?span style="color: red">q箋工作满十q?/strong>的;
Q二Q用人单位初ơ实行劳动合同制度或者国有企业改刉新订立劳动合同时Q劳动者在该用人单位连l工作满十年且距法定退休年龄不_q的Q?/span>
Q三Q?strong>q箋订立二次固定期限力_合同Q且力_者没有本法第三十九条和第四十条第一V第二项规定的情形,l订力_合同的?/span>
用h单位自用工之日v满一q不与劳动者订立书面劳动合同的Q视为用人单位与力_者已订立无固定期限劳动合?/strong>?/span>
· D) 的相兛_容:
W十一?/span>对妊娠期的女职工Q?strong>不应廉其劳动时?/strong>Q?/span>
W十四条奌工假分别按下列情况执行Q?/span>
Q一Q单胎顺产者,l予产假九十天,其中产前休息十五天,产后休息七十五天?/span>
W十五条奌工生育后Q在其婴儿一周岁内应照顾其在每班力_旉?span style="color: red">授^两次Q包括h工喂养)?span style="color: red">每次单胎U授x间ؓ三十分钟Q亦可将两次授^旉合ƈ使用。多胞胎生育者,每多生一胎,每次Z^旉增加三十分钟?/span>
W十八条奌工在产假期间的工资照发。按本规定n受的产前假和Z^假的工资按本人原工资?span style="color: red">癑ֈ之八十发l?/span>。单位增加工资时Q女职工按规定n受的产前假、假、哺乛_Q应作出勤对待?/span>
· l论Q?/span>
1Q?span style="font: 7pt 'Times New Roman'"> 认定力_关系Q工作证
2Q?span style="font: 7pt 'Times New Roman'"> 是否{?/span>
3Q?span style="font: 7pt 'Times New Roman'"> 如果没签合同Q怎么补偿Q?/span>1Q?strong>相当于给2倍工资,2Q补合同Q?/strong>3Q如果辞退Q再按照有合同补偿)
4Q?span style="font: 7pt 'Times New Roman'"> 如果是固定合同,怎么补偿Q?/span>N+1Q?/strong>
5Q?span style="font: 7pt 'Times New Roman'"> 如果是无期合同,2?/strong>
6Q?span style="font: 7pt 'Times New Roman'"> 孕妇怎么处理Q?/span>
1、公司辞退孕妇的补偿情冉|准是怎样Q?/span>
{:发放工资到哺x满;按工作年限计经补偉K?/span>
2、公司是否可以以我的考核和我是孕产妇不能胜Q工作为由Ҏq行降职降降薪处理Q?/span>
{:不可以?/span>
我们的工资分为基本工资(U占1/4)+岗位工资+l效工资{。是否可能出现只要不降低我的基本工资是合法的行为?
{:不合理。工资是包括了岗位工资和l效工资?/span>
3、如果公怾法破产,我是否有向集团主张赔偿的权利Q?/span>
{:破也可以主张权利,在破产胦产中优先演戏ѝ?/span>
4、如果可能需要诉诸法律,我应该准备哪些方面的举证Q?/span>
{:存在力_关系的证据最重要Q此外,工资条、怀孕的证据、结婚证、准生证
也比较重要?/span>Q?/span>按照力_?/span>42条,不得解除三期【孕期、期、哺x】妇奟뀂那么如果一定要q反力_法解除劳动关p,只能按照q反力_法,按照W八十七条进行二倍赔偿,也就?/span>3倍)
案例:
http://www.tianya.cn/publicforum/content/law/1/119373.shtml
案情Q?/span>A公司辞退B?/span>?/span>Q不?/span>?/span>B可能存在?/span>q错Q假?/span>A毫无道理毫无依据的辞退B?/span>?/span>Q?/span>
一审结果:?/span>?/span>?/span>?/span>孕期?/span>?/span>、全额期(?/span>?/span>q?/span>加了15天)?/span>?/span>?/span>75%的哺x?/span>?/span>Qƈ以入职时?/span>至三期届满ؓ力_合同?/span>pdl?/span>?/span>间计在职时?/span>Q然后以?/span>?/span>职时?/span>按照?/span>力_合同法》第八十七条?/span>?/span>?/span>赔偿金(卛_法解除的补偿金的双倍)。一?/span>不是我代理的?/span>
?/span>?/span>A公司扑ֈ我,我想当然的以?/span>Q按照?/span>力_合同法》第八十七条?/span>?/span>定,力_者可?/span>选择要求l箋履行Q不要求l箋履行的,?/span>?/span>?/span>支付双?/span>补偿卛_Q一?/span>判决属适用法律错误?/span>
前几天在lh解释Windows是如何通过Kerberosq行Authentication的时候,讲了半天也别把那位老兄讲明白,q差Ҏ自己l绕q去。后来想惛_因有以下两点Q对于一个没有完全不了解Kerberos的h来说QKerberos的整个Authenticationq程实不好理解——一会儿以这个Keyq行加密、一会儿又要以另一个Keyq行加密Q确实很Ҏ把hl弄晕;另一斚w是我讲解方式有问题,一开始就从Kerberos?个Sub-protocol全面讲述整个Authentication q程Q对于一个完全不了解Kerberos的h来说要求也忒高了炏Vؓ此,我花了一些时间写了这文章,量以由入深、层层深入的方式讲述我所理解的基于Kerberos的Windows Network AuthenticationQ希望这文章能帮助那些对Kerberos不明里的h带来一丝帮助。对于一些不对的地方Q欢q大家批评指正?/p>
一?nbsp;基本原理
Authentication解决的是“如何证明某个人确实实就是他或她所声称的那个h”的问题。对于如何进行AuthenticationQ我们采用这LҎQ如果一个秘密(secretQ仅仅存在于A和BQ那么有个h对B声称自己是AQB通过让A提供q个U密来证明这个h是他或Ҏ声称的A。这个过E实际上涉及?个重要的关于Authentication的方面:
Zq?个方面,我们把Kerberos Authenticationq行最大限度的化:整个q程涉及到Client和ServerQ他们之间的q个Secret我们用一个KeyQ?strong>KServer-ClientQ来表示。ClientZ让Server对自p行有效的认证Q向Ҏ提供如下两组信息Q?/p>
׃KServer-Client仅仅被Client和Server知晓Q所以被Client使用KServer-Client加密q的Client Identity只能被Client和Server解密。同理,Server接收到Client传送的q两l信息,先通过KServer-Client对后者进行解密,随后机密的数据同前者进行比较,如果完全一P则可以证明Client能过提供正确?strong>KServer-ClientQ而这个世界上Q仅仅只有真正的Client和自q?strong>KServer-ClientQ所以可以对方就是他所声称的那个h?br>
Keberos大体上就是按照这L一个原理来q行Authentication的。但是Kerberosq比q个复杂Q我在后箋的章节中不断地扩充这个过E,知道Kerberos真实的认证过E。ؓ了读者更加容易理解后l的部分Q在q里我们先给Z个重要的概念Q?/p>
在一般情况下Q对于一个Account来说Q密码往往仅仅限于该Account的所有者知晓,甚至对于MDomain的AdministratorQ密码仍然应该是保密的。但是密码却又是证明w䆾的凭据,所以必通过Z你密码的z的信息来证明用户的真实n份,在这U情况下Q一般将你的密码q行Hashq算得到一个Hash code, 我们一般管q样的Hash Code叫做Master Key。由于Hash Algorithm是不可逆的Q同时保证密码和Master Key是一一对应的,q样既保证了你密码的保密性,有同时保证你的Master Key和密码本w在证明你n份的时候具有相同的效力?/p>
二、引入Key Distribution: KServer-Client从何而来
上面我们讨论了Kerberos Authentication的基本原理:通过让被认证的一Ҏ供一个仅限于他和认证方知晓的Key来鉴定对方的真实w䆾。而被q个Key加密的数据包需要在Client和Server之间传送,所以这个Key不能是一?strong>Long-term KeyQ而只可能?strong>Short-term KeyQ这个可以仅仅在Client和Server的一个Session中有效,所以我们称q个Key为Client和Server之间的Session KeyQ?strong>SServer-ClientQ?/p>
现在我们来讨论Client和Server如何得到q个SServer-Client。在q里我们要引入一个重要的角色Q?strong>Kerberos Distribution Center-KDC。KDC在整个Kerberos Authentication中作为Client和Server共同信Q的第三方L重要的作用,而Kerberos的认证过E就是通过q?方协作完成。顺便说一下,Kerberosh于希腊神话,是一支守护着冥界长着3个头颅的犬Q在keberos Authentication中,Kerberos?个头颅代表中认证q程中涉及的3方:Client、Server和KDC?/p>
对于一个Windows Domain来说Q?strong>Domain Controller扮演着KDC的角艌ӀKDCl护着一个存储着该Domain中所有帐LAccount DatabaseQ一般地Q这个Account Database?strong>AD来维护)Q也是_他知道属于每个Account的名U和z于该Account Password?strong>Master Key。而用于Client和Server怺认证?strong>SServer-Client是有KDC分发。下面我们来看看KDC分发SServer-Client的过E?/p>
通过下图我们可以看到KDC分发SServer-Client的简单的q程Q首先Client向KDC发送一个对SServer-Client的申诗这个申L内容可以单概括ؓ“我是某个ClientQ我需要一个Session Key用于讉K某个Server ”。KDC在接收到q个h的时候,生成一个Session KeyQؓ了保证这个Session Key仅仅限于发送请求的Client和他希望讉K的Server知晓QKDC会ؓq个Session Key生成两个CopyQ分别被Client和Server使用。然后从Account database中提取Client和Server的Master Key分别对这两个Copyq行对称加密。对于后者,和Session Key一赯加密的还包含关于Client的一些信息?/p>
KDC现在有了两个分别被Client和Server 的Master Key加密q的Session KeyQ这两个Session Key如何分别被Client和Server获得呢?也许?马上会说QKDC直接这两个加密q的包发送给Client和Server不就可以了吗Q但是如果这样做Q对于Server来说会出C?两个问题Q?/p>
Z解决q个问题QKerberos的做法很单,这两个被加密的Copy一q发送给ClientQ属于Server的那份由Client发送给Server?br>
可能有h会问QKDCq没有真正去认证q个发送请求的Client是否真的是那个他所声称的那个hQ就把Session Key发送给他,会不会有什么问题?如果另一个hQ比如Client BQ声U自己是Client AQ他同样会得到Client A和Server的Session KeyQ这会不会有什么问题?实际上不存在问题Q因为Client B声称自己是Client AQKDC׃使用Client A的Passwordz的Master Key对Session Keyq行加密Q所以真正知道Client A 的Password的一Ҏ会通过解密获得Session Key?nbsp;
三、引入Authenticator - 为有效的证明自己提供证据
通过上面的过E,Client实际上获得了两组信息Q一个通过自己Master Key加密的Session KeyQ另一个被Sever的Master Key加密的数据包Q包含Session Key和关于自q一些确认信息。通过W一节,我们说只要通过一个双方知晓的Key可以对Ҏq行有效的认证,但是在一个网l的环境中,q种单的做法是具有安全漏z,为此,Client需要提供更多的证明信息Q我们把q种证明信息UCؓAuthenticatorQ在Kerberos的Authenticator实际上就?strong>关于Client的一些信?/strong>和当前时间的一?strong>TimestampQ关于这个安全漏z和Timestamp的作用,我将在后面解释)?/p>
在这个基上,我们再来看看Server如何对Clientq行认证QClient通过自己的Master Key对KDC加密的Session Keyq行解密从而获?strong>Session KeyQ随后创?strong>AuthenticatorQClient Info + TimestampQ?/strong>q用Session Key对其加密。最后连同从KDC获得的、被Server的Master Key加密q的数据包(Client Info + Session KeyQ一q发送到Server端。我们把通过Server的Master Key加密q的数据包称?strong>Session Ticket?/p>
当Server接收到这两组数据后,先用他自己的Master Key对Session Ticketq行解密Q从而获?strong>Session Key。随后用该Session Key解密AuthenticatorQ通过比较Authenticator中的Client Info?strong>Session Ticket中的Client Info从而实现对Client的认证?br>
Z么要使用TimestampQ?/strong>
到这里,很多人可能认L认证q程天衣无缝Q只有当Client提供正确的Session Key方能得到Server的认证。但是在现实环境中,q存在很大的安全漏洞?/p>
我们试想q样的现象:Client向Server发送的数据包被某个恶意|络监听者截P该监听者随后将数据包位自qCredential冒充该Client对Serverq行讉KQ在q种情况下,依然可以很顺利地获得Server的成功认证。ؓ了解册个问题,Client?strong>Authenticator中会加入一个当前时间的Timestamp?/p>
在Server对Authenticator中的Client Info和Session Ticket中的Client Infoq行比较之前Q会先提取Authenticator中的TimestampQƈ?strong>当前的时?/strong>q行比较Q如果他们之间的偏差出一个可?strong>接受的时间范_一般是5minsQ,Server会直接拒l该Client的请求。在q里需要知道的是,Serverl护着一个列表,q个列表记录着在这个可接受的时间范围内所有进行认证的Client和认证的旉。对于时间偏差在q个可接受的范围中的ClientQServer会从q个q个列表中获?strong>最q一个该Client的认证时?/strong>Q只有当Authenticator中的Timestamp晚于通过一个Client的最q的认证旉的情况下QServer采用q行后箋的认证流E?/p>
Time Synchronization的重要?/strong>
上述 ZTimestamp的认证机制只有在Client和Server端的旉保持同步的情冉|有意义。所以保持Time Synchronization在整个认证过E中昑־ؓ重要。在一个Domain中,一般通过讉K同一?strong>Time Service获得当前旉的方式来实现旉的同步?/p>
双向认证QMutual AuthenticationQ?/strong>
Kerberos一个重要的优势在于它能够提供双向认证:不但Server可以对Client q行认证QClient也能对Serverq行认证?/p>
具体q程是这LQ如果Client需要对他访问的Serverq行认证Q会在它向Server发送的Credential中设|一个是否需要认证的Flag。Server在对Client认证成功之后Q会把Authenticator中的Timestamp提出出来Q通过Session Keyq行加密Q当Client接收到ƈ使用Session Keyq行解密之后Q如果确?strong>Timestamp和原来的完全一_那么他可以认定Server正式他试图访问的Server?/p>
那么Z么Server不直接把通过Session Keyq行加密的Authenticator原样发送给ClientQ而要把Timestamp提取出来加密发送给Client呢?原因在于防止恶意的监听者通过获取的Client发送的Authenticator冒充Server获得Client的认证?br>
四、引入Ticket Granting Service
通过上面的介l,我们发现Kerberos实际上一个基?strong>Ticket的认证方式。Client惌获取Server端的资源Q先得通过Server的认证;而认证的先决条g是Client向Server提供从KDC获得的一个有Server的Master Keyq行加密?strong>Session TicketQSession Key + Client InfoQ?/strong>。可以这么说QSession Ticket是Clientq入Server领域的一张门。而这张门必M一个合法的Ticket颁发机构获得Q这个颁发机构就?strong>Client和Server双方信Q的KDCQ?同时q张Ticketh强的防伪标识:它是被Server的Master Key加密的。对Client来说Q?获得Session Ticket是整个认证过E中最为关键的部分?/p>
上面我们只是单地从大体上说明了KDC向Client分发Ticket的过E,而真正在Kerberos中的Ticket Distribution要复杂一些。ؓ了更好的说明整个Ticket Distribution的过E,我在q里做一个类比。现在的股事很火爆,上v基本上是全民炒股Q我׃D一个认股权证的例子。有的上市公司在股票配股、增发、基金扩募、股份减持等情况会向公众发行认股权证Q认股权证的持有人可以凭借这个权证认购一定数量的该公司股,认股权证是一U具有看涨期权的金融衍生产品?/p>
而我们今天所讲的Client获得Ticket的过E也和通过认股权证购买股票的过E类伹{如果我们把Client提供lServerq行认证的Ticket比作股票的话Q那么Client在从KDC那边获得Ticket之前Q需要先获得q个Ticket的认购权证,q个认购权证在Kerberos中被UCؓTGTQTicket Granting TicketQTGT的分发方仍然是KDC?/p>
我们现在来看看Client是如何从KDC处获得TGT的:首先Client向KDC发v对TGT的申P甌的内容大致可以这栯C:“我需要一张TGT用以甌获取用以讉K所有Server的Ticket”。KDC在收到该甌h后,生成一个用于该Client和KDCq行安全通信?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>。ؓ了保证该Session Key仅供该Client和自׃用,KDC使用Client的Master Key?strong>自己的Master Key对生成的Session Keyq行加密Q从而获得两个加密的SKDC-Client的Copy。对于后者,?strong>SKDC-Client一赯加密的还包含以后用于鉴定Clientw䆾的关于Client的一些信息。最后KDC这两䆾Copy一q发送给Client。这里有一炚w要注意的是:Z免去KDC对于Z不同Client的Session Keyq行l护的麻烦,像Server不会保存Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>一PKDC也不会去保存q个Session KeyQ?strong>SKDC-ClientQ,而选择完全靠Client自己提供的方式?br>
当Client收到KDC的两个加密数据包之后Q先使用自己的Master Key对第一个Copyq行解密Q从而获得KDC和Client?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>Qƈ把该Session 和TGTq行~存。有了Session Key和TGTQClient自己的Master Key不再需要,因ؓ此后Client可以使用SKDC-Client向KDC甌用以讉K每个Server的TicketQ相对于Client的Master Keyq个Long-term KeyQSKDC-Client是一个Short-term KeyQ安全保证得到更好的保障Q这也是Kerberos多了q一步的关键所在。同旉要注意的是SKDC-Client是一个Session KeyQ他h自己的生命周期,同时TGT和Session怺兌Q当Session Keyq期QTGT也就宣告失效Q此后Client不得不重新向KDC甌新的TGTQKDC会生成一个不同Session Key和与之关联的TGT。同Ӟ׃Client Log off也导致SKDC-Client的失效,所以SKDC-Client又被UCؓLogon Session Key?/p>
接下来,我们看看Client如何使用TGT来从KDC获得Z某个Server的Ticket。在q里我要一下,Ticket是基于某个具体的Server的,而TGT则是和具体的Server无关的,Client可以使用一个TGT从KDC获得Z不同Server的Ticket。我们言归正传,Client在获得自己和KDC?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>之后Q生成自qAuthenticator以及所要访问的Server名称的ƈ使用SKDC-Clientq行加密。随后连同TGT一q发送给KDC。KDC使用自己的Master Key对TGTq行解密Q提取Client Info?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>Q然后用这?strong>SKDC-Client解密Authenticator获得Client InfoQ对两个Client Infoq行比较q而验证对方的真实w䆾。验证成功,生成一份基于Client所要访问的Server的TicketlClientQ这个过E就是我们第二节中介l的一样了?nbsp;
五、Kerberos?个Sub-protocolQ整个Authentication
通过以上的介l,我们基本上了解了整个Kerberos authentication的整个流E:整个程大体上包含以?个子q程Q?/p>
不过上面的介l离真正的Kerberos Authenticationq是有一点出入。Kerberos整个认证q程通过3个sub-protocol来完成。这?个Sub-Protocol分别完成上面列出?个子q程。这3个sub-protocol分别为:
下图单展CZ完成q个3个Sub-protocol所q行Message Exchange?br>
1Q?Authentication Service Exchange
通过q个Sub-protocolQKDCQ确切地说是KDC中的Authentication ServiceQ实现对Clientw䆾的确认,q发给该Client一个TGT。具体过E如下:
Client向KDC的Authentication Service发送Authentication Service RequestQ?strong>KRB_AS_REQQ? Z保KRB_AS_REQ仅限于自己和KDC知道QClient使用自己的Master Key对KRB_AS_REQ的主体部分进行加密(KDC可以通过Domain 的Account Database获得该Client的Master KeyQ。KRB_AS_REQ的大体包含以下的内容Q?/p>
ASQAuthentication ServiceQ通过它接收到的KRB_AS_REQ验证发送方的是否是在Client name & realm中声U的那个人,也就是说要验证发送放是否知道Client的Password。所以AS只需从Account Database中提取Client对应的Master Key对Pre-authentication dataq行解密Q如果是一个合法的TimestampQ则可以证明发送放提供的是正确无误的密码。验证通过之后QAS一份Authentication Service ResponseQKRB_AS_REPQ发送给Client。KRB_AS_REQ主要包含两个部分Q本Client的Master Key加密q的Session KeyQSKDC-ClientQLogon Session KeyQ和被自己(KDCQ加密的TGT。而TGT大体又包含以下的内容Q?/p>
Client通过自己的Master Key对第一部分解密获得Session KeyQSKDC-ClientQLogon Session KeyQ之后,携带着TGT便可以进入下一步:TGSQTicket Granting ServiceQExchange?/p>
2Q?TGSQTicket Granting ServiceQExchange
TGSQTicket Granting ServiceQExchange通过Client向KDC中的TGSQTicket Granting ServiceQ发送Ticket Granting Service RequestQ?strong>KRB_TGS_REQQ开始。KRB_TGS_REQ大体包含以下的内容:
TGS收到KRB_TGS_REQ在发lClient真正的Ticket之前Q先得整个Client提供的那个TGT是否是AS颁发l它的。于是它不得不通过Client提供的Authenticator来证明。但是Authentication是通过Logon Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>q行加密的,而自己ƈ没有保存q个Session Key。所以TGS先得通过自己的Master Key对Client提供的TGTq行解密Q从而获得这个Logon Session KeyQSKDC-ClientQ,再通过q个Logon Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>解密Authenticatorq行验证。验证通过向对方发送Ticket Granting Service ResponseQKRB_TGS_REPQ。这个KRB_TGS_REP有两部分l成Q?strong>Logon Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>加密q用于Client和Server?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>和?strong>Server的Master Keyq行加密的Ticket。该Ticket大体包含以下一些内容:
Client收到KRB_TGS_REPQ?strong>Logon Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>解密W一部分后获?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>。有了Session Key和TicketQClient可以之间和Serverq行交互Q而无d通过KDC作中间h了。所以我们说Kerberos是一U高效的认证方式Q它可以直接通过Client和Server双方来完成,不像Windows NT 4下的NTLM认证方式Q每ơ认证都要通过一个双方信ȝW?Ҏ完成?/p>
我们现在来看?Client如果使用Ticket和Server怎样q行交互的,q个阶段通过我们的第3个Sub-protocol来完成:CSQClient/Server QExchange?/p>
3Q?CSQClient/Server QExchange
q个已经在本文的W二节中已经介绍q,对于重复发内容就不再累赘了。Client通过TGS Exchange获得Client和Server?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>Q随后创建用于证明自己就是Ticket的真正所有者的AuthenticatorQƈ使用Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>q行加密。最后将q个被加密过的Authenticator和Ticket作ؓApplication Service RequestQKRB_AP_REQQ发送给Server。除了上qC内容之外,KRB_AP_REQq包含一个Flag用于表示Client是否需要进行双向验证(Mutual AuthenticationQ?/p>
Server接收到KRB_AP_REQ之后Q通过自己的Master Key解密TicketQ从而获得Session KeyQSServer-ClientQ。通过Session KeyQSServer-ClientQ解密AuthenticatorQ进而验证对方的w䆾。验证成功,让Client讉K需要访问的资源Q否则直接拒l对方的h?/p>
对于需要进行双向验证,Server从Authenticator提取TimestampQ用Session KeyQSServer-ClientQ进行加密,q将其发送给Client用于Client验证Server的n份?br> 通过3个Sub-protocol的介l,我们可以全面地掌握整个Kerberos的认证过E。实际上Q在Windows 2000时代Q基于Kerberos的Windows Authentication是按照q样的工作流E来q行的。但是我在上面一节结束的时候也说了Q基?个Sub-protocol的Kerberos作ؓ一UNetwork Authentication是具有它自己的局限和安全隐患的。我在整文章一直在q样的一个原则:以某个Entity的Long-term Key加密的数据不应该在网l中传?/strong>。原因很单,所有的加密法都不能保?00%的安全,对加密的数据q行解密只是一个时间的q程Q最大限度地提供安全保障的做法就是:使用一个Short-term keyQSession KeyQ代替Long-term KeyҎ据进行加密,使得恶意用户对其解密获得加密的KeyӞ该Key早已失效。但是对?个Sub-Protocol的C/S ExchangeQClient携带的Ticket却是?strong>Server Master Keyq行加密的,q显CW合我们提出的原则,降低Server的安全系数?/p>
所以我们必d求一U解x案来解决上面的问题。这个解x案很明显Q就是采用一个Short-term的Session KeyQ而不是Server Master Key对Ticketq行加密。这是我们今天要介l的Kerberos的第4个Sub-protocolQ?strong>User2User Protocol
六、User2User Sub-ProtocolQ有效地保障Server的安?/strong>
我们知道Client通过在AS Exchange阶段获得的TGT从KDC那么获得讉KServer的Ticket。原来的Ticket是通过Server的Master Keyq行加密的,而这个Master Key可以通过Account Database获得。但是现在KDC需要用Server和KDC之间?strong>SKDC-Serverq行加密Q而KDC是不会维护这个Session KeyQ所?strong>q个Session Key只能靠申请Ticket的Client提供。所以在AS Exchange和TGS Exchange之间QClientq得对Serverq行h已获得Server和KDC之间的Session KeyQ?strong>SKDC-ServerQ。而对于Server来说Q它可以像Client一样通过AS Exchange获得他和KDC之间的Session KeyQ?strong>SKDC-ServerQ和一个封装了q个Session Keyq被KDC的Master Keyq行加密的TGTQ一旦获得这个TGTQServer会缓存它Q以待Client对它的请求。我们现在来详细地讨一q程?br>
上图基本上翻译了ZUser2User的认证过E,q个q程?个步骤组成。我们发现较之我在上面一节介l的Z传统3个Sub-protocol的认证过E,q次对了W?部。我们从头到单地q一遍:
q就是整个过E?/p>
七、Kerberos的优?/strong>
分析整个Kerberos的认证过E之后,我们来ȝ一下Kerberos都有哪些优点Q?/p>
1Q较高的Performance
虽然我们一再地说Kerberos是一个涉及到3方的认证q程QClient、Server、KDC。但是一旦Client获得用过讉K某个Server的TicketQ该ServerpҎq个Ticket实现对Client的验证,而无KDC的再ơ参与。和传统的基于Windows NT 4.0的每个完全依赖Trusted Third Party的NTLM比较Q具有较大的性能提升?/p>
2Q实C双向验证QMutual AuthenticationQ?/strong>
传统的NTLM认证Zq样一个前提:Client讉K的远E的Service是可信的、无需对于q行验证Q所以NTLM不曾提供双向验证的功能。这昄有点理想MQؓ此Kerberos弥补了这个不IClient在访问Server的资源之前,可以要求对Server的n份执行认证?/p>
3Q对Delegation的支?/strong>
Impersonation和Delegation是一个分布式环境中两个重要的功能。Impersonation允许Server在本C用Logon 的Account执行某些操作QDelegation需用Serverlogon的Account带入到另q一个Context执行相应的操作。NTLM仅对Impersonation提供支持Q而Kerberos通过一U双向的、可传递的QMutual 、TransitiveQ信L式实C对Delegation的支持?/p>
4Q互操作性(InteroperabilityQ?/strong>
Kerberos最初由MIT首创Q现在已l成Z行被q泛接受的标准。所以对于不同的q_可以q行q泛的互操作?br>
摘要Q本文ASP.NET应用E序w䆾验证的概念,介绍了各Un份验证模式ƈq行了比较,阐述了选择w䆾验证模式的机Ӟq给Z一U基于窗体n份验证模式的实现Ҏ?/p>
关键字:w䆾验证 authentication ASP.NET WEB应用
1.w䆾验证概念 M成功的应用程序安全策略的基础都是E_的n份验证和授权手段Q以及提供机密数据的保密性和完整性的安全通讯?br>w䆾验证QauthenticationQ是一个标识应用程序客L的过E,q里的客L可能包括l端用户、服务、进E或计算机,通过了n份验证的客户端被UCؓMQprincipalQ。n份验证可以跨应用程序的多个层发生。终端用戯v初由Web应用E序q行w䆾验证Q通常Ҏ用户名和密码q行Q随后终端用Lh׃间层应用E序服务器和数据库服务器q行处理Q这q程中也进行n份验证以侉K证ƈ处理q些h?br>?列出了各U安全技术以及每U技术所提供的主要验证方式?br>2. w䆾验证模式 如图1所C,Windows 2000上的.NET框架上提供了以下几种w䆾验证Q?br>ASP.NETw䆾验证模式 Enterprise Servicesw䆾验证 SQL Serverw䆾验证 2.1 ASP.NETw䆾验证模式 ASP.NETw䆾验证模式包括Windows、FormsQ窗体)、PassportQ护照)和NoneQ无Q?br>2.1.1 Windowsw䆾验证 使用q种w䆾验证模式ӞASP.NET依赖于IIS对用戯行验证,q创Z个Windows讉K令牌来表C已通过验证的标识。IIS提供以下几种w䆾验证机制Q?br>基本w䆾验证要n份验证集成Windowsw䆾验证证书w䆾验证匿名w䆾验证 2.1.2 护照w䆾验证 使用q种w䆾验证模式ӞASP.NET使用Microsoft Passport的集中式w䆾验证服务QASP.NET为Microsoft Passport软g开发包QSDKQ所提供的功能提供了一个方便的包装QWrapperQ。此SDK必须安装在WEB服务器上?br>2.1.3 H体w䆾验证 q种验证方式使用客户端重定向功能Q将未通过w䆾验证的用戯{发到特定的登录窗体,要求用户输入其凭据信息(通常是用户名和密码)。这些凭据信息被验证后,pȝ生成一个n份验证票证(ticketQƈ其q回客户端。n份验证票证可在用L会话期间l护用户的n份标识信息,以及用户所属的角色列表Q可选)?br>2.1.4 None 使用q种w䆾验证模式Q表CZ不希望对用户q行验证Q或是采用自定义的n份验证协议?br>2.2 Enterprise Servicesw䆾验证 Enterprise Servicesw䆾验证通过使用底层的远E过E调用(RPCQRemote Procedure CallQ传输结构来q行Q而这U结构又使用了操作系l安全服务提供程序接口(SSPIQSecurity Service Provider InterfaceQ。可以利用Kerberose或NTLMw䆾验证机制对Enterprise Services应用E序的客Lq行验证?br>2.3 SQL Serverw䆾验证 SQL Server可以通过Windowsw䆾验证机制QKerberose或NTLMQ,也可以通过其内|的w䆾验证Ҏ-SQLw䆾验证机制q行验证。通常有两U可用的验证Ҏ?br>2.3.1 SQL Server and Windows 客户端可用通过SQL Serverw䆾验证或Windowsw䆾验证机制来连接SQL Server的某个实例。这U方式有时也被称为合模式的w䆾验证?br>2.3.2 Windows Only 客户端必通过使用Windowsw䆾验证机制来连接到SQL Server的一个实例?br>3. 选择w䆾验证机制 设计分布式应用程序的w䆾验证是一具有挑战性的d。在应用E序开发的早期阶段Q进行适当的n份验证设计有助于降低许多安全风险?nbsp;3.1 各种w䆾验证机制的比?nbsp;用户是否需要在服务器域中拥有Windows帐户是否支持委托是否需要Windows 2000客户端和服务器凭据是否明文传输(需要SSLQ是否支持非IE览?nbsp;基本w䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;要n份验?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;NTLMw䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;Kerberosw䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;证书w䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;H体w䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;护照w䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;3.2 选择w䆾验证机制需要考虑的因?nbsp;标识 只有当应用程序的用户h的Windows帐户可以通过一个受信Q的权威机构(它可以被应用E序Web服务器访问)来进行验证时Q用Windowsw䆾验证机制才是合适的?br>凭据理 Windowsw䆾验证的一个关键优势在于它可以使用操作pȝq行凭据理。当使用非Windowsw䆾验证方式Q例如窗体n份验证时Q必Ml考虑在何处以及如何保存用户凭据。其中最常用的方式是使用SQL Server数据库或是用位于Active Directory中的User对象?br>标识动 是否需要实C个模?委托模型Qƈ原始调用者的安全上下文在操作pȝU进行跨层流?例如Q以便支持审核或针对每个用户的精l授权?br>览器类?nbsp;应用E序的所有用h否都拥有IE览器?或是你是否需要支持一个具有合型览器的用户? 我们选择w䆾验证旉要根据各U方式的特点Q综合考虑以上因素?br>
- Fire up a terminal session and type the next commands;
TIP: Instead of using apt-get, you can install them with the Synaptic Package Manager located in the System/Administration menu
- Then you need to copy all the necessary files from the Windows box;
- Now you need to export the registry keys of the Adone Photoshop CS2;
If you are having a problem regarding ?em>unregistered?versions, you will need to crack your photoshop.exe file.
p译|站:
http://www.readworld.com
中日׃?q能上蝲译
http://165net.com
http://www.worldlingo.com/
http://www.netat.net/
http://www.translate.ru/eng/
日语译|站
1.goo 辞書:收录4部三省堂字典
http://dictionary.goo.ne.jp/index.htmlc
2.インフォ?:支持在线译文本和网?br />http://www.infoseek.co.jp/Honyaku/
3.@nifty訳:英和辞典Q和p?国語辞典 デジѝ用語辞典
http://www.nifty.com/dictionary/?top4
4.万物大辞?所有日常用专业辞典
http://www.prcity.co.jp/oichan/dic/index.html
5.在线字典集合|页
http://www.kyotsu.com/level2/culture/dictionary.htm
6.Bit.ex日中 中日辞書
http://www.bitex-cn.com
7.Kiki's Kanji Dictionary:日汉字发韛_?br />http://www.kanjidict.com/
8.????乐器斚w的辞?br />http://www.cablenet.ne.jp/~atari/music09.htm
9.ライフサイエミ낹辞書:提供一些日文输入法的下载及电子辞典部分内容下蝲
http://lsd.pharm.kyoto-u.ac.jp/FTP3-dos-J.html
http://lsd.pharm.kyoto-u.ac.jp/Others-J.html
10.日语学习资源发布:日语相关的资料脓?暴多|站)
http://bbs.online.sh.cn/elitearticle.php?elite_id=231124
11.excite訳:支持在线译文本
http://www.excite.co.jp/world/text_cn/
12.三省堂在U字?br />http://www.sanseido.net/
13.カタカナ?外来语辞?br />http://homepage2.nifty.com/YONE/
14.パソゟ냳辞典:电脑专业用语辞典
http://www.qiuyue.com/index.html
15.デジѝ用語辞典:基礎的なパソゟ냳用語から難しい専門用語まで、コミ냔ューѝ関連する用語をq広く収錌Ӂたイミ낿ヹ{ット上の用語辞典です
http://yougo.ascii24.com/
16.奟끮子の名前辞書
http://www.dd.iij4u.or.jp/~ume20/f_name/
17.アニメと人Ş劇のキャラクѝのスペル辞典
http://web.kyoto-inet.or.jp/peop ... sons/animechara.htm
18.日语文章汉字假名自动全篇标注
http://www.yaru.com/
19.房英似辞典 外来语研I辞?br />http://www.awa.or.jp/home/hiroomi/b-jdic/b-jindex.htm
此外Q附录部分的“VSS命o-权限U别对应表”是W者整理之后的l果Q有了它Q大家对不同权限的用户可以用何U功能,自会变得一目了然?
希望q个教程可以对ƈ不十分熟悉VSS的开发h员和理人员有所帮助Q同时也希望可以借此Z澄清一下大家对VSS的一些“偏见”:Q?
目录 1 说明2 概述 3 理员部?/u>4 普通用户部?/u>附录 |
一、本教程针对不同使用对象提供Visual SourceSafe 6.0的若q用指|阅读对象包括Visual SourceSafe的管理员和普通用P以及希望了解如何采用Visual SourceSafeq行软g版本控制的管理h员。管理员或普通用户在使用Visual SourceSafe的过E中Q如果遇C知如何操作,或者对某些操作的注意事不甚了解等cM情况Ӟ可以查阅本教E?/p>
二、本教程?理员部?是管理员必读的,如果理员在除行其自n职责之外Q还gQ普通用L角色Q则可以参阅教程中的"普通用户部?。作Z般的普通用P只需阅读"普通用户部?卛_?/p>
三、教E中列D的操作,加星可,为高U用法(Advanced UsageQ,其余为基本用法(Basic UsageQ。所谓基本用法是指一些通常使用频繁的,或者是使用Ҏ较ؓ单的操作。所谓高U用法是指通常使用频率不多Q或者较为重要的Q或者用法复杂的操作?/p>
四、本教程内容摘选ƈ改编自Visual SourceSafe 6.0英文版联机帮助,从中提取了诸多重要信息、容易忽略的内容以及若干注意事项。一些基本内容(主要指某些基本操作的使用ҎQ只单列举了条目Q欲了解q些条目的详l情况请查看联机帮助的相关部分,可以通过列于q些条目之后的英文说明在联机帮助中搜索到相关内容?/p>
五、本教程不涉及Visual SourceSafe囑Ş用户界面操作的解释说明,Ҏ定功能的具体操作步骤h看联机帮助的相关部分。可以通过列于该功能之后的英文说明在联机帮助中搜烦到相兛_宏V?/p>
六、在其他Visual Studio产品中(例如QVisual C++Q可以集成Visual SourceSafe的功能,本教E不涉及有关在其他集成开发环境下如何使用Visual SourceSafe功能的内容,q部分内容主要针Ҏ通用戗对q些内容的了解,在阅d本教E之后,会变得Ҏ。此外,某些操作在Visual SourceSafe环境下用更为方ѝ?/p>
Visual SourceSafeQ以下简UVSSQ是一U版本控制管理工兗它通过各U类型的文gQ包括:文本文g、图像文件、二q制文g、声x件、视频文件等Q存入其内部数据库的方式Q帮助你有效地管理工E(ProjectQ关于VSS中工E的概念误下面Q。它允许你在多个工程间共享同一l文Ӟ你可以将一个文件添加到数据库中Q以便其他相关h员用;MҎ件的更改被记录下来Q以便在M时候可以恢复到该文件的某个旧版本?/p>
VSS的工E组l方式团队协作开发变得更为容易和直观?em class="important">一个工E是一l存放于VSS数据库内的Q意类型的文gQ一个工E类g操作pȝ中的目录Q但VSS为其提供了版本控制、历史记录、文件合q等更多的功能支持?/em>
3.1 l护用户列表(Maintain the User List)
此处略,详细内容h阅联机帮助?/p>
此处略,详细内容h阅联机帮助?/p>
3.1.3 创徏用户列表(Create a User List)
此处略,详细内容h阅联机帮助?/p>
此处略,详细内容h阅联机帮助?/p>
3.1.5 ~辑用户属?Edit User Attributes)
此处略,详细内容h阅联机帮助?/p>
3.2.2 数据库打?Archive Databases)*
你可能需要定期地备䆾VSS数据库,或者数据库的某一部分。VSS Administrator工具提供了此功能。它可以Q?
节省VSS数据库服务器的磁盘空间?
加快昄历史记录操作QShow HistoryQ的速度?
便于在多个VSS数据库间传递文件和工程Q保持历史记录完整无~?
备䆾全部或部分VSS数据库内容ƈ压羃成文件?
3.2.3 清除临时目录(Clean Temporary Folder)
VSS通常在运行时把时结果放在时目录里Qƈ在退出前之删除。由于某些原因,例如非正帔R启,可能D临时内容D留在目录中。作为管理员Q你有责d期清除时目录的内容。每隔几周一ơ,当没有Q何用戯行VSS或VSS AdministratorӞh除时目录的内容。时目录的具体位置是由Temp_Path初始化变量在SRCSAFE.INI文g中指定的Q参见定制SS.INI和SRCSAFE.INI文gQ?
数据库锁定功能将不会自动锁定那些当前已经d的用P你应该在锁定数据库之前要求登录用户退出VSS。在重新允许用户使用VSS之前Q需要解除对数据库的锁定?br />
3.2.5 数据库恢?Restore Databases)
此处略,详细内容h阅联机帮助?br />
3.2.6 使用多个数据?Work with Multiple Databases)*
~省ӞVSS所有文仉中放在一个数据库中。如果可能,应尽量用一个数据库存放所有文Ӟq比分多个数据库存放要好Q因为:
你不能在多个数据库间׃nQShareQ文Ӟ参见Ҏ件和工程的Branch/Share操作Q?
位于多个数据库中的内容集中在一h比较困难的,需要用VSS Administrator的Archive功能Q参见数据库打包Q?
Z安全的考虑QVSS的用户信息,包括密码在内Q是和数据一起存攄?br />如果Z安全赯Q要信息拆分成多个独立的数据库Q?br />
~省ӞVSS所有文仉中放在一个数据库中。如果可能,应尽量用一个数据库存放所有文Ӟq比分多个数据库存放要好Q因为:你不能在多个数据库间׃nQShare Q文Ӟ参见Ҏ件和工程的Branch/Share操作Q?
位于多个数据库中的内容集中在一h比较困难的,需要用VSS Administrator 的Archive功能Q参见数据库打包Q?
Z安全的考虑QVSS的用户信息,包括密码在内Q是和数据一起存攄。如果ؓ了安全v见,要将信息拆分成多个独立的数据库,q种信息存储方式带来极大的便利,但你必须为每个数据库都单独添加用戗?
3.3 有关权限的话?About Rights)
3.3.1 权限的传?Rights Propagation)
当你d了一个新用户Qƈ用户讄了针Ҏ个工E的权限Ӟ在VSS数据库中建立起一个assignment。该 assignment会沿着工程树向下传递直至遇到另一个assignment?/p>
例如Q针对工E?$/" Q你为用户A指定了Add权限Q参见安全访问权限)Q而对于工E?$/Sample"Q你没有为用h式指定权限,则该用户对工程"$/Sample"自动拥有Add权限。当你在工程"$/Sample/BusinessObject"处ؓ其指定了Read权限后,阻止早先assignment的向下传递过E,所以用户A对该工程Q指"$/Sample/BusinessObject"Q及其子工程都只hRead权限了?/p>
当你首次d一个用hQ该用户在工E?$/"处被赋予的权限由"~省权限"军_Q缺省权限是通过在VSS Administrator里设|Project Security属性页的内Ҏ定义的。你可以通过修改该页内容Q全局性地变更所有用L~省权限?/p>
3.3.2 安全讉K权限(Security Access Rights)
当安装VSS后,~省安全讄被启用。你可以利用定制的方式,使某些用h有对某些工程和某些VSS命o的特定权限?/p>
~省安全讄很简单,当添加新用户Ӟ你只有两U别的讉K权限可供选择Q?
只读权限QRead-only rightsQ:用户可以查看VSS中的M内容Q但不能更改?
可读写权限(Read/write rightsQ:用户可以查看和修改VSS中的M内容?
如果q样的访问权限别以应Ҏ怋用,那么无需再增强安全控制的U别了?/p>
所有的VSS安全理都在VSS Administrator中进行。Q何能q行该程序的用户都可以改变VSS的Q意特性,所以最好只有管理员才用该E序?/p>
在VSS中,对工E的安全性控Ӟ是通过制定用户讉K权限来实现的。每个工E仅能被那些h相应权限的用戯问到Q每个命令仅能被那些h相应权限的用户用。可以通过VSS Administrator来定制权限,以达到更高别的安全控制?/p>
以下是VSS的权限别列表,下列每种权限都拥有该权限之前的全部权限。例如:拥有Check Out权限的用P也将同时拥有Read权限。(参见附录A2QVSS中部分命令的对应权限U别Q?/p>
权限 描述
Read (R) cM于缺省安全设|中的只L?
Check Out (C) 可以使用Check Out/Check In/Undo Check Out{命令对文gq行修改
Add (A) 可以使用Add/Delete/Label/Rename{命令对文gq行修改
Destroy(D) 可以使用 Destroy/Purge/Rollback{命令对文g实施怹删除操作
4.1 对工E、文件的一般性?Normal Use about Projects and Files)
4.1.1 打开/关闭数据?Open/Close a Database)
此处略,详细内容h阅联机帮助?/p>
4.1.2 创徏新工E?Create New Projects)
此处略,详细内容h阅联机帮助?/p>
4.1.3 d文g、目录、工E?Add FilesQFoldersQand Projects)
此处略,详细内容h阅联机帮助?/p>
4.1.4 删除和恢复文件、工E?Delete and Recover Files and Projects)
VSS提供?U删除文件的ҎQ?
对于׃n文gQDelete和Destroy仅将文g从当前所选工E中删除掉,其他׃n了该文g的工E,以及VSS数据库中Q仍留有此文件?
4.1.5 Ud文g和工E?Move Files and Projects)
Ud一个文件的唯一Ҏ是,在文件新所在位|的上一U工E(parent projectQ处使该文g׃nQ参?a >Ҏ件和工程的Branch/Share操作Q,然后原有工E(original projectQ下的该文gDelete或?DestroyQ参?a >删除和恢复文件、工E?/u>Q。移动后Q文件的历史记录被保留?
通过使用Move命oQ你可以一个子工程QsubprojectQ从某个上工程重置到另一个工E下。该操作不会改变子工E的内容和历史记录,但它会媄响上U工E的历史记录Q包括子工程所在的原有上工程和新的上U工E)。当Ud一个工E后Q你无法重建原有上U工E的某个旧版本?/p>
4.1.6 重命名文件、工E?Rename Files or Projects)
若某个文件被多个工程所׃nQ对该文件的重命名将影响所有工E,而在Branch状态下Q则不媄响(参见Ҏ件和工程的Branch/Share操作Q?/p>
4.1.7 讄工作目录(Set Working Folders)
此处略,详细内容h阅联机帮助?/p>
4.2 {օ、签出、获取、查看及相关操作(Check In/Out、Get、View and Other Related Use)
4.2.1 {օ{և操作(Check In and Check Out Files)
此处略,详细内容h阅联机帮助?/p>
执行该操作时Q若用户选择了替换本地文Ӟ则用户将丢失最q一ơ签出后对该文g在本地的更改?/p>
4.2.3 获取最q版?Get Latest Version)
此处略,详细内容h阅联机帮助?/p>
4.2.4 获取早期版本(Get Earlier Version)
此处略,详细内容h阅联机帮助?/p>
4.2.5 获取和查看文件、工E?Get and View Files and Projects)
Get操作文件或工程拯x地的工作目录Qƈ讄为read-only属性。可以用View操作查看文g内容Q此时用h需讄工作目录?
量不要删除vssver.scc文g。本地工作目录及每个子目录下都包含一个这L文gQVSS利用其中记录的信息确定本地目录中哪个文g已经更改了。删除后Q将使新一ơ的Get操作速度减慢?/p>
4.2.6 回滚C前版?Rollback to Previous Versions)
该操作将使文件的内容恢复到先前某个版本时的状态,它将使所有在该版本后所做的改动丢失。如果你所回滚的文件被多个工程׃nQ则操作只媄响你所指定的那个工E,q且它会自动实行Branch操作Q参?a >Ҏ件和工程?Branch/Share操作Q。徏议你使用虚拟回滚QVirtual RollbackQ,它将不会佉K后的改动怹丢失。具体操作如下:
4.2.7 多h同时{և一个文?Check Out Multiple Files) *
~省状态下Q一个文件只允许一个h{ևQ管理员可以通过修改配置Q允许多人同时签出。此ӞVSS跟t所有签文g的用戗每当用L入时QVSS都将和当前存于数据库内的最新版本进行比较,若用户修改的是同一文g的不同处QVSS进行简单的合ƈQMergeQ,否则提示用户Qƈ且不允许{օ。用户可以通过VSS提供的Visual Merge工具Q比较存放于VSS数据库中的文件和本地文g的异同,手工修改本地文gQ直到认为已l可以签入时Q方才执行最l签入操作。(参见合ƈQ?/p>
在VSS中,合ƈ可能发生?U场合下Q用Multiple Checkout的工作方式;合ƈ原先已经Branch了的文gQ获取(GetQ文件?
在完成一个合q之后,VSS遵@如下规则Q?
~省情况下,当发生冲H时QVSS启用其Visual Merge工具?/p>
4.2.9 排他性签?Exclusive Check Out)*
允许多h同时{և一个文件是针对整个VSS数据库而言的,但用户仍可以Ҏ实际情况Q针Ҏ些文件修改该规则。对某个文g实施排他性签出,则其他用户将无法{և该文Ӟ直至该用户用了{օ操作?/p>
4.2.10 对工E的Cloak操作(Cloak Projects)*
若对某工E实行了Cloak操作Q则当对该工E的上一U工E进行Get/Check In/Check Out/Undo Check Out/Project Difference操作Ӟ不会媄响该工程及其子工E。而在该工E上q行cM操作Ӟ则和q_得到的结果一栗这一属性将传递给其下的子工程?/p>
例如Q某个工E其路径?/ApplicationQ下面有三个子工E:$/Application/CodeQ?/Application/TestQ?/Application/DocsQ?Docs工程下的内容可能对你没有M用处。当你每ơ从$/Application处进行Get操作后,都需要从本地删除多余的Docs目录。此时可以对Docs q行Cloak操作。这P每次的Get操作只把Code和Test下的内容攑ֈ本地。如果你需要获取Docs工程下的内容Q则可以单独从Docs处进行Get 操作?/p>
4.3 Branch、Share、Label和Pin操作(Branch、Share、Label and Pin)
4.3.1 Ҏ件和工程的Branch/Share操作(Branch and Share Files and Projects) *
在VSS中,通过Share操作Q一个文件可以被多个工程׃nQ在M一个工E中对该文g的更改,都将反映到其他相兛_E里?/p>
Branch操作则消除这U共享,每次一个被׃n的文件拆成两个分支,在不同工E中分别跟踪该文件。通过查看文g属性的Links属性页可以了解该文件被哪些工程׃nQ通过查看Paths属性页可以了解文g的分支状c?/p>
例如Q品目前的正式版本?.0Q工E\径ؓ$/ApplicationQ,在加入新功能后将升?.0。但在开始升U的q程中,光的一个过渡版?.1存在bugQ需要修攏V此时可以进行如下操作:选择被Label标识?.0的那个版本(参见l文件、工E指定标{?/u>Q,利用Share功能创徏q渡版本Q工E\径ؓ$/Application2.1Q,此时两个工程中的文g是共享的Q且$/Application2.1中的所有文仉处于Pin状态(参见 Pin操作Q?Q即Q在?.0升的过E中Q对$/Application中相x件的更改Q将不媄?/Application2.1下的内容Q但此时文g仍是׃n的。仅寚w要修改bug的文仉取Branch操作。这样做的好处是Q中间版本的bug修改工作?.0的升U工作可以同时进行,q且最大限度的降低了所需的存储空间?/p>
4.3.2 l文件、工E指定标{?Label Files and Projects) *
VSS使用3U方式跟t文件的历史记录Q内部版本号Q日期,用户自定义标{?/p>
标签可以是一个不过31个字W长度的Ԍ例如Q?1.0"?2.01b"?Final Beta"?Approved for QA"。应用Label功能Q用户就可以获取某个特定时期的Y件内容了。所有当前工E下的文件和子工E都承该标签?/p>
注意下面几点Q?
请参见附录A1Q?a >同时l护一个工E的多个版本
该功能对׃n文g很有用,管它的使用不仅限于׃n文gQ也包括其他M文g。当你对一个文件实施Pin操作后,你将不能对之做Q何修攏V如果一个文件在Pin之后又被实施了Share操作Q而被Pin的那个版本同时也是被׃n的版本,则所有共享该文g的工E都不能更改该文件。如果一个文件先被实施了Share操作Q而后在某个工E中被Pin了,则除了这个工E外的其余工E仍可以更改该文Ӟ参见Ҏ件和工程的Branch/Share操作Q?br />
VSS可以某些指定信息(例如QVSS内部版本P直接插入文本文g中。用户只要将某些关键字放入文件的注释中,每次dQAddQ或{օQCheck InQ文件时QVSS都会自动查找q些关键字,q将相关信息|于其后?/p>
VSS中常用的关键字:
关键?/td> | 描述 |
$Archive: $ | 文g在VSS中的路径?/td> |
$Author: $ | 最q一ơ更Ҏ件的用户 |
$Date: $ | 最q一ơ签入的旉 |
$History: $ | 文g的历史记?/td> |
$Revision: $ | VSS内部版本?/td> |
$NoKeywords: $ | 使VSS对其后的所有关键字不进行扩?/td> |
例如Q?/p>
在某文g中加入如下一行:
$Revision: $
若当前该文g在VSS内部的版本号?2Q则{օ后VSS会将之修改ؓQ?/p>
$Revision: 23 $
4.4.2 使用Shadow目录(Work with Shadow Folders)*
Shadow目录位于服务器端Q包含了工程中所有的文g。这些文件既非位于VSS数据库中的master copyQ亦非位于本地工作目录的local copyQ而是最q一ơ签入的所有内宏VShadow目录应该q理员来设|?/p>
是否使用Shadow目录功能是可选的Q通常在如下两U情况下可以考虑使用该功能:
Shadow目录不会跟踪子工E的变化Q例如:你有一个被Shadow的工E?/AQ包含两个子工程Q?/A/1?/A/2Q而你又将$/A/2重命名ؓ $/A/BQ这U变化将不会被反映到Shadow目录中。你可以手工修改Q或者利用Reconcile All功能Q之保持同步?/p>
4.4.3 性能优化(Optimize Performance)*
有两U方法可以改善VSS的性能Q尽可能多的内定w过|络拯x地来做;修改初始化文件对VSS的性能q行微调?/p>
具体优化措施Q?
Diff_Ignore (PC) = c-e-s-w-
使VSS在进行文件比较时忽略end-of-line标记Q从而加快运行效?/p>
CP_OnSelection = No
在用VSS ExplorerӞ~省状态下Q用户用鼠标单L使用键盘的方向键在工E列表上UdӞ׃选中工程。设为No后,只有双击鼠标或按回R键才会选中?/p>
~省情况下,VSS时文件存于服务器端,但管理员可以通过修改SS.INI中的Temp_Path变量Q将临时路径讄在本地?/p>
q是SRCSAFE.INI中该变量的缺省设|,把该变量讄为Native几乎所有的VSS操作都得到加速。该变量只能q理员来设|?/p>
VSS Explore的list view~省时只昄当前工程中的所有文件。通过使用Search命oQ可以只昄W合指定要求的文件。例如:只显C?.h文gQ只现实被签出的文g。Search命o是允讔R归的?/p>
如果VSS理员指定域账号为VSSd账号Q则用户dVSS时将不会提示输入密码?/p>
4.4.6 ~写批处理文?Writing Batch Files)*
在编写批处理文gӞ一些在命o行方式下使用的交互手D需要改变?/p>
如果你的批处理文件中包含了一pdVSS命oQ它们可能需要整夜运行)Q你一定不希望E序执行期间会停下来提示用户输入信息。有3个命令行选项可以解决此类问题?/p>
~省ӞVSS在执行诸如添加(AddQ、签入(Check InQ等操作时会提示你输入注释(CommentQ,利用-c选项可以避免该类提示Q?
命o | 描述 |
-c- | 不添加注?/td> |
"-cHello" | 使用Hello字串作ؓ注释 |
-c@COMMENT.TXT | 使用comment.txt文g的内容作为注?/td> |
此外QVSS通常会要求用户回{yes或noQ你可以使用-i选项避免此类问题Q?
命o | 描述 |
-i-y | Ҏ有此cL问自动回{Yes |
-i-n | Ҏ有此cL问自动回{No |
-i | 使用~省回答 |
VSS也可能会提示d名,你可以?y选项提供_多的信息?/p>
~省ӞVSS所有输出定向到屏幕Q在命o行状态下你可以?o选项分页输出Q而在批处理文件中你同样可以利?o屏蔽输出或重定向输出?
命o | 描述 |
-o- | 屏蔽输出 |
-oRESULTS.TXT | 重定向所有输出到文本文gresults.txt中,如果该文件已存在Q输出内容将q加到该文g末尾?/td> |
在命令行状态下q行VSSӞVSS会设|一些返回值来标明q行状态。你可以在批处理文g中根据VSS的返回值采取相应措施?
q回?/td> | 描述 |
100 | 表明出错Q例如:VSS无法扑ֈ数据库文Ӟ或者你试图{և某个早已被签出的文g?/td> |
1 | 表明一个不是很严重的错误,在如下三种情况下发生: 当你使用ss DirӞ没有扑ֈM条目?br />当你使用ss StatusӞ臛_有一被{և?br />当你使用ss DiffӞ臛_有一个文件不一致?br />所有这些情况表明,即本次操作是成功的Q你执行的下一个VSS命o也可能操作失败?/td> |
0 | VSS成功执行?/td> |
4.4.7 定制SS.INI和SRCSAFE.INI文g(Customize the SS.INI and SRCSAFE.INI Files)
VSS有两cd始化文gQ它们包含了VSS的一些环境变量:SS.INIQ每个用户都有一个这L文gQSRCSAFE.INIQ仅有一个,定义了VSS 的一些全局变量Q只有管理员才有权修改它?/p>
附录 同时l护一个工E的多个版本(Maintain Multiple Versions of a Project)
你可以用Share/Pin/Branch的方式,也可以用Label方式。如果你所处的环境只要求少量的改动Q比如:轻量U的patchQ?Label比较合适;如果你正在规划大量的开发内容,使用Share/Pin/Branch比较合适。例如:在Y件处于Beta版时Q你可以通过Label功能ȝQfreezeQ之Qƈ同时修改Beta版的bug。当你正同时l护着某个产品?.1版和2.0版时Q合理的做法是,为每个版本创Z个新的工E, ShareqPin所有的文gQ在需要的时候Branch。当1.1发布Ӟ你可以将1.1版的工程LabelQ而后对1.1版的改动重新Merge?.0版中。下面的几个场景Z使用Label功能提供指导Q?/p>
场景1Q理x?/b>
1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?
场景2Q文件A的某个版本被错误地包含在Beta 1版中
1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?
4、如果发现文件A某一时期的版本被错误的包含在了Beta 1版中Q选择该文件的正确版本qLabel?Beta 1"?br />5、获取(GetQBeta 1 版的工程?
场景3Q需bug-fix后的文gA被包含在Beta 1版中Q而其余文件未曾改?/b>
1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?
4、你发现Q包含在Beta 1版中文gA的那个版本存在bugQ必L正,而工E中的其余文件则不须改动?br />5、签文gQ改正,然后{օ?br />6、将工程重新Lable?Beta 1"Q你被询问是否认删除原有标记Q?
场景4Q需bug-fix后的文gA包含在Beta 1版中Q而其余文件也作了改动
1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?
4、你发现Q包含在Beta 1版中文gA的那个版本存在bugQ必L正,而工E中的其余文件已l改动过且已l被{օ?br />5、签文gQ改正,然后{օQ此时该文g的VSS内部版本号将自动?Q?br />6、将该文件Label?Beta 1"Q和工程的Label同名Q,q将使该文g的现有版本被指定?Beta 1"?
场景5Q文件A的一个原有版本需要进行bug-fixQƈ加入Beta 1版中
1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?
4、你发现Q包含在Beta 1版中文gA的那个版本存在bugQ必L正。例如:文g的当前内部版本号?Q且包含了ؓ辑ֈBeta 2版所做的某些改动Q而你不希望将q些改动q入Beta 1版中?br />5、签出文件AQVersion 6Q?br />6、获取Version 4Q覆盖Version 6的本地版本?
7、修改该文gBeta 1版中的bugQ然后签入。这文gA的内部版本号升至7QVersion 4的内容加上bug-fix后的内容Q但没有包含 Version 5和Version 6的内容)
8、将Version 7 Label?Beta 1"。这文gA的Version 7版被指定?Beta 1"。现在,如果你尝试获取Beta 1版的工程Ӟ你将会得到包含bug-fix后的文gAQ被单独LabelQ连同原来Label?Beta 1"的工E中的其余文件?br />9、ؓ了l?Beta 2版的工作Q需要恢复在Version 5和Version 6上的改动Q再ơ签出文件AQVersion 7Q?br />10、获取Version 6?br />11、覆盖Version 7的本地版本,或合q之Q这本地版本变成Version 6的内容加上你在Version 7中ؓ"Beta 1"所做的bug-fixQ?br />12、l修Ҏ件A的本地版本直C满意Q然后签入。这生文件A的Version 8Q现在你可以lBeta 2版的工作了?br />
下表中打星号表示h该类权限的用户可以用该命o?
功能 | R | C | A | D |
Add | * | * | ||
Branch | * | * | ||
Check In | * | * | * | |
Check Out | * | * | * | |
Cloak | * | * | * | * |
Create [1] | * | * | ||
Delete | * | * | ||
Destroy | * | |||
Difference | * | * | * | * |
Get Latest Version | * | * | * | * |
History | * | * | * | * |
Label | * | * | ||
Links | * | * | * | * |
Merge [2] | * | * | * | |
Merge | * | * | * | * |
Move [3] | * | * | ||
Move | * | |||
Pin | * | * | * | |
Purge | * | |||
Recover | * | * | ||
Rename | * | * | ||
Rollback | * | |||
Share [4] | * | * | * | |
Share | * | * | ||
Undo Check Out | * | * | * | |
Set Working Folder | * | * | * | * |
[1] 此处指用户必L对Parent Project的AcL限?br />[2] 此处指用户必L对目的Project的CcL限,同时有对原Project的RcL限?br />[3] 此处指用户必L对目的Parent Project的AcL限,同时有对原Parent Project的DcL限?br />[4] 此处指用户必L对原 Project的CcL限,同时有对目的Project的AcL限?
如需复制、传播,请附上本声明Q谢谢。原文出处:http://morningspace.51.net/Q?moyingzz@etang.com
![]() |
JMeter ?Apache l织的开放源代码目Q它是功能和性能试的工P100%的用java实现Q最新的版本?.9.1。本文中作者将向大家介l如何?JMeter q行试?/BLOCKQUOTE> |
SessionQ会话)接口是Hibernate应用使用的主要接口。会话接口的实例是轻量的ƈ且创Z销毁的代h也不昂贵。这很重要因Z的应用可能始l在创徏与销毁会话,可能每一ơ请求都会如此。Hibernate会话q不是线E安全的因此应该被设计ؓ每次只能在一个线E中使用?o:p>
Hibernate会话是一个介于连接和事务之间的概c?FONT color=#ff1493>你可以简单地认ؓ会话是对于一个单独的工作单元已装载对象的~存或集合。Hibernate可以到q个工作单元中对象的改变?/FONT>我们有时也将会话UCؓ持箋性管理器Q因为它也是与持l性有关的操作例如存储和取出对象的接口。注意,Hibernate会话与Web层的HttpSession没有M关系。当我们在本书中使用会话Ӟ我们指的是Hibernate会话。ؓ了区别,有时我们HttpSession对象UCؓ用户会话?o:p>
SessionFactory接口
应用?/SPAN>SessionFactoryQ会话工厂)里获得会话实例。与会话接口相比Q这个对象不够o人兴奋?/SPAN>
会话工厂当然不是轻量U的Q它打算在多个应用线E间q行׃n。典型地Q?FONT color=#ff1493>整个应用只有唯一的一个会话工厂——例如在应用初始化时被创建。然而,如果你的应用使用Hibernate讉K多个数据库,你需要对每一个数据库使用一个会话工厂?o:p>
The cost impact to a company of a failed project can be severe indeed. The impact on the reputation of the project manager can be disastrous.
Software project management is not easy, and it requires considerable skill to successfully manage the many different risks that conspire to de-rail a project:
Numerous methodologies are available for mitigating these risks ?PRINCE2, RUP, DSDN, eXtreme programming ?and these have helped to some extent.
This document introduces the 3D?methodology ?a set of best practices and quality tools developed by BuildMonkey, which can be summarised as.
De-risk. Deploy. Deliver.
In any software project, deployment is a milestone on the project plan that is usually associated with payment ?or staged payment. Through the course of development, any number of problems can arise to derail efforts to reach this milestone.
The 3D?methodology and supporting toolset is based on many years of experience at the sharp end of projects, understanding what has worked and what has not, and the lessons learned from each.
Competent practitioners, and experienced project staff, will find resonance with many of the contents of this document and may find themselves saying ?EM>this is just common sense? This is certainly true, but the main problem with common sense is that it is not as common as people think it is.
This document, and the 3D?methodology, is an attempt to bring that common sense together in a single location, as a coherent set of best practices supported by proven tools to help you to release on-time, on-budget, with no defects.
No methodology has yet focused on the component that all development projects share ?the build.
One of the reasons for this is that the term “build?is interpreted differently by different people:
The BuildMonkey view is that the build is the combination of processes and technology that take software from design to deployment ?_where the return on investment starts to be seen.
It is clear that a methodology is required to de-risk development projects and to standardise use of the term “Build Management?
Best Practice: ?EM>Build Management?encompasses everything from compilation, all the way through to release to the customer.
Any Finance Director knows that development is just an activity that needs to be tolerated in order to produce something that will deliver a return on investment.
It may sound strange, but a large number of software developers do not appreciate and embrace this basic truth. This is in part due to their closeness to the application being constructed.
A common problem faced by development projects is therefore that it is the software developers who manage the build. This creates a situation where the build is focused on the needs of development, and is not geared towards releasing the output of coding such that business value can be realised.
Build Management should therefore focus on the end result of development ?a return on investment ?and ensure that all of the inputs to the process are incorporated in pursuit of this goal:
Best Practice: Focus on the end, and accommodate the inputs
Software projects are a complex set of interdependent people and teams and can be likened to a convoy of ships. A convoy has to move at the rate of the slowest ship. Increasing the speed of a single ship in the convoy will not increase the speed of the convoy ?it will simply increase the amount of wasted capacity in the speeded-up ship.
Speeding up the slowest ship will, however, have a positive effect since the whole convoy can now move faster.
Many Project Managers try to improve productivity by implementing some degree of automation in development projects ?particularly in the area of the build ?and often purchase ?EM>magic bullet?build software that provides this.
Simply using automated build software does not improve productivity any more than the example above improves convoy speed - as it only increases the speed of a single ship in the convoy.
There is no point in speeding up development, if the target production infrastructure cannot keep pace ?this just increases the inefficiency. A lot of organisations make this mistake ?highly agile development processes trying to feed into considerably less agile deployment processes. The result is inefficiency, waste and over-run.
Before considering using an automated build tool it is essential to ensure that the inputs to, and outputs from, the build can cope with the improved build speed. It is imperative to ensure that the processes and technology employed are geared towards taking the project to a successful conclusion ?on-time and on-budget.
Best Practice: Don’t rely on software tools alone, they may solve symptoms whilst creating problems elsewhere
Software Configuration Management (SCM) is a relatively mature discipline with much written about methodologies and techniques, and these will not be recreated here.
We will focus instead on leveraging the SCM repository, and the facilities that it offers, to further the goals of the project rather than to consider SCM in its own right.
The SCM repository - how it is managed and used ?is the keystone of good build management and successful delivery of projects.
The SCM repository is the slave of the project, not the other way round. It should be solid and reliable, yet flexible enough to accommodate the needs of new projects. Project Managers should not have to retrofit their planning to accommodate an inflexible SCM setup.
If used correctly, the SCM repository will enhance productivity, and minimize risk, through being able to provide exactly what the project ?and project management ?require. If used incorrectly, it can cause delay and slippage through having to do things inefficiently further down the chain.
Best Practice: The SCM repository is the slave of the project, not the other way round.
Most software developers regard the SCM repository as a massive storage area where they simply check versions in and out ?a common cause of problems.
Simply checking things into an SCM repository is not Configuration Management any more than karaoke is opera.
A well-maintained SCM repository is so much more than version control, and should provide:
In order to be truly effective in a project, the SCM repository should store all of the artifacts that form part of a baseline or a release.
Source CodeMost development projects simply store the code that is being developed and their use of the SCM repository is no more sophisticated than this.
DataMost applications nowadays are not just source code. Take the example of a modern computer game ?the vast majority of the code base is made up of artifacts other than code such as audio clips, pictures and movie clips.
Database Structure and ContentsWhere an application relies on a database this database will have a schema and structure that may change from release to release ?this schema must be captured.
There will normally also be seed data for the database which should be considered as part of the baseline.
Application ConfigurationIn a large distributed application, the software being developed will sit atop a number of pieces of software (e.g. application servers, web servers and message queues).
The configuration of these underlying applications have an effect on the quality ?or otherwise ?of the software being developed and should, therefore, be considered part of the baseline for a release.
Environment ConfigurationThe underlying environment and infrastructure is a key component of the project, particularly in the case of distributed applications.
Such banal considerations as DNS zone files, user account information and system parameters have to be considered as some of the moving parts which affect the application and therefore be placed under configuration control.
This is of particular importance when there is more than one environment involved in the project (e.g. a development environment and a separate test environment) since the question of ?EM>are these environments the same??crops up again and again.
Best Practice: Everything that can be changed, and affect the behaviour of the application, is a candidate for configuration control
It is a common misconception that simply applying labels, or tags, to the SCM repository creates a baseline but this is only partly true without corresponding records of:
The use of a naming convention for labels can deceive even further. For example, a project that uses a date-based labeling convention (dd_mm_yyyy) will have several labels of the form (03_05_2004, or 09_06_2004) and will reasonably assume that they have some kind of record of the baseline on those dates.
But what was happening in the project on those dates? Was the 03_05_2004 label applied immediately before a release to test, or immediately after?
Best Practice: Labels should be used to identify and inform about events in the project
Don’t Label If There Is No PointThis may seem like stating the obvious, but there should be a reason for a label being applied ?the whole purpose of labeling is to identify some event in the development cycle that may need to be re-visited.
To this end, labels can be divided into two categories:
Best Practice: Every label should have a point, whether point-in-time or point-in-process
The job of the Project Manager, ultimately, is to bring the project to a successful conclusion. If this were an easy task that happened by default, then there would be no need for a Project Manager.
In order to be able to do this job well, a Project Manager needs information. He needs to know what is going on in the project ?who is doing what, who is working on which components, and a wealth of information can be obtained from a well-managed SCM repository:
Of course, the final item in the list requires that committers are using descriptive comments to indicate why they are marking a particular change. A well-managed SCM repository should enforce this.
Best Practice: The SCM repository should provide meaningful, and accessible, management information
As explained at the beginning of this document, the term “build?means different things to different people. The most common interpretation is the one used by developers, where the term “build?describes the compilation and assembly step of their development activities but this narrow interpretation is a common cause of problems and over-runs, on development projects.
At the outset of the project, the Project Manager will ask the question ?EM>how long to set up the build??and a developer ?thinking of compilation and assembly ?will answer something like ?EM>1 day?/EM> ?a task and duration which is then duly marked on the project plan and development begins.
Later in the project, when it is time to start deploying and testing the application, this “build?needs to be refactored to accommodate the deployment and test tasks. In doing so, it turns out that the way the application is being assembled is not conducive to it being deployed or tested correctly ?so the compilation and assembly staged need to be refactored as well.
In the meantime, the development team sits on its hands whilst the “build?is refactored to accommodate the needs of the project ?valuable time is lost whilst the deadline continues to advance.
Best Practice: Know what will be required of the build before starting to write the scripts
From a build perspective, projects with similar architecture (both in terms of the team and the application) will have similar attributes. There will obviously be some changes required, but these will tend to follow the 80/20 rule to a large degree.
For example, a web application that is being developed by an in-house team and that will be deployed to a Tomcat servlet container and Oracle database will follow largely the same steps and require largely the same deployable artifacts.
A good SCM repository will enable the latest versions of boiler-plate build scripts for such an application to be found. These can be used almost off-the-shelf ?meaning that development can start apace without having to wait on the build to be constructed for similar applications .
Best Practice: Well-crafted builds are re-usable and should be re-used
Following on from the previous section, it should be clear that the architecture of what is being developed ?and the structure of the team(s) developing it ?will dictate how the build should look.
There is little value to be gained in trying to retrofit build scripts for a computer game (developed by 12 people all in the same room) into a project to produce a large J2EE application with development occurring at six different sites around the world.
Best Practice: Well-crafted builds are flexible, but a “one-size-fits-all?approach can be costly
There are a number of people who need information that the build can provide:
A good build infrastructure will provide all of the above information, and more besides.
Best Practice: The build should tell all project participants what they need to know
Considering that it is generally an important milestone on a project plan, normally resulting in payment or a staged payment, deployment is one of the most overlooked areas of software development.
The normal course of events is:
When a documentation team are also considered - responsible for creating documentation that the end user will need to install, configure and use the application ?the situation becomes even more difficult.
This situation can be avoided by planning for deployment from the beginning. Deployment is an inevitable part of software development, yet it always seems to take people by surprise.
Best Practice: Know that deployment is inevitable, and incorporate it into the automated processes
As part of normal development activities, artifacts are installed into sandbox environments ?and test environments ?many times. But this is not deployment, this is installation.
In order to get an application into its production environment, be that an internal environment or on hosted-infrastructure, a number of hurdles must be overcome:
Deployment is that point in the life of an application where it starts to produce a return on investment. ?EM>Launch? ?EM>Go-live? ?EM>Release? ?EM>First Customer Shipment?are all phrases which describe the same event.
Best Practice: Deployment is the point where an application starts to provide a return on the development investment.
This point cannot be stressed enough, particularly in large distributed applications.
Every application, large or small, has a runtime environment in which it operates. In a simple desktop application, this is a standalone machine (such as a PC). In larger applications, this will be a combination of machines (e.g. an application server and a database) operating together to provide the runtime environment.
In either case, the application expects certain facilities to be available from the runtime environment and will function incorrectly ?or cease to function ?if these are not present .
The environment itself, whether standalone or a network, contains many moving parts that can be independently configured. IP addresses, or hostnames, can be changed. User privileges can be modified or revoked. Files and directories can be removed. Each of these can have an effect on the way that the application behaves.
In an environment that is owned and managed internally this can be bad enough. In an environment that is owned and managed by an external third party, and where project success is contingent upon successful UAT in that environment, this can be disastrous.
Best Practice: Be able to identify whether the deployment environment is as prescribed, and ?EM>fit for deployment?/P>Environment Verification Testing
One of the most common questions that arises in development projects containing more than one environment is, simply, ?EM>are these environments the same??and its answer can be elusive.
It is essential to be able to answer that question ?quickly and accurately ?so that any perceived defects in the application can be categorised as ?EM>defect?or ?EM>environmental?
This ability becomes particularly poignant where on or more of the environments are owned by different teams, or organisations.
Best Practice: Be able to prescribe what the deployment environment should look like, and have a capability to test it quickly.
Regression TestingThe environment, as explained earlier, is a refactorable component. It can be changed, and parts can be moved or deleted. However, unlike application code, changes may need to be made to the environment in response to external events (e.g. hardware failure, or security policies).
Applications, particularly complex ones, use regression tests to ensure that observed behaviour after a change is exactly as it was before the change was made. The same should be true of the environment.
Best Practice: Automated regression tests for the environment that will compare observed behaviour both before and after changes are made.
For example, suppose that a number of operating system patches or service packs are applied to an environment where the application has been, or will be, deployed. How are these tested? Do you wait for users, or testers, to start calling to say that there are problems?
Or do you make sure that you know what problems have been introduced before your users do?
Configuration ManagementAs stated earlier, the SCM repository should be used to store any artifact that can be changed and that may have an effect on the environment.
It may not seem obvious, but some of the most obscure environmental changes can cause an application to fail:
It is essential that these environmental variables be placed under configuration control and able to be identified as part of a baseline.
Best Practice: Environmental artifacts that are not part of the application should be part of the baseline
Every single task that is performed as part of a development project ?throughout the entire lifecycle ?can be placed into one of two categories:
Tasks which fall into the first category can use some degree of automation, but should stop and wait for human intervention wherever judgment is required.
Tasks in the second category should be automated. There is no value in having expensive resources employed to do mechanical or repetitive tasks that a computer could do more quickly, accurately and consistently.
Best Practice: Automate anything that does not require human judgment
A note of caution - it may be tempting to think that automation will increase productivity on its own, but this is not necessarily the case. Automating an inefficient process will simply magnify its inefficiency ?as explained in the section on Software Tools are Only Part of the Answer.
This, and it is worth repeating, is a common error ?to assume that automated build software alone will improve productivity.
Best Practice: Do not automate inefficient processes, or you will only maximize the inefficiency
BuildMonkey is a division of Nemean Technology Limited - a leading technical innovator specialising in Agile Deployment and build management.
We have over a decade of experience in helping clients increase productivity in their build, integration and test cycles. We have a track record of massively reducing costs and defects through process automation and proven methodologies.
Formed in 1999, and profitable every quarter, we invented the discipline of BuildMaster - we are the original and the best.
We provide specialist Build Management products and services - when all you do is Build Management, you get pretty good at Build Management. Our world-class Professional Services staff are the best in their field, complemented by original software products of the finest quality.
We aim to be the leading provider of Build Management products and services in the UK by providing excellent service to our customers, and by empowering Software Project Managers to aim for release on-time, on-budget, with no defects.