ՄೳͳݶΓυϝΠϯαʔϏεΛආ͚Δ // ࣗࣗʹ͍߹Θ͍ͤͯΔ UserId userId = new UserId("id"); UserName userName = new UserName("yoshida"); User user = new User(userId, userName); boolean existsUser = user.exists(user); // ॏෳ֬ೝઐ༻Πϯελϯεʹ͍߹Θ͍ͤͯΔ UserId userId = new UserId("id"); UserName userName = new UserName("yoshida"); User user = new User(userId, userName); UserId checkId = new UserId("check"); UserName checkName = new UserName("check"); User checkObject = new User(checkId, checkName); boolean existsUser = checkObject.exists(user); public class UserService { public boolean exists(User user) { // SQL Λୟ͍ͯ DB ʹଘࡏ͢Δ͔֬ೝ͢Δॲཧɻ͍ɻ // SQL Λୟ͍ͯ DB ʹଘࡏ͢Δ͔֬ೝ͢Δॲཧɻ͍ɻ // SQL Λୟ͍ͯ DB ʹଘࡏ͢Δ͔֬ೝ͢Δॲཧɻ͍ɻ // SQL Λୟ͍ͯ DB ʹଘࡏ͢Δ͔֬ೝ͢Δॲཧɻ͍ɻ return false; } }