To know Flashcards
What is MVVM pattern?
MVVM is architectural pattern that separates an application into three main logical components Model, View, and ViewModel.
It is a derivation of the MVC pattern, in which Controller is replaced with ViewModel.
Model is responsible to manage data, that independent from the user interface. It is recommended to expose data through observables, for example with RxJava library.
View is responsible for rendering UI elements, accept user input and pass it to the ViewModel. View does not know anything about Model. It interacts only with ViewModel.
ViewModel is responsible for interaction with Model and also prepares observable(s) that can be observed by a Vie
What are advantages of MVVM?
- Ensures your UI matches your data state.
- No memory leaks. Observers are bound to lifecycle of View and clean up after themselves when their associated lifecycle is destroyed.
- No crashes due to lifecycle stopped.
What is SpringBoot?
Spring Boot is an open source Java-based framework for developing sites, web applications and micro services.
You can use java or some jvm languages like Kotlin, Groovy or Scala.
It is increases productivity and avoids writing lots boilerplate code. Because most tasks already solved by Spring Boot itself or by libraries of the Spring Boot ecosystem. As example, it has emeded tomcat http server, generate crud repository in couple lines. It has default configurations for some databases, template engines and etc.
It provides lots of plugins to develop and test applications.
What is a bean in SpringBoot
Components of the Spring Boot application are called beans. In simple words, bean is an object that managed by the Spring Boot IoC container. Such object lives in memory so long time as necessary. Only one instance will be created for every type. At nowadays the Java annotations are used for defining beans, early the xml files were used.
Servlet is a bean, that handles a client query, usually across HTTP. DispatcherServlet is a default servlet also socalled a front controller. It accepts all incoming request, searches a appropriate handler and returns response to user.
Each request is executed in its own thread. By default, the thread pool size is 200. This means that 200 requests are possible at the same time.
If requests have long time processing, you can optimize the code using asynchronous Spring Boot features or reactive programming using WebFlux. Obviously, in this case is assumed your API is a non-blocking API. Also you can manage data caching.
annotations
What pattern does Spring Bootfollow?
Spring Boot follows to MVC pattern. So the controller controls the data flow into model object and updates the view whenever data changes. For example, a model object can be loaded from the db and view can be an html template.
What is Data Abstraction?
Data abstraction is the reduction of a particular body of data to a simplified representation of the whole.
Abstraction, in general, is the process of taking away or removing characteristics from something in order to reduce it to a set of essential characteristics. As in abstract art, the representation is likely to be one potential abstraction of a number of possibilities. A database abstraction layer, for example, is one of a number of such possibilities.
Data abstraction is usually the first step in database design. A complete database is much too complex a system to be developed without first creating a simplified framework. Data abstraction makes it possible for the developer to start from essential elements – data abstractions – and incrementally add data detail to create the final system.
What is Databinding?
Data binding is the process of connecting a display element, such as a user interface control, with the information that populates it. This connection provides a path for the information to travel between the source and the destination. For example, consider the main window on your favorite browser. Obviously, there are differences between browsers out there, but most have two important elements, a link bar where you type in the address of the page you want, and a display area where the requested page is drawn. Each of these is a user interface control that accepts, or displays, information for you.
What is broadcast receiver?
Android component which allows you to send or receive Android system or application events.
All the registered application are notified by the Android runtime once event happens. It works similar to the publish-subscribe design pattern and used for asynchronous inter-process communication.
What is a content provider?
- manages access to a central repository of data.
- part of an Android application, which often provides its own UI for working with the data.
- primarily intended to be used by other applications, which access the provider using a provider client object
Content providers can help an application manage access to data stored by itself, stored by other apps, and provide a way to share data with other apps. They encapsulate the data, and provide mechanisms for defining data security.