Skip to Content
프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)
book

프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)

by 오현석, 딘 왐플러, 알렉스 페인
July 2016
Beginner to intermediate
776 pages
17h 26m
Korean
Hanbit Media, Inc.
Content preview from 프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)
401
자바에서 클래스는 원하는 개수만큼 인터페이스를 구현할 수 있다. 이런 모델은 클래스가 여러
추상을 구현해야 하는 경우에 매우 유용하다. 불행히도 이 접근 방법에는 한 가지 단점이 있다.
많은 인터페이스에서 그 기능의 대부분은 해당 인터페이스를 사용하는 모든 클래스에서 공통적
인 준비 코드가 없이는 구현할 수 없다.
인터페이스에는 구현 클래스의 나머지 부분과는 관계가 없는(직교하는) 멤버가 들어 있는 경
우가 자주 있다. 믹스인
mixin
1
은 그런 식으로 모아둔 재사용 가능한 상태와 동작을 의미하는 용
어다. 이상적인 경우, 이런 동작을 그 동작을 사용하는 구체적인 타입과 독립적으로 유지할 수
있다.
버전
8
이전의 자바에서는 그런 식으로 재사용 가능한 코드를 정의하고 사용할 수 있는 방법이
없었다. 대신 자바 프로그래머들은 주어진 인터페이스에 대한 구현을 재사용하기 위해 그때그때
만들어낸 관례를 사용해야 했다. 최악의 경우, 개발자가 동일한 코드를 복사해서 그 기능을 필요
로 하는 모든 클래스에 붙여 넣기도 한다. 그보다 너 낫지만 완전하지 않은 해법은, 동작에 대한
별도의 클래스를 구현해서 원래 클래스 안에 그런 동작 지원 클래스의 인스턴스를 유지하면서,
메서드 호출을 지원 클래스의 인스턴스에 위임하는 방식이다. 이런 접근 방식은 잘 작동하기는
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

스파크를 이용한 자연어 처리 : 대규모 텍스트를 다루는 가장 효율적인 딥러닝을 만나다

스파크를 이용한 자연어 처리 : 대규모 텍스트를 다루는 가장 효율적인 딥러닝을 만나다

이창현, 앨릭스 토머스

Publisher Resources

ISBN: 9788968482755