Coder Social home page Coder Social logo

core's Introduction

비즈니스 요구 사항과 설계

-회원

  • 회원을 가입하고 조회할 수 있다.

  • 회원은 일반과 VIP 두가지 등급이 있다.

  • 회원 데이터는 자바 DB를 구축할 수 있고 외부 시스템과 연동할 수 있다.(미확정)

-주문과 할인 정책

  • 회원은 상품을 주문할 수 있다.

  • 할인 정책은 모든 VIP는 1000원을 할인해주는 고정 금액 할인을 적용해달라(나중에 변경 될 수 있다.)

  • 할인 정책은 변경 가능성이 높다 . 회사의 기본 할일 정책을 아직 정하지 못했고, 오픈 직전까지 고민을 미루고 싶다. 최악의 경우 할인을 적용하지 않을 수 도 있다(미확정)

  • 인터페이스를 만들고 구현체를 언제든지 갈아끼울 수 있도록 설계하면 된다.

회원 도메인 협력 관계

회원 클래스 다이어그램 (정적다이어그램) 클래스 다이어그램은 실제 서버를 실행하지 않고 클래스들만 분석해서 볼 수 있는 그림 그런데 구현체들은 서버가 뜰 때 new 할 때 실행 될 때 동적으로 결정됨

회원 객체 다이어그램 (동적 다이어그램) 클래스 다이어그램은 서버가 뜰 때 new 할 때 실행 될 때 동적으로 결정되므로 한눈에 보기 어렵다 . 그래서 실제 new 한 인스턴스 끼리의 참조를 볼 수 있는 객체 다이어그램을 사용한다.

주문 도메인 협력 관계

주문 도메인 클래스 다이어그램

주문 도메인 객체 다이어그램1

주문 도메인 객체 다이어그램2

하지만 위의 그림과 같이 다이어그램을 작성하면 클라이언트인 OrderServiceImpl, MemberServiceImpl이 추상(인터페이스)에만 의존하지 않고 구체에도 의존하고 있다. 그래서 다음과 같이 AppConfig를 두어서 애플리케이션 전반을 책임지고 클라이언트가 추상에만 의존하도록 해야한다 -> 관심사의 분리 (AOP) 회원 객체 인스턴스 다이어그램 appconfig 에서 생성한 memoryMemberRepositoryd의 주솟값을 memberServiceImpl을 생성할 때 함께 주입해줌

** 그림 -사용, 구성의 분리 **

**할인 정책의 변경 **

core's People

Contributors

leejin0527 avatar zinnnyyy avatar

Stargazers

최효준(최철호) avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.