Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例として使用しましょう:
class AccountDAO { create(){..} read(){..} update(){..} delete() {..} }
責任はいくつありますか?1または4?
SRPを厳密に理解するべきではありません。1つのオブジェクトには、「1つ」ではなく、非常に少ない責任が必要です。
ここで、AccountDAOはアカウントの永続性のみを担当するため、責任は1つだけです。