A viewmodel is like a special box for a computer program. Imagine you have a toy box. The toy box holds your toys so you can find them easily. In a computer app, the viewmodel holds the information that you see on the screen. For example, if you have a weather app, the viewmodel holds the temperature number and the picture of the sun. It makes sure the screen shows the right things. It is a helper for the part of the app that you look at. Without this helper, the app might get confused about what to show. It is very simple: it takes information and keeps it ready for the screen. When you click a button, the viewmodel might change the information in the box. Then the screen changes too. It is like a bridge between the hidden parts of the app and the parts you can see. Even though it sounds like a big word, you can think of it as a 'screen helper.' It is very useful for people who build apps because it keeps things organized. Just like you keep your room clean by putting toys in a box, a programmer keeps an app clean by putting information in a viewmodel. This way, if they want to change how the app looks, they don't have to change all the information inside. They just change the 'box' or how the box is shown. It is a very friendly part of a computer program.
A viewmodel is a term used by people who make apps for phones and computers. It is a part of the app that manages the data for one screen. Think of a screen that shows a list of your friends. The viewmodel is the part of the code that gets the list of names and prepares them to be shown. It doesn't decide what color the names are, but it makes sure the names are ready. If you search for a friend, the viewmodel filters the list. It acts as a middleman. On one side, you have the 'Model,' which is the big database of all information. On the other side, you have the 'View,' which is what the user sees. The viewmodel stands in the middle. It takes only the information the user needs right now and gives it to the View. This is good because it keeps the app fast and organized. If the phone rotates, the viewmodel remembers what was on the screen so the user doesn't lose their place. It is like a small assistant that handles the 'logic' of the screen. For example, if a user types a password that is too short, the viewmodel can say 'this is too short' before the app even tries to send it to the internet. It helps the app feel smooth and smart. Most modern apps use viewmodels because they make the code easier to write and fix.
In software development, a viewmodel is a component that prepares data for the user interface. It is part of a design pattern called MVVM, which stands for Model-View-ViewModel. The main job of a viewmodel is to handle the logic for a specific screen or 'view.' For instance, if you are building a shopping app, the viewmodel for the 'Cart' screen would calculate the total price of the items, handle the logic for removing an item, and manage the state of the 'Checkout' button (like making it grey if the cart is empty). One of the biggest advantages of using a viewmodel is that it separates the visual part of the app from the data part. This means that the person designing the UI can change the layout without affecting the logic, and the developer can change the logic without breaking the layout. Another key feature is 'data binding.' This is a way for the viewmodel and the UI to talk to each other automatically. When the data in the viewmodel changes, the UI updates itself immediately. This makes the app feel very responsive. Developers also like viewmodels because they make it easier to test the app. You can write a test to check if the viewmodel calculates the price correctly without having to actually open the app on a phone. This saves a lot of time and helps prevent bugs.
A viewmodel is an architectural component designed to store and manage UI-related data in a lifecycle-conscious way. It serves as an intermediary between the Model (the data source and business logic) and the View (the UI components). The primary goal of a viewmodel is to provide a clean separation of concerns. By moving UI logic out of the View (such as an Activity in Android or a ViewController in iOS) and into the viewmodel, the code becomes much more modular and maintainable. For example, a viewmodel might fetch data from a repository, transform it into a format suitable for display, and then expose it through observable properties. The View then 'subscribes' or 'binds' to these properties. This reactive approach ensures that the UI always reflects the current state of the data. A significant benefit of viewmodels in frameworks like Android is their ability to survive configuration changes. When a user rotates their device, the Activity is often destroyed and recreated, but the viewmodel remains in memory, allowing the UI to instantly restore its state. This prevents unnecessary network calls and provides a better user experience. Furthermore, because viewmodels do not have direct dependencies on UI frameworks, they are ideal for unit testing. Developers can simulate user actions by calling methods on the viewmodel and then asserting that the exposed state has changed as expected, all within a fast-running test environment.
The viewmodel is a sophisticated abstraction layer within the Model-View-ViewModel (MVVM) architectural pattern, specifically engineered to facilitate the decoupling of the graphical user interface from the underlying business logic and data models. At its core, the viewmodel is an 'abstraction of the view'; it exposes the data and commands that the view requires, but in a way that is entirely agnostic of the specific UI implementation. This means the viewmodel doesn't know if it's being displayed on a mobile screen, a desktop window, or even a watch face. It simply provides a stream of state updates and handles incoming user actions. One of the most critical aspects of a well-implemented viewmodel is state management. It acts as the 'single source of truth' for the UI, consolidating various data streams—such as network responses, database updates, and user inputs—into a cohesive UI state object. This state is typically exposed using reactive programming constructs like Observables, Flows, or Publishers. By utilizing data binding, the view is able to automatically synchronize with the viewmodel, reducing the need for 'boilerplate' code that manually updates UI elements. From a maintenance perspective, the viewmodel is indispensable for large-scale projects. It allows for rigorous unit testing of the presentation logic without the overhead of UI automation frameworks. Moreover, it prevents the 'Massive View Controller' anti-pattern by providing a dedicated space for logic that would otherwise clutter the UI layer, thereby enhancing code readability and promoting the principle of single responsibility.
In the context of advanced software architecture, a viewmodel represents a formalization of the presentation logic, acting as a stateful mediator that orchestrates the interaction between the domain layer and the user interface. Within the MVVM paradigm, the viewmodel functions as a specialized adapter that transforms domain models into view-specific data structures, often performing complex aggregations or formatting that would be inappropriate for the domain layer itself. It encapsulates the 'behavior' of the view, exposing commands (actions) and observable state properties that the view consumes via a binder. This architectural choice is fundamental to achieving a high degree of testability and maintainability, as it allows the presentation logic to be exercised in isolation from the volatile and platform-dependent UI framework. A C2-level understanding of viewmodels also involves recognizing their role in managing asynchronous operations and concurrency. For instance, a viewmodel might manage the lifecycle of a network request, ensuring that the result is delivered to the UI only if the view is still active, thereby preventing memory leaks and crashes. Furthermore, in modern declarative UI frameworks like SwiftUI or Jetpack Compose, the viewmodel becomes the primary driver of the 'unidirectional data flow,' where user intents are sent to the viewmodel, and the viewmodel responds by emitting a new, immutable state. This approach minimizes side effects and makes the application's behavior more predictable and easier to debug. Ultimately, the viewmodel is not just a data holder; it is a strategic component that enables the construction of robust, scalable, and platform-agnostic user interfaces by strictly enforcing the boundaries between data, logic, and presentation.

