<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>5_zero_water.log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Sun, 17 Sep 2023 08:40:07 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>5_zero_water.log</title>
            <url>https://images.velog.io/images/5_zero_water/profile/2614b761-3792-4cfe-8c26-75a61dbbc3cc/social.jpeg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. 5_zero_water.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/5_zero_water" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[함수를 다루는 방법]]></title>
            <link>https://velog.io/@5_zero_water/%ED%95%A8%EC%88%98%EB%A5%BC-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B0%A9%EB%B2%95</link>
            <guid>https://velog.io/@5_zero_water/%ED%95%A8%EC%88%98%EB%A5%BC-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B0%A9%EB%B2%95</guid>
            <pubDate>Sun, 17 Sep 2023 08:40:07 GMT</pubDate>
            <description><![CDATA[<pre><code class="language-kotlin">/*
    lec 08. 코틀린에서 함수를 다루는법
    1. 함수 선언 문법
    2. default parameter
    3. named argument(parameter)
    4. 같은 타입의 여러 파라미터 받기 (가변인자)
 */

fun main() {
// repeat(&quot;hello world&quot;,2);
// repeat(&quot;hello world&quot;, useNewLine = false);
//printNameAndGender(&quot;MALE&quot;,&quot;오영수&quot;)
//printNameAndGender(name = &quot;오영수&quot;, gender = &quot;MALE&quot;)
    // Kotlin에서 Java 함수를 사용할 때는 named argument를 사용할수없다.

    var array = arrayOf(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;)

    printAll(*array)
}


//public 생략 가능
// {} block 대신 = 사용 가능
//
public fun max(a: Int, b: Int): Int =
    if (a &gt; b) {
        a
    } else {
        b
    }

//parmeter Int 와 Int 여서 + &quot;=&quot;을 사용해서 반환타입 Int 생략가능
fun max1(a: Int, b: Int) = if (a &gt; b) {
    a
} else {
    b
}

fun max2(a: Int, b: Int) = if (a &gt; b) a else b


//default parameter
fun repeat(
    str: String,
    num: Int =3,
    useNewLine: Boolean = true
){
    for(i in 1..num){
        if(useNewLine){
            println(str)
        }else{
            println(str)
        }
    }
}

fun printNameAndGender(name:String, gender:String){
    println(name)
    println(gender)
}

fun printAll(vararg strings: String){
    for (str in strings){
        println(str)
    }
}
</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[예외를 다루는 방법]]></title>
            <link>https://velog.io/@5_zero_water/%EC%98%88%EC%99%B8%EB%A5%BC-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B0%A9%EB%B2%95</link>
            <guid>https://velog.io/@5_zero_water/%EC%98%88%EC%99%B8%EB%A5%BC-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B0%A9%EB%B2%95</guid>
            <pubDate>Sun, 17 Sep 2023 08:39:08 GMT</pubDate>
            <description><![CDATA[<pre><code class="language-kotlin">fun parsIntOrThrow(str: String):Int{
    try {
        return str.toInt();
    }catch (e: NumberFormatException){
        throw IllegalArgumentException(&quot;주어진 $str 은 숫자가 아닙니다.&quot;)
    }
}

fun parseIntOrThrowV2(str: String): Int? {
    return try {
        str.toInt()
    } catch (e: NumberFormatException) {
        null
    }
}</code></pre>
<p>checked exception - 반드시 예외 처리를 해야됨  </p>
<p>unchecked exception - 예외 처리를 하지 않아도 됨</p>
<p>코틀린은 unchecked exception 이다. - throws 를 볼일이 없다.</p>
<p>try with resource 구문이 없다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[반복문을 다루는 방법]]></title>
            <link>https://velog.io/@5_zero_water/%EB%B0%98%EB%B3%B5%EB%AC%B8%EC%9D%84-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B0%A9%EB%B2%95</link>
            <guid>https://velog.io/@5_zero_water/%EB%B0%98%EB%B3%B5%EB%AC%B8%EC%9D%84-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B0%A9%EB%B2%95</guid>
            <pubDate>Sun, 17 Sep 2023 08:38:12 GMT</pubDate>
            <description><![CDATA[<pre><code class="language-kotlin">val numbers = listOf(1L,2L,3L)
    for (number in numbers) {
        println(number);
    }

    //ㅑ 1부터 3 증가 
    for (i in 1..3) {
        println(i)
    }

    //i 3분터 1로 내려간다.
    for(i in 3 downTo 1){
        println(i);
    }

    //i 2씩 올라간다.
    for(i in 1..5 step 2){
        println(i)
    }

    //1..3 .. 은 InRange
    // IntProgression 등차수열 
    //downTo , step 은 함수 다</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[제어문을 다루는 방법]]></title>
            <link>https://velog.io/@5_zero_water/%EC%A0%9C%EC%96%B4%EB%AC%B8%EC%9D%84-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B0%A9%EB%B2%95</link>
            <guid>https://velog.io/@5_zero_water/%EC%A0%9C%EC%96%B4%EB%AC%B8%EC%9D%84-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B0%A9%EB%B2%95</guid>
            <pubDate>Sun, 17 Sep 2023 08:35:58 GMT</pubDate>
            <description><![CDATA[<h3 id="제어문을-다루는-방법">제어문을 다루는 방법</h3>
<p>If 문 자바랑 동일</p>
<pre><code class="language-kotlin">fun validateScoreIsNotNegative(score: Int) {
    if (score &lt; 0) {
        throw IllegalArgumentException(&quot;${score}는 0 보다 작을수 없습니다.&quot;)
    }
}

fun getPassOrFail(score: Int): String {
    if (score &gt;= 50) {
        return &quot;P&quot;
    } else {
        return &quot;F&quot;
    }
}</code></pre>
<p>하지만 Java 에서는 if-else는 Statement 이지만, Kotlin에서는 Expression 이다.</p>
<p><img src="https://velog.velcdn.com/images/5_zero_water/post/c90023e8-7946-4160-ac59-67bb848a0773/image.png" alt=""></p>
<pre><code class="language-kotlin">int score = 30 + 40; //70이라는 하나의 결가과 나온다. (Expression 이면서 statment)

fun getKotlinPassOrFail(score: Int): String {
    return if (score &gt;= 50) {
        &quot;P&quot;
    } else {
        &quot;F&quot;
    }
}

즉 kotlin 에서는 if-else를 expression 으로 사용할 수 있기 때문에 3항 연산자가 없다.

fun getKotlinGetGrade(score: Int): String {
    return if (score &gt;= 90) {
        &quot;A&quot;
    } else if (score &gt;= 80) {
        &quot;B&quot;
    } else {
        &quot;C&quot;
    }
}</code></pre>
<h3 id="switch">switch</h3>
<pre><code class="language-kotlin">fun kotlinValidateScore(score: Int) {
    if (score !in 0..100) {
        throw IllegalArgumentException(&quot;score 범위는 0부터 100이 아닙니다.&quot;)
    }
}

fun kotlinValidateScore(score: Int) {
    if (score in 0..100) {
        throw IllegalArgumentException(&quot;score 범위는 0부터 100입니다.&quot;)
    }
}</code></pre>
<pre><code class="language-kotlin">//코틀린은 switch 가 사라짐 대신에 when을 사용

 fun getGradeWithSwitch(score: Int): String{
    return when (score/10){
        9 -&gt; &quot;A&quot;;
        8 -&gt; &quot;B&quot;;
        7 -&gt; &quot;C&quot;;
        6 -&gt; &quot;D&quot;;
        else -&gt; &quot;E&quot;
    }
}
//범위
fun getGradeWithSwitch(score: Int): String{
    return when (score/10){
        in 80..90 -&gt; &quot;A&quot;;
        in 70..80 -&gt; &quot;B&quot;;
        in 60..70 -&gt; &quot;C&quot;;
        in 50..60 -&gt; &quot;D&quot;;
        else -&gt; &quot;E&quot;
    }
}</code></pre>
<pre><code class="language-kotlin">//객체가 스트링이라면...  
fun startWithA(obj: Any):Boolean{
    return when(obj){
        is String -&gt; obj.startsWith(&quot;A&quot;)
        else -&gt; false
    }
}

fun judgeNumber(number: Int) {
    when (number) {
        1, 0, -1 -&gt; println(&quot;어디서 많이 본 숫자 입니다.&quot;)
        else -&gt; println(&quot;1,0,-1 이 아닙니다.&quot;)
    }
}

fun judgeNumber2(number: Int) {
    when {
        number == 0 -&gt; println(&quot;주어진 숫자는 0입니다.&quot;)
        number % 2 == 0 -&gt; println(&quot;주어진 숫자는 짝수입니다.&quot;)
        else -&gt; println(&quot;주어진 숫자는 홀수입니다.&quot;)
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[반복문, 예외를 다루는 방법]]></title>
            <link>https://velog.io/@5_zero_water/%EB%B0%98%EB%B3%B5%EB%AC%B8-%EC%98%88%EC%99%B8-%EB%A5%BC-%EB%8B%A4%EB%A3%A8%EB%8A%94%EB%B2%95</link>
            <guid>https://velog.io/@5_zero_water/%EB%B0%98%EB%B3%B5%EB%AC%B8-%EC%98%88%EC%99%B8-%EB%A5%BC-%EB%8B%A4%EB%A3%A8%EB%8A%94%EB%B2%95</guid>
            <pubDate>Thu, 24 Aug 2023 23:59:42 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/5_zero_water/post/e006d177-1712-401a-af64-b0730d135f81/image.jpeg" alt=""></p>
<h2 id="반복문을-다루는법">반복문을 다루는법</h2>
<pre><code>val numbers = listOf(1L,2L,3L)
    for (number in numbers) {
        println(number);
    }

    //ㅑ 1부터 3 증가 
    for (i in 1..3) {
        println(i)
    }

    //i 3분터 1로 내려간다.
    for(i in 3 downTo 1){
        println(i);
    }

    //i 2씩 올라간다.
    for(i in 1..5 step 2){
        println(i)
    }

    //1..3 .. 은 InRange
    // IntProgression 등차수열 
    //downTo , step 은 함수 다```
</code></pre><h2 id="예외를-다루는-법">예외를 다루는 법</h2>
<pre><code>fun parsIntOrThrow(str: String):Int{
    try {
        return str.toInt();
    }catch (e: NumberFormatException){
        throw IllegalArgumentException(&quot;주어진 $str 은 숫자가 아닙니다.&quot;)
    }
}

fun parseIntOrThrowV2(str: String): Int? {
    return try {
        str.toInt()
    } catch (e: NumberFormatException) {
        null
    }
}</code></pre><p>checked exception - 반드시 예외 처리를 해야됨  </p>
<p>unchecked exception - 예외 처리를 하지 않아도 됨</p>
<p>코틀린은 unchecked exception 이다. - throws 를 볼일이 없다.</p>
<p>try with resource 구문이 없다.!</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[연산자를 다루는 방법]]></title>
            <link>https://velog.io/@5_zero_water/ovxo35wt</link>
            <guid>https://velog.io/@5_zero_water/ovxo35wt</guid>
            <pubDate>Sun, 13 Aug 2023 14:26:46 GMT</pubDate>
            <description><![CDATA[<h3 id="java">Java</h3>
<p>‘==’  : 주소 + 값 같은가</p>
<p>‘.equals() : 값 같은가</p>
<h3 id="kotlin">Kotlin</h3>
<p>‘===’ : 주소 + 값 같은가</p>
<p>‘==’ : 값 같은가</p>
<pre><code class="language-kotlin">var money1 = Money(1000L);
var money2 = Money(3000L);

println(money1 + money2);

//Money(amount=4000) 자동으로 toString이 들어가있다.</code></pre>
<h1 id="제어문을-다루는법">제어문을 다루는법</h1>
<p>If 문 자바랑 동일</p>
<pre><code class="language-kotlin">fun validateScoreIsNotNegative(score: Int) {
    if (score &lt; 0) {
        throw IllegalArgumentException(&quot;${score}는 0 보다 작을수 없습니다.&quot;)
    }
}

fun getPassOrFail(score: Int): String {
    if (score &gt;= 50) {
        return &quot;P&quot;
    } else {
        return &quot;F&quot;
    }
}</code></pre>
<p>하지만 Java 에서는 if-else는 Statement 이지만, Kotlin에서는 Expression 이다.</p>
<p><img src="https://velog.velcdn.com/images/5_zero_water/post/0dad6135-8ca4-4981-bdf1-d357dd97b8f8/image.png" alt=""></p>
<pre><code class="language-kotlin">int score = 30 + 40; //70이라는 하나의 결가과 나온다. (Expression 이면서 statment)

fun getKotlinPassOrFail(score: Int): String {
    return if (score &gt;= 50) {
        &quot;P&quot;
    } else {
        &quot;F&quot;
    }
}

즉 kotlin 에서는 if-else를 expression 으로 사용할 수 있기 때문에 3항 연산자가 없다.

fun getKotlinGetGrade(score: Int): String {
    return if (score &gt;= 90) {
        &quot;A&quot;
    } else if (score &gt;= 80) {
        &quot;B&quot;
    } else {
        &quot;C&quot;
    }
}</code></pre>
<p>switch</p>
<pre><code class="language-kotlin">fun kotlinValidateScore(score: Int) {
    if (score !in 0..100) {
        throw IllegalArgumentException(&quot;score 범위는 0부터 100이 아닙니다.&quot;)
    }
}

fun kotlinValidateScore(score: Int) {
    if (score in 0..100) {
        throw IllegalArgumentException(&quot;score 범위는 0부터 100입니다.&quot;)
    }
}

//코틀린은 switch 가 사라짐 대신에 when을 사용

 fun getGradeWithSwitch(score: Int): String{
    return when (score/10){
        9 -&gt; &quot;A&quot;;
        8 -&gt; &quot;B&quot;;
        7 -&gt; &quot;C&quot;;
        6 -&gt; &quot;D&quot;;
        else -&gt; &quot;E&quot;
    }
}
//범위
fun getGradeWithSwitch(score: Int): String{
    return when (score/10){
        in 80..90 -&gt; &quot;A&quot;;
        in 70..80 -&gt; &quot;B&quot;;
        in 60..70 -&gt; &quot;C&quot;;
        in 50..60 -&gt; &quot;D&quot;;
        else -&gt; &quot;E&quot;
    }
}

//객체가 스트링이라면...  
fun startWithA(obj: Any):Boolean{
    return when(obj){
        is String -&gt; obj.startsWith(&quot;A&quot;)
        else -&gt; false
    }
}

fun judgeNumber(number: Int) {
    when (number) {
        1, 0, -1 -&gt; println(&quot;어디서 많이 본 숫자 입니다.&quot;)
        else -&gt; println(&quot;1,0,-1 이 아닙니다.&quot;)
    }
}

fun judgeNumber2(number: Int) {
    when {
        number == 0 -&gt; println(&quot;주어진 숫자는 0입니다.&quot;)
        number % 2 == 0 -&gt; println(&quot;주어진 숫자는 짝수입니다.&quot;)
        else -&gt; println(&quot;주어진 숫자는 홀수입니다.&quot;)
    }
}
</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[Type을 다루는 방법]]></title>
            <link>https://velog.io/@5_zero_water/Type%EC%9D%84-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B2%95</link>
            <guid>https://velog.io/@5_zero_water/Type%EC%9D%84-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EB%B2%95</guid>
            <pubDate>Sun, 30 Jul 2023 13:20:58 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/5_zero_water/post/5d9b98e6-c4bf-43cc-95de-16e43e4bfa21/image.jpeg" alt=""></p>
<pre><code class="language-kotlin">//Java 에선
int number1 = 4;
long number2 = number1;
System.out.println(number1 + number2);

//int 타입의 값이 long 타입으로 암시적으로 변경되었고 Java 에서는 더 큰 타입으로 암시적 변경이 가능</code></pre>
<p>하지만 코틀린에서는 불가능</p>
<pre><code class="language-kotlin">val number1 = 4
val number2 = number1 // 컴파일 에러

//-&gt; solution
val number = 3 //--int
val number2: Long = number.toLong() //으로 해결</code></pre>
<p>to 변환 타입을 사용해야된다.</p>
<h3 id="객체-타입-예제">객체 타입 예제</h3>
<pre><code class="language-kotlin">fun printAgeIfPerson(obj: Any){
    if(obj is person){
    val person obj as person
    println(person.age)
    }
}

fun printAgeIfPerson(obj: Any){
    if(obj !is person){
    val person obj as person
    println(person.age)
    }
}</code></pre>
<p>java → instanceof</p>
<p>kotlin → is</p>
<p>→ as 는 타입으로 변경 </p>
<p>Any (Java의 Object) : 최상의 타입</p>
<p>Unit</p>
<p>Nothing</p>
<h3 id="string-interpolation-string-indexing">String interpolation/ String Indexing</h3>
]]></description>
        </item>
        <item>
            <title><![CDATA[Kotlin- 기본문법]]></title>
            <link>https://velog.io/@5_zero_water/Kotlin-%EA%B8%B0%EB%B3%B8%EB%AC%B8%EB%B2%95</link>
            <guid>https://velog.io/@5_zero_water/Kotlin-%EA%B8%B0%EB%B3%B8%EB%AC%B8%EB%B2%95</guid>
            <pubDate>Sun, 16 Jul 2023 10:59:04 GMT</pubDate>
            <description><![CDATA[<h1 id="기본문법">기본문법</h1>
<h2 id="var-과-val-의-차이점">var 과 val 의 차이점</h2>
<ul>
<li>var(variable) 변할수있는 값</li>
<li>val(value) 변할수 없는 값</li>
</ul>
<pre><code class="language-kotlin">var number: Long = 1L // Long number = 1L;
val number: Long = 1L // final Long number = 1L;</code></pre>
<p>Tip !</p>
<blockquote>
<p>모든 변수는 일단 val 로 만들고 꼭 필요한 경운 var로 변경한다.</p>
</blockquote>
<p>코틀린에서는 알아서 long(primitive type) 또는 Long (reference type)를 자동으로 알아서 판단하에 적용해준다. 이 말은 즉, 프로그래머가 boxing unboxing 고려할필요없다.</p>
<p>reference type [예) Long, Integer, .. DOUBLE ] 은 null 이 허용된다. </p>
<p>? 를 넣어준다.</p>
<pre><code class="language-kotlin">val number: Long? = 1L</code></pre>
<p>객체 인스턴스 할 때는 new 를 쓰지 않는다.</p>
<h2 id="function">function</h2>
<pre><code class="language-kotlin">fun startsWithA(str: String): Boolean{
    return str.startsWith(&quot;A&quot;);
}</code></pre>
<h3 id="safe-call">safe call</h3>
<p>null 이 아니면 그냥 실행하고, 널이면 전체가 널</p>
<pre><code class="language-kotlin">val str:String? = &quot;ABC&quot;
// println(str.length)-- error
println(str?.length) //-- str 이 null이면 전체가 null</code></pre>
<h3 id="elvis-연산자">Elvis 연산자</h3>
<p>앞의 연산 결과가 null 이면 뒤의 값을 사용</p>
<pre><code class="language-kotlin">val str: String? = null
str?.length ?: 0; //-- 0 </code></pre>
<p>예제</p>
<pre><code class="language-kotlin">fun calculate(number: Long?): Long {
    number ?: return 0;
}

fun notNull(str:String?): Boolean{
return str!!.startsWith(&quot;A&quot;) //-- 절대 str 이 null이 아닐때 쓰임 만약 널이 들어오면 NPE</code></pre>
<h3 id="플랫폼-타입">플랫폼 타입</h3>
<p>코틀린에서 Java 코드를 가져다 사용할 때 어떻게 처리될까?</p>
<pre><code class="language-kotlin">val person = Person(&quot;공부하는 개발자&quot;)

fun startWithA(str: String): Boolean{
    return str.startsWhith(&quot;A&quot;)
}

public class Person{
    private final String name;

    @NotNull // @Nullable 일때는 에러 
    public String getName(){
    return name;
        }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[Objects (코드로 이해하는 객체지향 설계) Chapter 2]]></title>
            <link>https://velog.io/@5_zero_water/Objects-%EC%BD%94%EB%93%9C%EB%A1%9C-%EC%9D%B4%ED%95%B4%ED%95%98%EB%8A%94-%EA%B0%9D%EC%B2%B4%EC%A7%80%ED%96%A5-%EC%84%A4%EA%B3%84-Chapter-2</link>
            <guid>https://velog.io/@5_zero_water/Objects-%EC%BD%94%EB%93%9C%EB%A1%9C-%EC%9D%B4%ED%95%B4%ED%95%98%EB%8A%94-%EA%B0%9D%EC%B2%B4%EC%A7%80%ED%96%A5-%EC%84%A4%EA%B3%84-Chapter-2</guid>
            <pubDate>Sun, 02 Jul 2023 07:08:19 GMT</pubDate>
            <description><![CDATA[<h1 id="chapter-2-객체지향-프로그래밍">Chapter 2. 객체지향 프로그래밍</h1>
<p>예제) 영화 예매</p>
<ul>
<li>할인 조건<ul>
<li>예) 10번째로 상영 시작 시간 예매한 고객에게 할인</li>
<li>예) 조조할인 아침10~오후1시까지 예매한 고객에게 할인</li>
</ul>
</li>
<li>할인 정책<ul>
<li>예) 금액 할인 정책 (amount)</li>
<li>예) 비율 할인 정책 (percentage)</li>
</ul>
</li>
</ul>
<p>대부분의 사람은 클래스를 결정한 후에 클래스에 어떤 속성과 메서드가 필요한지 고민한다.</p>
<p>하지만, 객체 지향은 클래스가 아닌 객체에 초점을 맞출 때에만 얻을수있다. </p>
<p>첫째, 어떤 클래스가 필요한지를 고민하기 전에 어떤 객체들이 필요한지 고민하라.</p>
<p>둘째, 객체를 독립적인 존재가 아니라 기능을 구현하기 위해 협력하는 공동체의 일원으로 봐야 한다.</p>
<blockquote>
<p>도메인 이란, 문제를 해결하기위해 사용자가 프로그램을 사용하는 분야를 가리킨다.</p>
</blockquote>
<blockquote>
<p>일반적으로 클래스의 이름은 대응되는 도메인 개념의 이름과 동일하거나 적어도 유사하게 지어야한다.</p>
</blockquote>
<p>클래스 생성시</p>
<p>외부에서는 객체의 속성에 직접 접근할수 없고(private) public 메소드를 통해서만 내부 상태를 변경할 수 있게 해야 한다.</p>
<p>이유) 경계의 명확성이 객체의 자율성을 보장하기 때문이다. + 프로그래머에게 구현의 자유를 제공하기 때문</p>
<p>캡슐화 - 데이터와 내부 기능을 함께 묶는것</p>
<p>캡슐화와 접근제어</p>
<ul>
<li>퍼블릭 인터페이스 (public interface) - 외부에서 접근 가능</li>
<li>구현 (implementation) - 오직 내부에서만 접근 가능</li>
</ul>
<h3 id="프로그래머의-자유">프로그래머의 자유</h3>
<ul>
<li>클래스 작성자<ul>
<li>새로운 데이터 타입을 프로그램에 추가</li>
</ul>
</li>
<li>클라이언트 프로그래머<ul>
<li>필요한 클래스들을 엮어서 애플리케이션을 빠르고 안정적으로 구축</li>
</ul>
</li>
</ul>
<p>객체의 변경을 관리할 수있는 기법 = 접근제어</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[Objects (코드로 이해하는 객체지향 설계) Chapter 1]]></title>
            <link>https://velog.io/@5_zero_water/Objects-%EC%BD%94%EB%93%9C%EB%A1%9C-%EC%9D%B4%ED%95%B4%ED%95%98%EB%8A%94-%EA%B0%9D%EC%B2%B4%EC%A7%80%ED%96%A5-%EC%84%A4%EA%B3%84</link>
            <guid>https://velog.io/@5_zero_water/Objects-%EC%BD%94%EB%93%9C%EB%A1%9C-%EC%9D%B4%ED%95%B4%ED%95%98%EB%8A%94-%EA%B0%9D%EC%B2%B4%EC%A7%80%ED%96%A5-%EC%84%A4%EA%B3%84</guid>
            <pubDate>Sun, 18 Jun 2023 08:25:24 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/5_zero_water/post/fdd6ea01-9d83-4e65-ab72-6dcf74adb1d7/image.png" alt=""></p>
<p>개발자라면 객체지향은 정말 중요하다.</p>
<p>나도 개발을 하고있지만 객체지향을 정말 잘 알고있다? 흠....
백엔드 개발을 하면서 객체지향을 좀 뚜렷하게 알고싶어서 이 책을 샀다. 산지 벌써 한 2년된거 같다.
나는 정말 책을 극혐한다..하지만 이제 책좀 읽어보고 블로그도 동시해 해보려고 글을 쓴다.</p>
<p>조영호 지음</p>
<ul>
<li><p>Chapter 1. <strong>객체, 설계</strong></p>
<blockquote>
<p><strong>이론 보다는 실무가 먼저다</strong>.</p>
</blockquote>
<h3 id="모듈이란">모듈이란</h3>
<p>  크기와 상관없이 클래스, 패키지, 라이브러리와 같이 프로그램을 구성하는 임의의 요소를 의미한다.</p>
<h3 id="모듈의-목적">모듈의 목적</h3>
<ul>
<li><p>제대로 동작</p>
</li>
<li><p>변경을 위해 존재</p>
</li>
<li><p>코드를 읽는 사람과 의사소통</p>
<blockquote>
<p>객체지향 설계는 서로 의존하면서 협력하는 객체들의 공동체를 구축하는 것이다.
따라서 우리의 목표는 애플리케이션의 기능을 구현하는데 필요한 최소한의 의존성만 유지하고 불필요한
의존성을 제거하는 것이다.</p>
</blockquote>
</li>
<li><p>의존성이 과한 경우를 가리켜 <strong>결합도(coupling)</strong>가 높다 라고 말한다.</p>
</li>
<li><p>개념적이나 물리적으로 객체 내부의 세부적인 사항을 감추는 것을 <strong>캡슐화(encapsulation)</strong>라고 한다.</p>
</li>
<li><p>밀접하게 연관된 작업만을 수행하고 연관성 없는 작업은 다른 객체에게 위임하는 객체를 가리켜 <strong>응집도(cohension)</strong>가 높다라고 말한다.</p>
<p>절차적 프로그래밍 - 프로세스와 데이터를 별도의 모듈에 위치시키는 방식 - 전형적인 의존성코드 (BAD)</p>
<p>나쁜이유 - 데이터의 의존해야 한다는 근복적인 문제점 때문에 변경에 취약</p>
<blockquote>
<p>객체가 어떤 데이터를 가지느냐보다는 객체에 어떤 책임을 할당할 것이냐에 초점을 맞춰야한다.</p>
</blockquote>
</li>
</ul>
</li>
</ul>
]]></description>
        </item>
    </channel>
</rss>