> For the complete documentation index, see [llms.txt](https://brianwu.gitbook.io/brian/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brianwu.gitbook.io/brian/brians-za-ji/guan-nian.md).

# 觀念

## 前後端切開的注意事項

參考資料:(<https://www.ptt.cc/bbs/Soft_Job/M.1539323660.A.6C1.html>)

利用token去做驗證，合法的才給資料，不合法的不給。

## Singleton

參考資料:(<https://openhome.cc/Gossip/DesignPattern/SingletonPattern.htm>)

一個類別只有一個實體

範例:

```
class UnitManager 
{     
    private final static UnitManager instance_ =  new UnitManager();     
    private UnitManager()     
    {         
        ...     
    }     
    public static UnitManager getInstance() // NOT: get() or instance() or unitManager() 
    {         
        return instance_;     
    } 
} ///:~。
```

\*(JAVA社群常用的實踐方式，但並未一致性地被使用在JDK內，只是建議的方式。)
