8.0

Topic 8.0

1. Step 1: Handel Ambiguity

1) Obeject-oriented design questions are ofter intentionally vague in order to test whether you’ll make assumptions or if you’ll ask clarifying questionsAfter all, a developer who just codes sth without understanding what she is expected to create wastes the companys’s time and money.

2) Iquire who is going to use it and how they are going to use it !!!!!!!!!!!!

3) Six Ws: who, what, where, when, how, why

2. Step 2: Define the Core Objects

3. Step 3: Analyze Relationships

4. Step 4: Investigate Actions.

5. Design Patterns

1)  Interviewers are trying to test your capabilities and not your knowledge !!!!!!!!!

2) Singleton Class: ensures that a class has only one instance.

public class Restaurant{//以_开头是一种习惯,表示全局变量

     private static Restaurant _instance=null;
     public static Restaurant getInstance(){
         if (_instance==null){
             _instance=new Restaurant();
         }
         return _instance;
     }
}

3) Factory Method: offers an interface for creating an instance of class, with its subclasses deciding which class to instantiate.

publicclass CardGame{
public static CardGame createCardGame(GameType type){
            if (type==GameType.Poker){
               return new PokerGame();
            }else if (type==GameType.BlackJack){
                return new BlackJackGame();
            }
            return null;
        }
    }


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值