Skip to Content
실무로 통하는 클린 코드
book

실무로 통하는 클린 코드

by 막시밀리아노 콘티에리, 이태영
August 2024
Beginner to intermediate
488 pages
11h 1m
Korean
Hanbit Media, Inc.
Content preview from 실무로 통하는 클린 코드
206
실무로 통하는 클린 코드
대부분의 린터는 메서드 숫자를 세고 관련 클래스를 리팩터링할 수 있도록 경고합니다. 작고
재사용 가능한 객체로 분할하는 것은 좋은 습관입니다.
관련 레시피
7
.
2
절 ‘도우미와 유틸리티 이름 변경 및 분리하기’
11
.
6
절 ‘너무 많은 속성 나누기’
11
.
7
절 ‘
import
목록 줄이기’
17
.
4
절 ‘확산적 변경 나누기’
17
.
15
절 ‘데이터 덩어리 리팩터링하기’
함께 보기
리팩터링 구루의 ‘
Large
Class
’(
https://oreil.ly/r1jQO
)
11.6
너무 많은 속성 나누기
문제
많은 속성을 가진 객체를 정의하는 클래스가 있습니다.
해결
클래스를 응집력 있는 부분으로 나눕니다. 속성과 관련된 메서드를 찾은 다음, 이러한
메서드를 클러스터링하고 해당 클러스터와 관련된 객체로 분리합니다. 마지막에는 이러한 새
객체와 관련된 실제 객체를 찾아 기존 참조를 대체합니다.
설명
다음은 속성이 너무 많은
ExcelSheet
클래스입니다.
class ExcelSheet {
String filename;
String fileEncoding;
String documentOwner;
String documentReadPassword;
String documentWritePassword;
DateTime creationTime; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

데이터 과학을 위한 통계(2판)

데이터 과학을 위한 통계(2판)

이준용, 피터 브루스, 앤드루 브루스, 피터 게데크
클라우드 네이티브 애플리케이션 디자인 패턴

클라우드 네이티브 애플리케이션 디자인 패턴

카순 인드라시리, 스리스칸다라자 수호티얀
데이터 엔지니어를 위한 97가지 조언

데이터 엔지니어를 위한 97가지 조언

Tobias Macey, 임혜연(Lim Hye Yeon)

Publisher Resources

ISBN: 9791169212779