Sobes.tech
Middle+

Tell about the resource manipulation principle through representations.

sobes.tech AI

Answer from AI

Resource manipulation through views (View Manipulation) is an approach where data changes do not occur directly with the original resource (such as a file or a database object), but through its abstraction or view.

Main principles:

  • Isolation: Changes made to the view can be isolated from the original resource until explicitly saved or committed. This allows rolling back changes or creating alternative versions without affecting the original.
  • Flexibility: A view may show not all data of the original resource, but only a subset or aggregated data. Manipulating the view allows working only with the necessary part of the information.
  • Security: Access to the view can be restricted, allowing modifications only to permitted fields or performing only specific operations, while direct access to the original resource is prohibited.
  • Abstraction: The view hides the internal structure of the original resource, providing a more convenient and understandable interface for interaction.

Examples of usage:

  1. Databases (SQL Views): Virtual tables based on the result of a SELECT query. Changes through the view can (depending on the complexity of the view) affect the underlying tables, but the manipulation process itself goes through the abstraction.
  2. Operating Systems (Mounting File Systems): File systems are mounted at specific points, creating a logical view of the data stored on the device.
  3. Version Control (Branching in Git): Branches in Git are views of the repository state at a specific point in time. Manipulations (commits) are applied to the current branch (view) without directly affecting other branches.
  4. Object-Relational Mapping (ORM): ORM creates views of database data as code objects. Manipulations with objects (changing properties, calling methods) are translated into database operations.

During testing, it is important to ensure that:

  • Changes through the view are correctly reflected on the original resource (if this is the expected behavior).
  • Changes made directly to the original resource are correctly displayed in the view.
  • Restrictions and rules defined for the view are followed (for example, the impossibility to change a certain field).
  • Performance of manipulation through views is acceptable.

This allows testing the system's interaction with data without always having direct access to their low-level representation.