-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[스캇] 1, 2단계 쇼핑 장바구니 제출합니다. #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1, 2단계 미션 구현 고생하셨습니다 👏👏
MVP 패턴은 잘 구현해주셨지만 이번 미션에서는 테스트 코드가 많이 사라진게 아쉽습니다.
코멘트를 남겨두었으니 반영 후 다시 요청해주세요!
app/src/main/java/woowacourse/shopping/presentation/productlist/GridLayoutSizeManager.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/woowacourse/shopping/presentation/cart/CartPresenter.kt
Show resolved
Hide resolved
private var page = Counter(1) | ||
private val products: Products = Products() | ||
override fun initCart() { | ||
setProducts() | ||
view.setPage(page.value) | ||
val cartProducts = products.getProductsInRange((page.value - 1) * 5, 5) | ||
view.initCartProductModels(cartProducts.toPresentation()) | ||
checkRightPageAble() | ||
checkLeftPageAble() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
페이징 처리와 관련된 코드를 별도 클래스나 함수로 분리해볼까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
managePaging 이라는 함수에 페이징 관련 함수들을 넣었습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여전히 페이징 처리에 관한 코드들이 Presenter의 이곳 저곳에 흩어져 있습니다.
page가 쓰이는 곳을 검색하고 해당 코드들을 최대한 하나의 객체로 모아보세요.
app/src/main/java/woowacourse/shopping/presentation/cart/viewholder/CartItemViewHolder.kt
Outdated
Show resolved
Hide resolved
...src/main/java/woowacourse/shopping/presentation/productlist/product/ProductItemViewHolder.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/woowacourse/shopping/presentation/productlist/ProductListActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/woowacourse/shopping/presentation/productlist/product/ProductListAdapter.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
피드백 반영 고생하셨습니다. 👏
페이징 처리와 Presenter 테스트에 대해서 추가적으로 코멘트를 남겨두었습니다.
확인 후 다시 요청해주세요!
private var page = Counter(1) | ||
private val products: Products = Products() | ||
override fun initCart() { | ||
setProducts() | ||
view.setPage(page.value) | ||
val cartProducts = products.getProductsInRange((page.value - 1) * 5, 5) | ||
view.initCartProductModels(cartProducts.toPresentation()) | ||
checkRightPageAble() | ||
checkLeftPageAble() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여전히 페이징 처리에 관한 코드들이 Presenter의 이곳 저곳에 흩어져 있습니다.
page가 쓰이는 곳을 검색하고 해당 코드들을 최대한 하나의 객체로 모아보세요.
every { view.initCartItems(any()) } just runs | ||
every { view.setCartItems(any()) } just runs | ||
every { view.setPage(any()) } just runs | ||
every { view.setLeftPageState(any()) } just runs | ||
every { view.setRightPageState(any()) } just runs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relaxed mock에 대해서 알아보고 적용해본 뒤 불필요한 stubbing 코드들을 제거해보세요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
피드백 잘 반영해주셨네요 👍
한 가지 피드백을 남겨두었는데 다음 단계에서 같이 반영해보세요!
private val cartRepository: CartRepository, | ||
private val productRepository: ProductRepository, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 Paging 객체를 페이지가 있는 다른 화면에서도 쓸 수 있도록 추상화시켜보세요.
offset 방식이므로 OffsetPaging과 같은 이름으로 변경해보고 해당 기능만 남겨보면 어떨까요?
안녕하세요 리뷰어님! 스캇입니다!
첫 미션 이후로 오랜만에 뵙네요! 반갑습니다!
항상 좋은 리뷰 남겨주셔서 감사드립니다!!
이번 미션 잘 부탁드립니다!!