viewmodel 30秒で

  • A viewmodel is a mediator in software architecture that prepares and manages data specifically for a user interface screen, ensuring a clean separation of concerns.
  • It acts as the 'source of truth' for the UI state, handling logic like data formatting, validation, and user interaction processing without direct UI references.
  • Commonly used in the MVVM (Model-View-ViewModel) pattern, it helps developers create apps that are more modular, easier to test, and resilient to lifecycle changes.
  • By decoupling the UI from the business logic, viewmodels allow designers and developers to work independently and improve the overall maintainability of large codebases.

In the specialized world of software engineering, specifically within the realm of user interface (UI) design patterns, a viewmodel is a critical architectural component. It serves as a specialized mediator or a 'bridge' that sits between the raw data of an application (the Model) and the visual elements the user interacts with (the View). The term is most famously associated with the Model-View-ViewModel (MVVM) pattern, which was originally introduced by Microsoft architects Ken Cooper and Ted Peters to simplify the event-driven programming of user interfaces. When developers use a viewmodel, they are essentially creating a representation of the data that is specifically tailored for the screen. Unlike a standard data model, which might contain complex database relationships or business logic that the user never needs to see, a viewmodel filters, formats, and prepares that data so it can be easily 'bound' to the UI. This separation of concerns is vital for modern application development because it allows designers to work on the visual layout while developers focus on the underlying logic without constantly stepping on each other's toes.

The Mediator Role
The viewmodel acts as a translator. It takes complex data from the backend and converts it into simple properties like strings or booleans that the UI can display directly without further calculation.

By moving the formatting logic into the viewmodel, we ensured that the view remains 'dumb' and only focuses on rendering pixels.

People use the term 'viewmodel' most frequently during architectural discussions, code reviews, and technical planning sessions. If you are building a mobile app for Android using Jetpack Compose or an iOS app using SwiftUI, the viewmodel is likely the heart of your data flow. It manages the 'state' of the screen—for example, whether a loading spinner should be visible, whether an error message should be shown, or what text should appear in a search bar. Because the viewmodel does not have a direct reference to the UI components (like a specific button or a text field), it is highly testable. Engineers can write automated tests to verify that the viewmodel behaves correctly under different conditions without ever needing to launch the actual app on a device. This makes the development cycle faster and the resulting software much more reliable.

State Management
The viewmodel is responsible for holding the 'truth' of what is currently happening on the screen, ensuring that even if the screen rotates or changes size, the data remains intact.

We need to update the viewmodel to handle the new user permissions before we update the UI layout.

In a professional setting, mentioning a viewmodel implies a certain level of architectural maturity. It suggests that the team is following the principle of 'Separation of Powers,' where the UI is decoupled from the business logic. This is particularly important in large-scale enterprise applications where multiple developers are working on the same codebase. By standardizing on the use of viewmodels, a team creates a predictable structure where everyone knows exactly where the logic for a specific screen resides. It prevents the 'Massive View Controller' problem, where a single file becomes thousands of lines long and impossible to maintain. Instead, the viewmodel keeps things modular, clean, and organized.

The viewmodel exposes a stream of data that the view observes and reacts to automatically.

Data Binding
This is the process where the viewmodel and the view are linked so that changes in one are automatically reflected in the other without manual intervention.

Our viewmodel currently handles too many responsibilities; we should split it into smaller, more focused components.

If the API returns a null value, the viewmodel should provide a default string to avoid crashing the view.

Using the word 'viewmodel' correctly requires an understanding of its role as a noun representing a software object. It is almost always used in the context of development, architecture, or technical documentation. Because it is a compound word derived from 'View' and 'Model,' it is frequently capitalized as 'ViewModel' in code, but in general technical writing, it can be treated as a standard noun. You will often see it paired with verbs like 'instantiate,' 'bind,' 'observe,' 'inject,' and 'test.' For example, a developer might say, 'I need to instantiate the viewmodel before the fragment is created.' This indicates the lifecycle management of the object. Another common usage involves the flow of data: 'The viewmodel observes the repository for changes and then updates the UI state.' Here, the viewmodel is the active agent managing data streams.

Describing Lifecycle
'The viewmodel survives configuration changes, ensuring that the user's input isn't lost when the phone rotates.'

Always ensure that your viewmodel does not hold a reference to a Context, as this can lead to memory leaks.

In a team environment, you might use 'viewmodel' to describe the scope of a feature. 'We should add a new property to the viewmodel to handle the toggle state of the dark mode switch.' This sentence shows the viewmodel as a container for UI-related logic. It is also common to use it when discussing testing strategies: 'Unit testing the viewmodel is much easier than testing the activity because it has no dependencies on the Android framework.' This highlights the architectural benefit of the component. Furthermore, when troubleshooting, a developer might remark, 'The bug isn't in the UI; the viewmodel is providing the wrong data to the observer.' This pinpointing of responsibility is a key reason why the term is so prevalent in modern software engineering discourse.

Discussing Data Flow
'The viewmodel transforms the raw integer from the database into a formatted currency string for the user interface.'

Is the viewmodel responsible for navigation logic, or should that be handled by a separate coordinator?

When writing technical documentation or tutorials, the word is used to guide the reader through the structure of an app. 'In this section, we will create a viewmodel that fetches a list of users from a remote API.' This usage establishes the viewmodel as a functional unit of work. It can also be used as an adjective in some contexts, such as 'viewmodel-driven architecture' or 'viewmodel-first navigation,' though these are less common than its use as a noun. In senior-level discussions, you might hear it used to critique code: 'This viewmodel is becoming a god-object; we need to refactor it.' This indicates that the viewmodel has taken on too many responsibilities, violating the single responsibility principle. Overall, the word is indispensable for anyone describing how data moves from a database to a human eye.

The viewmodel uses a 'StateFlow' to emit updates to the UI whenever the underlying data changes.

Refactoring Context
'We should move this validation logic from the activity into the viewmodel to make it more reusable and testable.'

Each screen in our application is backed by its own dedicated viewmodel to ensure strict separation of concerns.

The viewmodel acts as a buffer, preventing the UI from being overwhelmed by rapid data updates from the network.

