75. Stereotype 實際應⽤用
❖ Spring Framework 軟體元件類型
❖ Component (元件)
❖ Controller (e.g. a web controller).
❖ Repository (or called DAO, Data Access Object).
❖ Service (e.g. a business service facade).
109. public class Game
{
private String gameName;
public Game(String name) {
gameName = name;
}
public void login(String password) {
Server server = new Server();
if (server.check(password)) {
System.out.println("登⼊入成功");
}
}
public void play() {
System.out.println("正在執⾏行遊戲: " + gameName);
}
}
110. public class Server
{
public boolean check(String password)
{
if (password == "1234") {
return true;
}
return false;
}
}