2012年9月26日 星期三

POSD學習筆記(1)-UML

1. Know:A可能有call到B這個funtion,但是B如何並不會影響到A的結果。
                相反的,B並不知道A的存在。

2. Use:A有使用到B,且B改變時,A改變。但是A改變時,B不變。此為單向關係。

3. Has:假設A為硬碟,B為資料,則當A爆炸時,B也不復存在。

4. Has:假設A為公司,B為員工,但是當公司倒閉時,員工仍然健在。
(↑這項不實用且不常使用)

5. Is:假設A為人類、B為台灣人、C為日本人、D為美國人,
         「台灣人」、「日本人」、「美國人」都繼承於「人類」這一類別,
          則B、C、D都繼承於A。

2012年9月1日 星期六

PHP學習筆記(1)-變數與字串

字串的表示可以用" "或' ',不同處在於在" "中若出現已宣告的變數,會將其代號轉換成變數內容,而' '則不會。
(You can use also " " or ' ' to present a string, the difference is that if there are any variables in the string with " ", the output will be the content of the variable, although ' ' will only print the name of it.)

Ex:
   $test1 = "hi";
   $op1 = "$test1 ,I am handsome <br/>";
   $op2 = '$test1 ,I am handsome';

   echo $op1;
   echo $op2;

   輸出(output):
   hi ,I am handsome
   $test1 ,I am handsome

也可以用 . 來連接變數及字串。
(You may use . to combine variable and string, too.)

Ex:
   $test1 = "hi";
   $op1 = $test1 . " ,I am handsome <br/>";
   $op2 = $test1 . ' ,I am somehand';

   echo $op1;
   echo $op2;

   輸出(output):
   hi ,I am handsome
   hi ,I am somehand