본문 바로가기
[Kotlin Tutorial] Kotlin 소개 - Kotlin : what and why [Kotlin Tutorial] Kotlin 소개 - Kotlin : what and why 참조 : Kotlin in Action -Kotlin 은 Java platform 을 targeting 한 새로운 프로그래밍 언어.Java 코드와 함께 쓰일 수 있다.Android 개발 뿐만 아니라 Server-side 개발에도 쓰일 수 있다. -Java 의 iib, framework 와 함께 쓰일 수 있고, Java 와 비교해 Performance 도 거의 동일하다. 1.1. A Taste of Kotlin -http://try.kotl.in 을 통해 코드 실습을 할 수 있다. -data class Person(val name: String, val age: Int? = null) fun main(args: A.. 2017. 7. 12.
[android] Custom view state 관리에 대한 내용. [android] Custom view state 관리에 대한 내용. -예를 들어 checked state 가 없는 view 에 checked state 를 추가하려면 다음과 같이 할 수 있다. - 우선 어떤 view 에 Checkable 이라는 interface 를 implement 시키고.. ( android 에 있는 interface ) public interface Checkable{ void setChecked(boolean checked); boolean isChecked(); void toggle();} - setChecked 함수에서 refreshDrawableState() 를 호출하면, int[] onCreateDrawableState(int extraSpace) 가 불린다. privat.. 2017. 5. 23.
[Java] How to implements Iterator. Java, How to implements Iterator. Aggregate 인터페이스 public interface Aggregate{public abstract Iterator iterator();} Iterator 를 제공하려는 container class 는 Aggregate 를 implements 해야 함.Aggregate Interface 를 implement 한 class 를 ConcreteAggregate class 라 부른다. Iterator 인터페이스 public interface Iterator{public abstract boolean hasNext();public abstract Object enxt();} Iterator 를 구현한 class 를 ConcreteIterator .. 2014. 1. 10.
[Java] Serializable & Externalizable 자바, Serializable & Externalizable Serializable 은 implement 를 해주면 자동으로 object 안에 있는 모든 변수들이 serializable 하게 된다. 물론 primitive type 에 대해서이다. Serializable 을 구현한 클래스에서 다른 object 를 담고 있다면 해당 object 도 serializable 해야 정상적으로 serializable 하게 된다. 만약 변수 중에 serializable 하게 만들고 싶지 않은 것들이 있다면 transient 이라는 키워드를 앞에 붙여주어야 한다. Externalizable 인터페이스는 Serializable 인터페이스의 자식 클래스이다.Serializable 은 object 의 모든 변수들을 자동으로.. 2013. 9. 9.
[android] BItmapLruCache 구현하기. ( for Volley ) 안드로이드, BitmapLruCache 구현하기. for Volley Volley Tutorial 을 보면 NetworkImageView 를 사용할 떄 ImageCache를 대입하는 부분이 있는데, 아이러니하게도 Volley library 에서는 기본적인 ImageCache 를 제공하지 않는다. 그렇다면 우리가 구현해주어야 한다는 것인데, "그나마 친절하게도" Volley Library 에서 ImageCache 라는 interface 는 제공해준다. 이 녀석을 구현하기만 하면 된다. import android.graphics.Bitmap;import android.support.v4.util.LruCache; import com.android.volley.toolbox.ImageLoader; public.. 2013. 8. 6.
[Spring] Spring Framework 의 개요 #2 Spring Framework의 개요 #2 변화를 예상 -> design pattern 적용 가능. 관심사의 분리( Separation of Concerns ) 관심이 같은 것끼리는 하나의 객체 안으로, 관심이 다른 것은 가능한 따로 떨어져 영향을 주지 않도록 분리. 템플릿 메소드 패턴( Template Method Pattern ) 슈퍼클래스에 기본적인 조작의 흐름을 만들고, 그 기능의 일부를 추상 메소드나 오버라이딩 가능한 protected 메소드 등으로 만든 뒤, 서브클라스에서 이런 메소드를 필요에 맞게 구현해서 사용하도록 하는 방법. 이 때 선택적 override 가능한 method 를 hook method 라고 한다. 팩토리 메소드 패턴( Factory Method Pattern ) 서브클래스에.. 2013. 6. 25.
반응형