The word 'viewmodel' is a staple of the professional software developer's vocabulary. You will hear it most frequently in office environments where mobile or desktop applications are being built. During a morning 'stand-up' meeting, a developer might say, 'I'm finishing up the viewmodel for the login screen today.' This tells the team that the logic for handling user input, validation, and communication with the authentication service is being finalized. It is also a very common term in technical interviews. A candidate might be asked, 'How do you handle state management in your apps?' and they would likely respond by explaining how they use viewmodels to keep the UI in sync with the data. In this context, the word acts as a signal of professional competence and familiarity with industry-standard design patterns.

In Code Reviews
'You've put too much business logic in this viewmodel; some of this should probably be moved to a UseCase or Repository.'

During the architecture meeting, the lead engineer insisted on using a shared viewmodel for the multi-step registration flow.

Beyond the office, you will find 'viewmodel' all over the internet in developer communities. On sites like Stack Overflow, thousands of questions are tagged with 'viewmodel,' ranging from 'how to share a viewmodel between fragments' to 'why is my viewmodel not updating the UI?' It is a central topic in online tutorials on YouTube, Udemy, and Coursera, especially those focusing on Android development with Kotlin or Windows development with C# and WPF. Technical bloggers and 'thought leaders' in the tech space frequently write articles comparing the 'ViewModel' approach to other patterns like 'MVI' (Model-View-Intent) or 'Redux.' In these discussions, the viewmodel is often portrayed as the reliable, standard way to build apps, even as newer, more experimental patterns emerge.

At Tech Conferences
'The speaker at Google I/O explained how the new navigation component integrates seamlessly with the viewmodel lifecycle.'

I read a blog post about using the viewmodel pattern in React to manage complex form states.

You will also encounter the term in official documentation from major tech companies. Microsoft's documentation for .NET and WPF is filled with references to the ViewModel as part of the MVVM pattern. Similarly, Google's Android Developer documentation has an entire section dedicated to the 'ViewModel' class, which they provide as part of their 'Architecture Components' library. In these documents, the word is used with high precision to describe a specific class that developers should inherit from. Even in the world of game development, specifically when using engines like Unity with certain UI frameworks, the concept of a viewmodel is used to separate the game's internal logic from the head-up display (HUD) that the player sees. Wherever there is a need to separate 'how things look' from 'how things work,' you will hear the word 'viewmodel.'

The documentation states that the viewmodel should never contain references to Views or any class that may hold a reference to the Activity context.

In Job Descriptions
'The ideal candidate will have extensive experience with the MVVM pattern and a deep understanding of viewmodel implementation.'

We discussed whether the viewmodel should be responsible for triggering the navigation to the next screen.

The viewmodel is the perfect place to consolidate all the logic for your screen's UI state.

One of the most frequent mistakes developers make when working with a viewmodel is violating the principle of separation of concerns by including UI-specific code within it. A viewmodel should never know about the specific buttons, text views, or layouts used in the View. For instance, importing 'android.widget.Button' into a viewmodel is a major 'code smell.' This mistake makes the viewmodel impossible to unit test without a device and ties it too closely to a specific UI implementation. If the UI changes from a button to a clickable image, the viewmodel shouldn't have to change. Another common error is passing a 'Context' (in Android) or a 'View' reference into the viewmodel. This almost always leads to memory leaks because the viewmodel often lives longer than the View it serves. When the View is destroyed (like when a user hits the back button), the viewmodel might still be holding onto it, preventing the system from reclaiming that memory.

The 'Fat' ViewModel
This happens when a developer puts all the application's business logic, networking code, and database queries directly inside the viewmodel, making it huge and hard to manage.

Don't let your viewmodel become a 'God Object' that tries to do everything in your app.

Another mistake is failing to handle the lifecycle of the viewmodel correctly. In some frameworks, viewmodels are designed to survive configuration changes (like screen rotation), but they are not meant to last forever. Developers sometimes forget to clear observers or cancel background tasks when the viewmodel is finally cleared, which can lead to background processes running indefinitely and wasting battery or data. Additionally, some developers use the viewmodel as a simple data holder without any logic. While not technically 'wrong,' it misses the point of the pattern. If a viewmodel only contains a single string that is passed directly from the Model to the View without any transformation, it might be unnecessary overhead. The goal is to have the viewmodel provide 'UI State'—a holistic view of what the screen should look like—rather than just being a mirror of the database.

Logic Misplacement
Putting complex business rules (like how to calculate interest on a loan) in the viewmodel instead of the Model or a Domain layer.

If you find yourself writing 'if (view.isVisible)' inside your viewmodel, you are doing it wrong.

Finally, a subtle but impactful mistake is over-complicating the communication between the viewmodel and the View. Using complex custom interfaces or callbacks when a simple 'Observable' or 'StateFlow' would suffice can make the code much harder to read. Conversely, some developers try to share a single viewmodel across too many different screens. While sharing a viewmodel can be useful for passing data between related fragments, doing it excessively creates tight coupling between screens that should be independent. If you change the viewmodel for one screen, you might accidentally break three other screens that you didn't realize were using it. The best practice is generally to have one viewmodel per screen, or a very clearly defined 'shared' viewmodel for a specific, limited flow of screens.

The viewmodel should expose data, not tell the view what to do; the view decides how to show that data.

Testing Neglect
Since viewmodels are designed to be testable, not writing unit tests for them is a wasted opportunity to ensure app stability.

A common pitfall is forgetting to handle the 'Error State' in the viewmodel, leaving the user with a blank screen if the network fails.

By avoiding these common viewmodel mistakes, you can build apps that are easier to maintain and much less prone to bugs.

While 'viewmodel' is the dominant term in the MVVM pattern, there are several other components in different architectural patterns that serve similar purposes. Understanding these alternatives helps clarify exactly what a viewmodel is and isn't. The most common alternative is the 'Controller' from the Model-View-Controller (MVC) pattern. In MVC, the Controller is responsible for handling user input and updating the Model, but it often has a more direct relationship with the View than a viewmodel does. In many web frameworks, the Controller is the entry point for a request, whereas a viewmodel is more of a state-holder for a specific piece of UI. Another close relative is the 'Presenter' from the Model-View-Presenter (MVP) pattern. A Presenter is very similar to a viewmodel, but it usually holds a direct reference to an interface implemented by the View. This means the Presenter 'tells' the View what to do (e.g., 'view.showLoading()'), while a viewmodel simply 'exposes' a state (e.g., 'isLoading = true') that the View chooses to react to.

