Skip to content

[Ch 14] 외부 기술과 자바 안에서의 협력 #49

@kiwoook

Description

@kiwoook

💡 이슈

  • 기술적 제약이 있는 상황에서 협력을 중심으로 객체 설계를 어떻게 해야할 지 궁금합니다.

❓ 이유

  • 스프링을 사용하게 되면 ORM과 트랜잭션 처리, 외부 API 연동과 같은 외부적인 제약과 활용하게 됩니다. 그렇게 된다면 트랜잭션 범위를 설정하는 데에서 문제가 발생하게 되고, 과연 우리가 원하는 협력을 잘 만들어낼 수 있을까 궁금합니다.
@Entity
public class BankAccount {

    @Transactional  // ❌ 작동하지 않음
    public void deposit(Money amount) {
        this.balance = this.balance.plus(amount);
    }
}

📖 관련 페이지

Metadata

Metadata

Assignees

Labels

ch14일관성 있는 협력

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions