일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- 추상팩토리패턴
- designPattern
- Observer Pattern
- El
- Singleton
- 함수형프로그래밍
- a
- Kotlin
- 디자인패턴 #
- 팩토리 메소드
- Functional Programming
- r
- Design Pattern
- factory method
- PrototypePattern
- F
- Abstract Factory
- 싱글톤
- 빌터패턴
- 옵저버 패턴
- 추상 팩토리
- ㅓ
- 프로토타입 패턴
- builderPattern
- 코틀린
- 디자인패턴
- ㅋㅁ
- Today
- Total
목록Android Jetpack Architecture (70)
오늘도 더 나은 코드를 작성하였습니까?
Navigation 이란 사용자가 앱 내의 여러 콘텐츠를 탐색하고, 화면에 들어갔다 나올 수 있게 하는 상호작용을 의미합니다. Android Jetpack의 탐색 구성요소는 단순한 버튼 클릭해서 좀 더 복잡한 패턴(앱바, 탐색 창)에 이르기까지 여러 가지 탐색을 구현하도록 도와줍니다. 탐색 구성요소는 기존의 원칙을 준수하여 일관적이고 예측 가능한 사용자 환경을 보장합니다. 핵심구성요소 1. NavGraph -모든 탐색 관련 정보가 하나의 중심 위치에 모여 있는 XML 리소스입니다. 앱 내의 모든 개별적 콘텐츠 영역(destinations)과 사용자가 앱에서 갈 수 있는 모든 이용 가능한 경로가 포함된다. 2. NavHost - navi graph에서 destinations 표시하는 empty contai..
특수한 반환 유형을 비롯하여 쿼리 메서드에 다양한 반환 유형을 지원합니다. 다음 표는 쿼리 유형 및 프레임워크에 기반한 관련 반환 유형을 보여줍니다. Flow을 사용하는 반응형 쿼리 Room 2.2 이상에서는 Kotlin의 Flow 기능을 사용하여 앱의 UI를 최신 상태로 유지할 수 있습니다. 기본 데이터가 변경될 때 UI가 자동으로 업데이트되도록 하려면 Flow 객체를 반환하는 쿼리 메서드를 작성하세요. 테이블의 데이터가 변경될 때마다 반환된 Flow 객체가 쿼리를 다시 트리거하고 전체 결과 세트를 다시 내보냅니다. 테이블 데이터 변경 ----> 이전에 반환된 Flow 객체가 DB에 쿼리 요청하여 변경된 데이터 수신한다. Flow를 사용하는 반응형 쿼리에는 한 가지 중요한 제한사항이 있습니다. Flow..
앱 데이터에 액세스 하려면데이터 액세스 객체 또는 DAO를 사용해야 된다. 각 DAO에는 앱 데이터베이스의 추상 액세스를 제공하는 메서드가 포함되어 있으므로 이 Dao 객체 세트는 Room의 기본 구성요소를 구성한다. 쿼리 빌더나 직접 쿼리 대신 DAO 클래스를 사용하면 데이터 베이스 구성 요소를 분리하고, 단위 테스트가 수월하다. DAO는 인터페이스 또는 추상 클래스일 수 있습니다. 추상 클래스라면 RoomDatabase를 유일한 매개변수로 사용하는 생성자를 선택적으로 가질 수 있습니다. Room은 컴파일 시간에 각 DAO 구현을 생성합니다. Room은 UI스레드(메인 스레드)에서 데이터 베이스 접근을 허용하지 않는다. (UI를 오랫동안 잠글 수 있기 때문입니다. ) allowMainThreadQuer..
뷰 ( View ) - 허용된 데이터를 제한적으로 보여주기 위해서 하나 이상의 테이블에서부터 유도된 가상 테이블입니다. 장점 1. 논리적 독립성을 제공합니다. 2. 데이터 접근 제어로 보안 가능합니다. - 뷰를 통해 접근하기 때문에 뷰에 나타나지 않는 데이터를 접근할 수 없다.. 3. 사용자의 데이터 관리를 간단하게 합니다. 4. 하나의 테이블로 여러 개의 다른 뷰를 정의할 수 있습니다. 단점 1. 독자적인 인덱스를 가질 수 없습니다. 2. 한 번 정의된 뷰는 변경할 수 없으며, 삭제한 후에 다시 생성해야 합니다. 3. 삽입, 삭제, 갱신 연산에 많은 제약이 따릅니다. 2.1.0 이상 버전의 Room 지속성 라이브러리는 SQLite 데이터베이스 뷰를 지원하므로 쿼리를 클래스로 캡슐화할 수 있습니다. Ro..