ViewModel vs. Controller
A Controller handles the 'how' of user interaction, while a ViewModel focuses on the 'what' of the UI state.

While MVC uses a controller, MVVM relies on the viewmodel to decouple the logic from the layout.

In more modern, functional-reactive architectures, you might encounter terms like 'Store' or 'State.' In the Redux pattern, a 'Store' holds the entire application's state in a single place. While a viewmodel is usually scoped to a single screen, a Redux Store is global. However, both serve the purpose of being the 'source of truth' for the UI. In the Model-View-Intent (MVI) pattern, the equivalent of a viewmodel might be called a 'State Producer' or simply a 'Reducer.' These components take user 'Intents' and produce a new 'State' object. The viewmodel is essentially a more object-oriented way of achieving this same goal. In some smaller applications or simpler frameworks, people might just use a 'Data Transfer Object' (DTO) or a 'Value Object' to pass data to the view, but these lack the logic-handling and lifecycle-awareness that define a true viewmodel.

ViewModel vs. Presenter
Presenters are typically one-to-one with a View and use interfaces; ViewModels are often many-to-one and use data binding.

The transition from MVP to MVVM often involves replacing the presenter with a viewmodel to take advantage of reactive programming.

Another term you might hear is 'Binder.' In some older implementations of MVVM, the Binder was a separate component that linked the View and the ViewModel. Today, the 'binding' is usually handled by the framework itself (like Android Data Binding or SwiftUI's @Published properties), so the term 'Binder' has fallen out of common use, but the concept remains central to how a viewmodel works. Finally, in the context of clean architecture, a viewmodel is often seen as part of the 'Interface Adapters' layer. It adapts the data from the 'Use Cases' (business logic) into a format that the 'Frameworks and Drivers' layer (the UI) can understand. Whether you call it a viewmodel, a presenter, or a state-holder, the fundamental goal remains the same: making the UI code cleaner, more testable, and easier to change over time.

In React development, 'Custom Hooks' often serve the exact same purpose as a viewmodel by encapsulating logic and state.

ViewModel vs. State Holder
A state holder is a generic term; a ViewModel is a specific type of state holder that is aware of the UI lifecycle.

Choosing between a viewmodel and a simple controller depends on the complexity of your UI and the need for unit testing.

The viewmodel is the most popular choice for modern Android development because of its robust lifecycle management.

How Formal Is It?

豆知識

The MVVM pattern and the term 'ViewModel' were actually inspired by the 'Presentation Model' pattern described by Martin Fowler, but Gossman simplified it for use with XAML-based UI frameworks.

発音ガイド

UK /ˈvjuːˌmɒd.əl/
US /ˈvjuːˌmɑː.dəl/
Primary stress on the first syllable: VIEW-mod-el.
韻が合う語
new model blue model true model few model queue model due model shoe model crew model
よくある間違い
  • Pronouncing it as three separate words: 'view-mo-del'. It should flow as a single compound noun.
  • Putting the stress on 'model' instead of 'view'.
  • Confusing the pronunciation with 'voodoo' (rare but happens with non-native speakers).

難易度

読解 4/5

Requires understanding of software architecture and technical jargon.

ライティング 5/5

Correctly spelling and using it in a technical context requires specific knowledge.

スピーキング 3/5

Pronunciation is straightforward once you know it's a compound word.

リスニング 4/5

Can be easily confused with 'Model' or 'View' in fast-paced technical discussions.

次に学ぶべきこと

前提知識

Model View Architecture Logic State

次に学ぶ

Data Binding MVVM Dependency Injection Reactive Streams Unit Testing

上級

MVI (Model-View-Intent) Clean Architecture Redux StateFlow Combine

知っておくべき文法

Compound Nouns

ViewModel is a compound noun formed from 'View' and 'Model'.

Countable Nouns

We are using three different viewmodels for this feature.

Technical Capitalization

In code, it is 'ViewModel', but in prose, it can be 'viewmodel'.

Possessive Technical Terms

The viewmodel's responsibility is to manage state.

Gerunds as Subjects in Tech

Implementing a viewmodel improves code quality.

レベル別の例文

1

The viewmodel helps the screen show the name.

Le viewmodel aide l'écran à afficher le nom.

Simple subject-verb-object structure.

2

Put the data in the viewmodel.

Mettez les données dans le viewmodel.

Imperative sentence.

3

Is the viewmodel ready?

Le viewmodel est-il prêt ?

Basic question form.

4

The viewmodel has the sun icon.

Le viewmodel contient l'icône du soleil.

Present tense with 'has'.

5

I like this viewmodel.

J'aime ce viewmodel.

Subject-verb-object.

6

The viewmodel is small.

Le viewmodel est petit.

Using 'is' with an adjective.

7

Look at the viewmodel.

Regardez le viewmodel.

Imperative.

8

The viewmodel changes the color.

Le viewmodel change la couleur.

Third person singular present.

1

The viewmodel gets the list of friends.

Le viewmodel récupère la liste d'amis.

Present tense.

2

You should use a viewmodel for this screen.

Vous devriez utiliser un viewmodel pour cet écran.

Using the modal 'should'.

3

The viewmodel keeps the data safe.

Le viewmodel garde les données en sécurité.

Third person singular.

4

We are updating the viewmodel now.

Nous mettons à jour le viewmodel maintenant.

Present continuous.

5

Does the viewmodel have the new price?

Le viewmodel a-t-il le nouveau prix ?

Question with 'does'.

6

The viewmodel is better than the old way.

Le viewmodel est meilleur que l'ancienne méthode.

Comparative adjective.

7

I created a viewmodel for the login page.

J'ai créé un viewmodel pour la page de connexion.

Past simple.

8

The viewmodel tells the view what to show.

Le viewmodel dit à la vue quoi afficher.

Complex object 'what to show'.

1

The viewmodel handles the logic for the shopping cart.

Le viewmodel gère la logique du panier d'achat.

Focus on 'handles' as a functional verb.

2

If the user clicks delete, the viewmodel removes the item.

Si l'utilisateur clique sur supprimer, le viewmodel supprime l'article.

First conditional structure.

3

We use data binding to connect the viewmodel to the UI.

Nous utilisons la liaison de données pour connecter le viewmodel à l'interface utilisateur.

Infinitive of purpose 'to connect'.

4

The viewmodel doesn't know about the specific buttons.

Le viewmodel ne connaît pas les boutons spécifiques.

Negative present simple.

5

Testing the viewmodel is much faster than testing the whole app.

Tester le viewmodel est beaucoup plus rapide que de tester toute l'application.

Gerund as a subject.

6

The viewmodel was designed to survive screen rotations.

Le viewmodel a été conçu pour survivre aux rotations d'écran.

Passive voice.

7

Can you check if the viewmodel is emitting the correct state?

Pouvez-vous vérifier si le viewmodel émet le bon état ?

Indirect question with 'if'.

8

Each screen in our app has its own viewmodel.

Chaque écran de notre application a son propre viewmodel.

Use of 'each' and 'its own'.

1

The viewmodel serves as an intermediary between the repository and the UI.

Le viewmodel sert d'intermédiaire entre le référentiel et l'interface utilisateur.

Formal verb 'serves as'.

2

By observing the viewmodel, the fragment can react to data changes automatically.

En observant le viewmodel, le fragment peut réagir automatiquement aux changements de données.

Gerund phrase 'By observing'.

3

It is crucial that the viewmodel does not hold a reference to the activity context.

Il est crucial que le viewmodel ne détienne pas de référence au contexte de l'activité.

Subjunctive-like structure 'It is crucial that'.

4

The viewmodel transforms raw data into a displayable format for the user.

Le viewmodel transforme les données brutes en un format affichable pour l'utilisateur.

Precise technical vocabulary.

5

We should refactor this logic into the viewmodel to improve testability.

Nous devrions refactoriser cette logique dans le viewmodel pour améliorer la testabilité.

Modal 'should' for recommendation.

6

The viewmodel's primary responsibility is managing the UI state.

La responsabilité principale du viewmodel est de gérer l'état de l'interface utilisateur.

Possessive form.

7

When the viewmodel is cleared, all background tasks are cancelled.

Lorsque le viewmodel est effacé, toutes les tâches en arrière-plan sont annulées.

Passive voice in a temporal clause.

8

The viewmodel exposes a LiveData object that the view subscribes to.

Le viewmodel expose un objet LiveData auquel la vue s'abonne.

Relative clause with 'that'.

1

The viewmodel encapsulates the presentation logic, ensuring a clean separation from the domain layer.

Le viewmodel encapsule la logique de présentation, assurant une séparation nette de la couche de domaine.

Use of 'encapsulates' and participial phrase 'ensuring'.

2

Leveraging a viewmodel allows us to maintain a stateless view that merely reflects the current UI state.

L'exploitation d'un viewmodel nous permet de maintenir une vue sans état qui reflète simplement l'état actuel de l'interface utilisateur.

Gerund 'Leveraging' as a subject.

3

The viewmodel acts as an abstraction of the view, exposing only the necessary data and commands.

Le viewmodel agit comme une abstraction de la vue, n'exposant que les données et commandes nécessaires.

Appositive phrase 'exposing only...'.

4

Any business logic found in the viewmodel should be moved to a use case to adhere to clean architecture principles.

Toute logique métier trouvée dans le viewmodel devrait être déplacée vers un cas d'utilisation pour adhérer aux principes de l'architecture propre.

Passive voice with 'should be moved'.

5

The viewmodel facilitates unit testing by allowing developers to verify UI logic without inflating the layout.

Le viewmodel facilite les tests unitaires en permettant aux développeurs de vérifier la logique de l'interface utilisateur sans gonfler la mise en page.

Gerund 'inflating' in a prepositional phrase.

6

Using a shared viewmodel is an effective strategy for coordinating state between multiple fragments in a single activity.

L'utilisation d'un viewmodel partagé est une stratégie efficace pour coordonner l'état entre plusieurs fragments dans une seule activité.

Complex subject phrase.

7

The viewmodel should remain agnostic of the specific UI framework being utilized.

Le viewmodel doit rester agnostique vis-à-vis du framework d'interface utilisateur spécifique utilisé.

Use of the technical term 'agnostic'.

8

We observed a significant reduction in boilerplate code after implementing the viewmodel pattern.

Nous avons observé une réduction significative du code répétitif après avoir implémenté le modèle viewmodel.

Prepositional phrase 'after implementing'.

1

The viewmodel orchestrates the flow of data, ensuring that the view remains a passive recipient of state updates.

Le viewmodel orchestre le flux de données, garantissant que la vue reste un récepteur passif des mises à jour d'état.

Advanced verb 'orchestrates' and precise terminology.

2

By centralizing state management within the viewmodel, we mitigate the risks associated with inconsistent UI representations.

En centralisant la gestion de l'état au sein du viewmodel, nous atténuons les risques associés aux représentations incohérentes de l'interface utilisateur.

Gerund phrase 'By centralizing' and 'mitigate'.

3

The viewmodel's lifecycle is decoupled from the view's ephemeral nature, providing a robust mechanism for state persistence.

Le cycle de vie du viewmodel est découplé de la nature éphémère de la vue, fournissant un mécanisme robuste pour la persistance de l'état.

Use of 'ephemeral' and 'decoupled'.

4

A common architectural pitfall involves the leakage of domain-specific concerns into the viewmodel's implementation.

Un piège architectural courant implique la fuite de préoccupations spécifiques au domaine dans l'implémentation du viewmodel.

Complex noun phrase as subject.

5

The viewmodel exposes an immutable stream of UI states, adhering to the principles of unidirectional data flow.

Le viewmodel expose un flux immuable d'états d'interface utilisateur, adhérant aux principes du flux de données unidirectionnel.

Participial phrase 'adhering to'.

6

Sophisticated viewmodels leverage dependency injection to maintain a clear separation from data source implementations.

Les viewmodels sophistiqués exploitent l'injection de dépendances pour maintenir une séparation claire des implémentations de sources de données.

Use of 'leverage' and 'dependency injection'.

7

The viewmodel serves as a crucial abstraction that facilitates the parallel development of UI and business logic.

Le viewmodel sert d'abstraction cruciale qui facilite le développement parallèle de l'interface utilisateur et de la logique métier.

Relative clause with 'that'.

8

We must ensure that the viewmodel's complexity does not escalate to the point where it becomes a 'God Object'.

Nous devons veiller à ce que la complexité du viewmodel ne s'intensifie pas au point de devenir un 'God Object'.

Negative modal 'must ensure that... does not'.

よく使う組み合わせ

instantiate a viewmodel
bind to a viewmodel
shared viewmodel
viewmodel lifecycle
unit test a viewmodel
viewmodel factory
observe a viewmodel
fat viewmodel
viewmodel state
inject a viewmodel

よく使うフレーズ

MVVM pattern

— The architectural pattern (Model-View-ViewModel) where the viewmodel is a central component.

Our team decided to adopt the MVVM pattern for all new projects.

Separation of concerns

— The design principle of dividing a program into distinct sections, which the viewmodel helps achieve.

Using a viewmodel promotes separation of concerns between the UI and the data.

Data binding

— The technique that connects the viewmodel's data to the UI elements automatically.

Two-way data binding allows the viewmodel to update when the user types in a text field.

UI State

— The current condition of the user interface, which is managed by the viewmodel.

The viewmodel exposes the UI state as a single object.

Business logic

— The part of the program that encodes the real-world rules, which should generally stay out of the viewmodel.

The viewmodel should call the repository for business logic instead of handling it itself.

Presentation logic

— Logic related to how data is displayed, which is the primary responsibility of the viewmodel.

Formatting a date for the screen is a classic example of presentation logic.

Lifecycle-aware

— A component that responds to changes in the lifecycle status of another component, like a viewmodel.

Android viewmodels are lifecycle-aware and survive configuration changes.

Single source of truth

— The practice of structuring data models so that every data element is mastered in only one place.

The viewmodel acts as the single source of truth for the screen's state.

Boilerplate code

— Sections of code that are repeated in many places with little variation, which viewmodels help reduce.

The viewmodel pattern reduces the boilerplate code needed to sync the UI with the data.

Reactive programming

— A programming paradigm concerned with data streams and the propagation of change, often used with viewmodels.

We use reactive programming to bind the viewmodel to the UI.

よく混同される語

viewmodel vs Model

The Model is the raw data; the ViewModel is the data formatted for the screen.

viewmodel vs Controller

A Controller often handles routing and input; a ViewModel handles UI state and binding.

viewmodel vs View

The View is the visual layout; the ViewModel is the logic behind that layout.

慣用句と表現

"Don't put all your eggs in one viewmodel"

— Avoid making a single viewmodel responsible for too many different features or screens.

The login and registration should have separate classes; don't put all your eggs in one viewmodel.

Informal/Tech-slang
"A dumb view"

— A user interface that has no logic and only displays what the viewmodel tells it to.

We want a dumb view that just renders whatever the viewmodel provides.

Technical Jargon
"God object"

— An object that knows too much or does too much, often a warning for a bloated viewmodel.

That viewmodel is becoming a God object; we need to break it down.

Technical Jargon
"Code smell"

— A surface indication that usually corresponds to a deeper problem in the code, like UI references in a viewmodel.

Seeing a 'Context' in a viewmodel is a definite code smell.

Technical Jargon
"Skinny viewmodel"

— A viewmodel that contains very little logic, often because the logic has been moved to other layers.

I prefer a skinny viewmodel that just delegates to use cases.

Informal/Tech-slang
"Wiring up"

— The process of connecting the viewmodel to the view and the data sources.

I'm just wiring up the new viewmodel to the repository.

Informal/Tech-slang
"Leaky abstraction"

— When an abstraction (like a viewmodel) fails to completely hide the details it is supposed to.

Exposing database entities directly from the viewmodel is a leaky abstraction.

Technical Jargon
"Source of truth"

— The one place where a piece of data is stored and managed.

The viewmodel is the source of truth for the current UI state.

Technical Jargon
"Boilerplate heavy"

— Code that requires a lot of repetitive setup, which some viewmodel implementations are criticized for.

The old way of creating viewmodels was very boilerplate heavy.

Informal/Tech-slang
"State soup"

— A confusing mess of different state variables in a viewmodel that are hard to track.

We need to refactor this state soup into a single UI state object.

Informal/Tech-slang

間違えやすい

viewmodel vs Presenter

Both handle UI logic in similar patterns (MVP vs MVVM).

A Presenter usually has a direct reference to the View, while a ViewModel uses data binding and is agnostic of the View.

In MVP, the presenter calls 'view.showError()'; in MVVM, the viewmodel sets 'showError = true'.

viewmodel vs Data Model

Both contain the word 'Model'.

A Data Model represents a database record; a ViewModel represents the state of a specific screen.

The User Data Model has a password field, but the User ViewModel does not.

viewmodel vs State

A viewmodel often contains the state.

State is the data itself; the ViewModel is the object that manages and exposes that state.

The viewmodel holds the UI state.

viewmodel vs Fragment

In Android, they are often used together.

A Fragment is a part of the UI; a ViewModel is the logic component that the Fragment uses.

The Fragment observes the ViewModel.

viewmodel vs Repository

Both are architectural components.

A Repository handles data fetching (network/DB); a ViewModel handles UI logic and calls the Repository.

The viewmodel asks the repository for the user list.

文型パターン

A1

The [noun] is [adjective].

The viewmodel is good.

A2

I use a [noun] for [purpose].

I use a viewmodel for the list.

B1

The [noun] handles the [logic] for [screen].

The viewmodel handles the logic for the login screen.

B2

By using a [noun], we can [benefit].

By using a viewmodel, we can survive screen rotations.

C1

The [noun] encapsulates [logic], ensuring [result].

The viewmodel encapsulates presentation logic, ensuring a clean separation.

C2

Centralizing [process] within the [noun] mitigates [risk].

Centralizing state management within the viewmodel mitigates the risk of UI bugs.

C1

The [noun] serves as an abstraction of [component].

The viewmodel serves as an abstraction of the view.

B2

The [noun] exposes [data] that the [component] observes.

The viewmodel exposes LiveData that the fragment observes.

語族

名詞

viewmodel
viewmodeling (rarely used to describe the process)

動詞

viewmodel (used informally as a verb: 'We need to viewmodel this screen')

形容詞

viewmodel-driven
viewmodel-based

関連

Model
View
MVVM
DataBinding
LiveData

使い方

frequency

Extremely high in software development; non-existent in general conversation.

よくある間違い
  • Putting UI references in the viewmodel. Expose data that the UI observes.

    References to buttons or text views in a viewmodel lead to memory leaks and make testing impossible.

  • Handling network calls directly in the viewmodel. Call a repository that handles the network call.

    The viewmodel should coordinate data, not know the details of how to fetch it from the internet.

  • Forgetting to clear observers. Use lifecycle-aware components or clear them in onCleared().

    Active observers can keep the viewmodel in memory even after it's no longer needed, wasting resources.

  • Using the viewmodel for global app state. Use a Repository or a specialized State Store.

    Viewmodels are scoped to specific screens. Using them for global data makes the app's data flow confusing.

  • Mixing business logic with presentation logic. Move business rules to a separate 'Domain' or 'Model' layer.

    Viewmodels should only care about how data is shown, not the core rules of the business.

ヒント

Keep it UI-Agnostic

Ensure your viewmodel doesn't import any UI libraries. It should only deal with data and logic, making it easy to test.

Unit Test Everything

Since viewmodels don't need a UI, write unit tests for every public method and state change to ensure stability.

Use UI State Objects

Instead of many separate variables, expose a single 'ViewState' data class. This makes the UI easier to manage and debug.

Avoid Heavy Logic

Don't do heavy processing on the main thread in a viewmodel. Use background threads or coroutines for network and DB work.

No Contexts

Never pass an Android Context into a viewmodel. If you need a context, use the 'AndroidViewModel' class which provides the Application context safely.

Single Responsibility

If a viewmodel gets too big, split it. Each viewmodel should focus on one specific part of the user's journey.

Expose Immutable Data

Expose data as 'LiveData' or 'StateFlow' so the View can't change it directly. Only the viewmodel should update its own state.

Event Handling

Use a 'SingleLiveEvent' or a Channel for one-time events like navigation or showing a snackbar to avoid repeating them on rotation.

Designer Sync

Use the viewmodel as a contract between you and the UI designer. It defines exactly what data is available for the screen.

Log State Changes

Logging every time the viewmodel state changes can help you quickly find why the UI is showing the wrong thing.

暗記しよう

記憶術

Think of 'VIEW-MODEL' as 'VIEW's MODern hELper'. It helps the View stay modern and clean by handling all the messy logic behind the scenes.

視覚的連想

Imagine a theater. The 'View' is the stage and the actors. The 'Model' is the script and the props in the back. The 'ViewModel' is the stage manager who stands in the wings, making sure the right actors go out at the right time with the right props.

Word Web

Architecture MVVM UI State Data Binding Separation of Concerns Unit Testing Lifecycle Reactive

チャレンジ

Try to explain what a viewmodel does to someone who doesn't know anything about computers, using only a kitchen metaphor. If you can do it in under 3 sentences, you truly understand the concept.

語源

The term 'ViewModel' was coined in 2005 by John Gossman, a software architect at Microsoft. It was introduced as part of the Model-View-ViewModel (MVVM) pattern, which was designed to leverage the data-binding features of the Windows Presentation Foundation (WPF). The name is a portmanteau of 'View' and 'Model,' signifying its role as a model specifically for the view.

元の意味: A model of the view; a non-visual class that represents the state and behavior of a user interface.

English (Technical/Computing)

文化的な背景

No specific sensitivities; it is a neutral technical term.

In English-speaking tech circles, 'ViewModel' is often used as a proper noun in code but a common noun in speech.

Microsoft WPF Documentation (The birthplace of the term) Google Android Architecture Components (The most popular modern implementation) Martin Fowler's 'Presentation Model' (The academic ancestor)

実生活で練習する

実際の使用場面

Mobile App Development

  • Android ViewModel lifecycle
  • SwiftUI @StateObject viewmodel
  • Shared viewmodel between fragments
  • ViewModel state management

Code Architecture Discussion

  • Separation of concerns
  • Decoupling the UI
  • Presentation logic abstraction
  • MVVM implementation

Unit Testing

  • Mocking the repository in the viewmodel
  • Testing viewmodel state changes
  • ViewModel unit test coverage
  • Headless testing of UI logic

Job Interviews

  • Experience with MVVM
  • How do you handle configuration changes?
  • Benefits of using a viewmodel
  • Managing complex UI state

Technical Documentation

  • The ViewModel class
  • Binding properties to the viewmodel
  • Exposing data via LiveData
  • ViewModel constructor parameters

会話のきっかけ

"How do you usually structure your viewmodels to avoid them becoming too large?"

"Do you prefer using a single UI state object in your viewmodel or multiple separate streams?"

"What are your thoughts on sharing a viewmodel across multiple screens in a navigation flow?"

"Have you ever encountered a situation where a viewmodel was actually overkill for a simple screen?"

"How do you handle navigation logic—do you put it in the viewmodel or use a separate component?"

日記のテーマ

Describe a time when using a viewmodel helped you solve a difficult bug related to screen state.

Write about the pros and cons of the MVVM pattern compared to other architectures you have used.

If you had to explain the concept of a viewmodel to a junior developer, what metaphors would you use?

Reflect on a project where the viewmodels became too 'fat.' How would you refactor them now?

How has the concept of the viewmodel changed your approach to building user interfaces?

よくある質問

10 問

The main purpose is to separate the UI logic from the UI layout. This makes the code cleaner, easier to maintain, and significantly easier to test because the logic is not tied to a specific screen implementation.

No, it should never hold a reference to a View or a Context. Doing so can cause memory leaks because the viewmodel often lives longer than the View. Instead, the View should observe the viewmodel.

In frameworks like Android, the system keeps the viewmodel in memory while the Activity is destroyed and recreated. When the new Activity starts, it reconnects to the existing viewmodel.

Generally, no. Business logic (like calculating a loan interest rate) should be in the Model or a Domain layer. The viewmodel should only handle presentation logic (like formatting that interest rate as a percentage string).

Usually, yes. However, for very complex screens, you might break it down into multiple viewmodels, or use a shared viewmodel if multiple screens need to access the same data flow.

A Presenter (in MVP) usually has a direct reference to the View through an interface. A ViewModel (in MVVM) does not know about the View and instead exposes data that the View binds to.

If the screen has no logic and the data never changes, a viewmodel might be overkill. However, using one consistently can help maintain a standard architecture across your app.

Most frameworks use a 'Factory' pattern or Dependency Injection (like Hilt or Koin) to provide parameters to a viewmodel when it is created.

Yes, this is common in 'Master-Detail' flows where a list and a detail screen share the same data. This is called a Shared ViewModel.

It is cleared when the scope it is attached to is permanently destroyed, such as when a user closes the app or finishes an activity (not just a rotation).

自分をテスト 200 問

writing

Explain the difference between a Model and a ViewModel in your own words.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Describe a scenario where a ViewModel would be essential for a mobile app.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Write a short paragraph explaining why ViewModels are beneficial for unit testing.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

List three things that should never be included in a ViewModel.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Explain the concept of 'Separation of Concerns' in the context of MVVM.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

How does a ViewModel help manage the state of a complex form?

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Describe the lifecycle of a ViewModel in an Android application.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

What is a 'Shared ViewModel' and when should you use it?

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Compare the ViewModel pattern to the MVC pattern.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Write a sample code description for a ViewModel that handles a login button click.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Why is it important for a ViewModel to be 'UI-agnostic'?

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Explain the role of 'onCleared' in resource management.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

How would you refactor a 'Fat ViewModel' into smaller components?

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Describe the relationship between a ViewModel and a Repository.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

What are the disadvantages of using a ViewModel for very simple screens?

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Explain how data binding simplifies the interaction between a View and a ViewModel.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

What is the 'Single Source of Truth' principle and how does it apply to ViewModels?

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

How do you handle navigation events from a ViewModel without violating architectural principles?

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Describe the historical origin of the ViewModel term.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
writing

Write a mnemonic to help a beginner remember what a ViewModel does.

Well written! Good try! Check the sample answer below.

正解! おしい! 正解:
speaking

Explain the role of a ViewModel in a stand-up meeting.

Read this aloud:

正解! おしい! 正解:
speaking

Describe how a ViewModel handles a user login attempt.

Read this aloud:

正解! おしい! 正解:
speaking

Discuss the pros and cons of using a Shared ViewModel.

Read this aloud:

正解! おしい! 正解:
speaking

Explain the concept of 'UI State' to a teammate.

Read this aloud:

正解! おしい! 正解:
speaking

How would you explain a ViewModel to a non-technical client?

Read this aloud:

正解! おしい! 正解:
speaking

Talk about a time you had to refactor a large ViewModel.

Read this aloud:

正解! おしい! 正解:
speaking

Explain why ViewModels shouldn't have references to Views.

Read this aloud:

正解! おしい! 正解:
speaking

Describe the benefits of MVVM over MVC in a technical interview.

Read this aloud:

正解! おしい! 正解:
speaking

Discuss how ViewModels improve the testability of an app.

Read this aloud:

正解! おしい! 正解:
speaking

Explain the lifecycle of a ViewModel to a junior developer.

Read this aloud:

正解! おしい! 正解:
speaking

How do you handle error states in your ViewModels?

Read this aloud:

正解! おしい! 正解:
speaking

Describe the process of data binding between a View and a ViewModel.

Read this aloud:

正解! おしい! 正解:
speaking

What are your favorite tools for ViewModel dependency injection?

Read this aloud:

正解! おしい! 正解:
speaking

Explain the 'Single Source of Truth' concept using a ViewModel example.

Read this aloud:

正解! おしい! 正解:
speaking

Discuss the impact of the ViewModel pattern on app performance.

Read this aloud:

正解! おしい! 正解:
speaking

How do you keep your ViewModels 'skinny'?

Read this aloud:

正解! おしい! 正解:
speaking

Explain the difference between a ViewModel and a State Holder.

Read this aloud:

正解! おしい! 正解:
speaking

Describe how a ViewModel survives a configuration change.

Read this aloud:

正解! おしい! 正解:
speaking

Talk about the importance of immutability in ViewModel state.

Read this aloud:

正解! おしい! 正解:
speaking

Explain the 'onCleared' method and why it's necessary.

Read this aloud:

正解! おしい! 正解:
listening

Listen to a description of a software bug. Is the bug in the View or the ViewModel?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a developer's stand-up update. What is their main task regarding the ViewModel?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a technical talk about MVVM. What are the three components mentioned?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a code review comment. What is the reviewer's concern about the ViewModel?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to an explanation of data binding. How does the ViewModel update the UI?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a discussion about unit testing. Why is the ViewModel mentioned?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a comparison of architectural patterns. What is the main advantage of the ViewModel?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a tutorial on Android development. How do you instantiate a ViewModel?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a senior developer explain Clean Architecture. Where does the ViewModel fit in?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a conversation about memory leaks. How can a ViewModel cause one?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a podcast about the history of tech. Who invented the ViewModel pattern?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a bug report. Does the user mention a UI issue or a logic issue in the ViewModel?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a team lead discussing refactoring. What is their plan for the 'Fat ViewModel'?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to an explanation of SwiftUI. What is the role of the @Published property in a ViewModel?

正解! おしい! 正解:
正解! おしい! 正解:
listening

Listen to a student asking a question about ViewModels. What is their main confusion?

正解! おしい! 正解:
正解! おしい! 正解:

/ 200 correct

Perfect score!

関連コンテンツ

Technologyの関連語

abautoal

C1

さまざまなデータ構造または言語単位の自動的な整合と統合のための体系的な方法論または技術フレームワークであり、手動介入なしで同期を保証します。

abautoence

C1

自己管理メカニズムまたは自律ルーチンを通じてプロセスを体系的に自動化または合理化すること。効率を最大化し、認知負荷を軽減するために、手動タスクをバックグラウンドの技術的または習慣的なシステムに委任する行為を指します。

ablogtion

C1

ablogtionとは、オンライン上の評判を管理するために、プラットフォームからデジタル記録や時系列のログエントリを体系的に削除、消去、またはスクラブすることを意味します。

abmanless

C1

完全な自動化を通じて、システムから手動の人間による介入の必要性を取り除くこと。

activation

B2

アクティベーション(有効化)とは、装置やソフトウェアを使える状態にすることです。例えば、新しいスマホの初期設定などです。

actuator

B2

アクチュエータは、電気や空気のエネルギーを物理的な動きに変える機械部品です。

adpaterable

C1

システムやデバイスをアダプターに対応できるように改造または設定すること。

adpaterward

C1

アダプターワード(adapterward)とは、初期組み立て後に技術システムに統合される二次的な調整または補足コンポーネントであり、新しい規格との互換性を確保します。これは、レガシー部分と最新部分との間の後期同期を容易にする物理的またはデジタルの「ブリッジ」を具体的に指します。

aerospace

B2

地球の大気圏内または宇宙空間を飛行する航空機や宇宙船の設計、製造、運用に関連するもの。

algorithms

B2

アルゴリズムとは、ある特定の問題を解くための、段階的な手順や計算方法のことです。

役に立った?
まだコメントがありません。最初に考えをシェアしましょう!