專案團隊效能的影響因素及生成
新手PM的基礎觀念
文章分類
.NET 5
.NET Core
.NET FrameWork
3C
工作室佈告欄
心理探討
專案測試
軟體工程
開發流程
Agile
Algorithm
ALM
Android SDK
Angular
AngularJS
Architecture
ASP.NET
ASP.NET Core
Books
Bower
C#
C# (Extensions)
ChatBot
CLOUD
Comic
CSS
Dapper
Design Pattern
DevOps
Django
Docker
Domain Driven Design
Entity framework
EXCEL
Financial Derivatives
Firebase
Flask
Front-end
GIT
GitHub
Golang
GraphQL
Gulp
Identity Server
IIS
javascript
jQuery
Keyboard
L-I-F-E
LetsEncrypt
LINQ
LINUX
MongoDB
Multi-Thread
Nuget
Open Source
Oracle
OS
Performance issue
PostgreSQL
Project Management
Python
RabbitMQ
Redis
Redux
RxJS
SAP TM
Scrum
SEO
Sharepoint
Sql Server
SSRS
Study
Swagger
Team Foundation Server
TensorFlow
Testing
Toolkits
Tricking
Trouble Shooting
UML
Unit Test
Vim
Visual Studio
Visual SVN Server
VSCODE
Vue
Web Api
Web Service
WebStorm
Windows Application
WSL
2012年6月29日 星期五
2012年6月27日 星期三
2012年6月24日 星期日
[UML] Class Diagram for C#
[UML] Class Diagram for C#
This article is designing a Class Diagram for the ROLES Classes in a Star Wars game.
In this game, every person have his/her own role type which can be "Civilian", "Warrior", "Politician" ... etc.
The following claass diagram only shows how a "Warrior" use their weapons.
Picture 01 - The whole diagram
That means CWarrior implements IWarrior.
2. Aggregation
We use a enum class named CCamp in CWarrior.
A warrior belongs to no or only one camp.
A camp can keep existing even when a warrior disappear.
So the relation between them is Aggregation.
4. Composition
We use CWeapon in both CJedi and CSith.
In my opnion, the weapons cannot be used if the Jedi and Sith warriors all disappear.
So I use the Composition relation here.
That means CWeapon only exist or use with CJedi and CSith, other class can't use CWeapon.
Furthermore, one jedi/sith can only have one weapon, so the multiplicity is set to be 1 to 1.
Test result ...
A warrior named "白兵" used his weapon.
output : 白兵 使用了武器。
A Jedi named "路克天行者" used his weapon.
output : 絕地武士 路克天行者 使用了武器 - Light_Saber。
A Sith named "達斯維達" used his weapon.
output : 西斯武士 達斯維達 使用了武器 - Light_Saber。
Reference :
http://www.webdsai.idv.tw/?p=2329
This article is designing a Class Diagram for the ROLES Classes in a Star Wars game.
In this game, every person have his/her own role type which can be "Civilian", "Warrior", "Politician" ... etc.
The following claass diagram only shows how a "Warrior" use their weapons.
Picture 01 - The whole diagram
1. Realization
So I create a class named CWarrior, which implements the interface IWarrior.
The relation between them is Realization.That means CWarrior implements IWarrior.
public class CWarrior : IWarrior { private CCamp myCamp; //陣營 protected String myName; //名稱 /* cCamp */ public CCamp Camp { get { return myCamp; } set { myCamp = value; } } /* sName */ public String Name { get { return myName; } set { myName = value; } } /* 使用武器 */ public virtual void Use_Weapon() { Console.WriteLine("{0} 使用了武器。", myName); } }
We use a enum class named CCamp in CWarrior.
A warrior belongs to no or only one camp.
A camp can keep existing even when a warrior disappear.
So the relation between them is Aggregation.
public enum CCamp { Empire, Rebel_Alliance }
3. Generalization
Next step, we create two class CJedi and CSith , to generalize CWarrior.
We add an additional property : CWeapon Weapon (see 4.),
and a override method : Use_Weapon() to use Jedi's and Sith's special weapons.
The Generalization between a child class and a father class is showed in picture 04.
public class CJedi : CWarrior { public CWeapon Weapon; //武器 /* 使用武器 (改寫) */ public override void Use_Weapon() { Console.WriteLine("絕地武士 {0} 使用了武器 - {1}。", this.myName, this.Weapon); } } public class CSith : CWarrior { public CWeapon Weapon; //武器 /* 使用武器 (改寫) */ public override void Use_Weapon() { Console.WriteLine("西斯武士 {0} 使用了武器 - {1}。", this.myName, this.Weapon); } }
We use CWeapon in both CJedi and CSith.
In my opnion, the weapons cannot be used if the Jedi and Sith warriors all disappear.
So I use the Composition relation here.
That means CWeapon only exist or use with CJedi and CSith, other class can't use CWeapon.
Furthermore, one jedi/sith can only have one weapon, so the multiplicity is set to be 1 to 1.
public enum CWeapon { Laser_Gun, Light_Saber }
Test result ...
A warrior named "白兵" used his weapon.
output : 白兵 使用了武器。
A Jedi named "路克天行者" used his weapon.
output : 絕地武士 路克天行者 使用了武器 - Light_Saber。
A Sith named "達斯維達" used his weapon.
output : 西斯武士 達斯維達 使用了武器 - Light_Saber。
Reference :
http://www.webdsai.idv.tw/?p=2329
2012年6月20日 星期三
[資料庫] 交易隔離等級
http://www.dotblogs.com.tw/joysdw12/archive/2011/08/03/32504.aspx
http://msdn.microsoft.com/zh-tw/library/system.data.isolationlevel
http://caryhsu.blogspot.tw/2011/09/sql-server.html
http://neo_lin_42.blog.ithome.com.tw/post/620/6287
http://jackyshih.pixnet.net/blog/post/6154337-sql-server-lock-%E6%9E%B6%E6%A7%8B%E8%AE%80%E5%BE%8C%E5%BF%83%E5%BE%97
http://www.dotblogs.com.tw/topcat/archive/2008/05/15/3998.aspx
http://msdn.microsoft.com/zh-tw/library/system.data.isolationlevel
http://caryhsu.blogspot.tw/2011/09/sql-server.html
http://neo_lin_42.blog.ithome.com.tw/post/620/6287
http://jackyshih.pixnet.net/blog/post/6154337-sql-server-lock-%E6%9E%B6%E6%A7%8B%E8%AE%80%E5%BE%8C%E5%BF%83%E5%BE%97
http://www.dotblogs.com.tw/topcat/archive/2008/05/15/3998.aspx
2012年6月8日 星期五
[C#] 無法建置專案輸出群組'內容檔'...
今天在把舊有的專案的組件名稱和預設命名空間修改之後,
發現原來的佈署專案,建置的時後出現了
無法建置專案輸出群組'內容檔'...
這個錯誤訊息,後來發現是因為專案屬性更改前,我就手動把原本的專案編譯出來的dll砍掉了,
但是Visual Studio還是留著這個dll的紀錄,所以在建置內容檔時會出現這個錯誤。
所以下次如果有這個問題,不妨先看一下方案總管裡面是否有出現驚嘆號的檔案或其它文件。
發現原來的佈署專案,建置的時後出現了
無法建置專案輸出群組'內容檔'...
這個錯誤訊息,後來發現是因為專案屬性更改前,我就手動把原本的專案編譯出來的dll砍掉了,
但是Visual Studio還是留著這個dll的紀錄,所以在建置內容檔時會出現這個錯誤。
所以下次如果有這個問題,不妨先看一下方案總管裡面是否有出現驚嘆號的檔案或其它文件。
訂閱:
文章 (Atom)