Objective-C Runtime Programming GuideSung-Kwan KimObjective-C Runtime Programming Guide 요약 자료입니다.
Objective-C 런타임을 사용하면 성능을 향상 시킬수 있는 기법을 사용할 수 있습니다.
동적 바인딩이 속도면에서는 접고 들어가는거라 런타임 기능을 이해하면 좀 더 향상된 앱을 개발할 수 있지 않을까 합니다~~
일부 다른 자료 참고했고, 이미지도 이모씨!!의 자료 사용했습니다~ㅋ
Objective-C Runtime Programming GuideSung-Kwan KimObjective-C Runtime Programming Guide 요약 자료입니다.
Objective-C 런타임을 사용하면 성능을 향상 시킬수 있는 기법을 사용할 수 있습니다.
동적 바인딩이 속도면에서는 접고 들어가는거라 런타임 기능을 이해하면 좀 더 향상된 앱을 개발할 수 있지 않을까 합니다~~
일부 다른 자료 참고했고, 이미지도 이모씨!!의 자료 사용했습니다~ㅋ
Painless Persistence with RealmChristian MelchiorIn a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline, has become increasingly important.
In this talk you will learn how thinking "offline first" not only makes your app architecture better but also result in cleaner code and happier users.
I will introduce Realm, a new database for easy persistence, and demonstrate how it enables truly reactive UI's by fitting seamlessly into the standard network stack of Retrofit and RxJava.
Finally we will take a look at the new Realm Mobile Platform, which provides real-time synchronization between devices, enabling features previously out of reach for many development teams.
Realm Java for AndroidGokhan ArikRealm is a replacement for SQLite and CoreData databases that allows for faster access and easier object mapping. It is a cross-platform mobile database that can provide up to 10x faster performance than raw SQLite. Realm uses a simple object-oriented model and allows for complex queries and relationships between objects. It also supports asynchronous access and notifications when data changes.
프알못의 Realm 사용기Mijeong JeonThe document discusses Realm, a mobile database that runs on iOS, Android, and JavaScript. It includes code snippets for defining Realm object models and performing operations like adding, deleting and updating objects. It also covers topics like Realm configuration, schema migrations, and accessing the underlying Realm file.
Painless Persistence in a Disconnected WorldChristian MelchiorIn a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline has become increasingly important.
In this talk we will go through different ways of saving data on the phone and introduce Realm as a replacement for SQLite and ORM's.
Through an example app it will be demonstrated that thinking "Offline first" not only affects your apps architecture for the better, but also results in happier users.
오픈 소스로 취업하기: 나는 어떻게 오픈 소스를 하다 렘 개발자가 되었나?Leonardo YongUk Kim나는 어떻게 오픈 소스를 하다 렘 개발자가 되었나?
Responsabilidad social editadoUniversidad Inca Garcilaso de la VegaEste documento trata sobre la responsabilidad social. Define la responsabilidad social como la obligación que tienen los miembros de una sociedad entre sí y para con la sociedad. Explica que la idea de la responsabilidad social se remonta a los filósofos griegos. En la actualidad, la responsabilidad social empresarial se refiere a las contribuciones voluntarias de las empresas para mejorar lo social, económico y ambiental. Algunas ventajas para las empresas incluyen mejor desempeño financiero, lealtad de clientes e imagen de marca. El document
2. 1
01 모델(Model)
지원되는 필드 타입들을 알아보자.
박스형
Boolean, Byte, Short, Integer, Long, Float, Double
-> 박스형과 RealmObject형 필드만 null 값을 넣을 수 있다.
서브클래스 및 리스트형
RealmObject의 서브클래스,
RealmList <? Extends RealmObject>
기본형
boolean, short, int, long, float, double, String, Date, byte[]
-> short, int, long 은 Realm 내에서 모두 long으로 대응된다.
1
2
3
Field
3. 2
01 모델(Model)
지원되는 필드 타입들을 알아보자.
Field
public class Dog extends RealmObject {
public String name;
public int age;
}
public RealmList<Dog> dogs;
4. 3
01 모델(Model)
Realm에서 사용되는 어노테이션(annotation)을 알아보자.
Annotation
1 @Required
1 null 값을 허용하지 않기 위해 사용한다.
2 박스형만 지정할 수 있다.
3 기본형과 RealmList는 암묵적으로 Required로 취급한다.
4 RealmObject는 항상 널이 가능
2 @Ignore
1 필드가 디스크에 저장되지 않도록 하는 기능을 한다.
2 사용자의 입력이 모델의 필드보다 많을 때,
쓰지 않을 데이터 필드를 다룰 때 사용한다.
5. 4
01 모델(Model)
Realm에서 사용되는 어노테이션(annotation)을 알아보자.
Annotation
3 @Index
1 해당 필드에 검색 색인을 추가한다.
2 질의 처리를 빠르게 할 수 있다.
3 삽입 처리가 느리고 데이터의 파일을 크게 만든다.
4 읽기에 최적화를 하는 경우에만 추가하는 것을 추천한다.
5 String, byte, short, int, long, Boolean, Date에 가능하다.
6. 5
01 모델(Model)
Realm에서 사용되는 어노테이션(annotation)을 알아보자.
Annotation
4 @PrimaryKey
1 문자열(String)이나 정수(byte, short, int, long)이나 이에
대응하는 박스형(Byte, Short, Integer, Long)에 가능하다.
2 여러 필드를 PrimaryKey로 설정하는 것은 불가능하다.
3 @PrimaryKey는 암묵적으로 @Index를 설정한다.
4 PrimaryKey를 사용하면 Querying의 속도는 향상될 수 있다.
5 객체를 생성하고 수정할 때 속도하락이 있을 수 있다.
6 String, byte, short, int, long, Boolean, Date 에 가능하다.
7. 6
01 모델(Model)
RealmObject의 사용법을 알아보자.
Object
1 일반적으로 사용하기
public class Dog extends RealmObject {
private String name;
public void setName(String name) { this.name = name; }
public String getName() { return name; }
}
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
Dog dog = realm.createObject(Dog.class);
dog.setName("Fido");
}
});
8. 7
01 모델(Model)
RealmObject의 사용법을 알아보자.
Object
2 POJO(Plain Old Java Object)처럼 사용하기
public class Dog extends RealmObject {
public String name;
}
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
Dog dog = realm.createObject(Dog.class);
dog.name = “Fido”;
}
});
요구사항에 맞춰서 getter와 setter에 로직을 추가할 수도 있다.
9. 8
POJO(Plain Old Java Object)란?
POJO : 프레임워크 등에 종속된 ‘무거운’ 객체를
만들게 된 것에(EJB에) 반발해서 사용하게 된 용어
POJO의 필수요소
1. light-weight(possibly) : 가볍게
2. flexible : 유연성
3. simple : 간단 명료
4. supported by separate optional components
such as hibernate or spring
POJO가 아닌 대표적인 객체
public HelloSevlet extends HttpServlet{...}
-> 자바 서블릿 코드를 작성할 때는 반드시 HttpServlet을 상속받아야한다.
-> 서플릿 프로그래밍을 한다는 이유로 상속이라는 핵심 기능을 빼앗긴 것
-> 개발자가 직접 상속을 할 수 있는 기회가 없어진 것이다.
-> HttpServlet 을 상속 받았기 때문에 이 코드를 이해해야 하며
어떤 기능이 있는지 어떻게 재사용해야 할지 판단하기도 어렵다.
10. 9
01 모델(Model)
현재 Realm에 어떠한 제약사항이 있는지 알아보자.
제약사항
RealmObject 외의 상속을 허용하지 않는다.
기본 생성자는 재정의 하지 말아야 한다.
-> 기본 생성자에서 Realm 인스턴스가 주어져 있다고 가정하는
메소드를 호출하기 때문이다.
-> RealmModel 인터페이스를 추가하는 방식으로 해결 할 수도 있다.
final, transient, volatile 지원하지 않는다.
Realm에 의해 관리되는 객체와 비관리 객체 간의
불일치를 막기 위해서입니다.
1
2
11. 10
02 관계(Relationships)
Realm에서 관계는 어떻게 정의하는지 알아보자.
1
다 대 일
다 대 일
public class Book extends RealmObject {
private String title;
// 다른 필드 및 getter, setter
}
public class Author extends RealmObject {
private Book book;
// 다른 필드 및 getter, setter
}
각 Author은 0혹은 1개의 Book을 갖는다.
하지만 책에는 공동 저자 라는 것이 있다.
즉, 여러 Author가 하나의 Book을 사용할 수 있다.
이러한 관계가 다-대-일 이다.
author1
author2
author3
author4
book1
book2
12. 11
02 관계(Relationships)
Realm에서 관계는 어떻게 정의하는지 알아보자.
2
다 대 다
다 대 다
public class Book extends RealmObject {
private String title;
// 다른 필드 및 getter, setter
}
public class Author extends RealmObject {
private RealmList<Book> books;
// 다른 필드 및 getter, setter
}
Author는 여러 권의 Book을 집필 했을 수 있다.
이때 또한 공동 저자가 적용 될 수 있다.
다-대-다 관계이다.
RealmList를 이용하면 다-대-다 관계를 설정할 수 있다.
author1
author2
author3
author4
book1
book2
book3
13. 12
02 관계(Relationships)
Realm에서 관계는 어떻게 정의하는지 알아보자.
2
다 대 다
다 대 다
RealmList는 자바의 List와 비슷한 행동을 한다.
RealmList안에 객체를 추가하기 위해서는 RealmList.add()를 사용하면 된다.
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
Author author = realm. createObject(Author.class);
Book book = realm.createObject(Book.class);
Book.settitle(“realm”);
author.books.add(book);
}
});
14. 13
RealmList의 사용
RealmList를 사용하여 재귀적인 관계도 설정 가능하다.
public class Person extends RealmObject {
private RealmList<Person> friends;
// 다른 필드 및 getter, setter
}
RealmList 필드에 null 값을 설정하면 리스트가 초기화된다.
이것은 null로 바꾸는 것이 아닌 길이가 0인 리스트로 만드는 것이다.
때문에 RealmList의 getter는 null을 절대 반환하지 않는다.
길이가 0인 리스트를 반환한다.