GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

1.1 Describe Magento’s module-based architecture

Aleksey Golota Digital Technologies Englisch 26 Karten

Karten in diesem Stapel (26)

  1. 1What is advantages of layered application design?Stringent separation of business logic from presentation logic simplifies the customization process.
    Clear organization of code predictably points extension developers to code location
  2. 2What is Magento Domain layer?The domain layer holds the business logic layer of a Magento module.
    Best practice: Use service contracts to communicate with the domain layer by passing data types through strongly typed objects.
    Each domain-layer model contains a reference to a resource model, which it uses to retrieve data from the database with MySql calls. This resource model contains logic for connecting to the underlying database, typically MySQL. A model requires a resource model only if the model data must persist.
  3. 3What is magento Daomain layer functions?1. Defining the generic Magento data objects, or models, that contain business logic.
    2. (Optionally) Including the implementation of service contracts, although not their definition
  4. 4Which files needs to bootstrap a module?registration.php,
    etc/module.xml
    composer.json
  5. 5Which required files to initiate a module ?registration.php,
    etc/module.xml
  6. 6How much areas in M2?adminhtml, frontend, base, webapi_rest, webapi_soap and cron.
    Not all areas are always available. For instance, the cron area is only used when running cron jobs.
  7. 7Accessing the domain layer1. Service contracts are the recommended way for one module to access another module’s domain-level code. This loosely coupled solution is the optimal way for most modules to access another module.
    2. A module can directly call into another module. This tightly coupled solution is not recommended for most situations, but is sometimes unavoidable.
    3. Domain layer code in one module can also plug itself into another module by event hooks, plugins, di.xml files (with an SPI contract)
  8. 8registration.phpis included by the Composer autoloader (app/etc/NonComposerComponentRegistration.php). adds the component to the static list of components in module registry \Magento\Framework\Component\ComponentRegistrar.
  9. 9etc/module.xmlspecifies the setup version and loading sequence for the module.
  10. 10module limitationsMagento 2 modules are to be completely contained within the module’s directory. All customizations and
    extensions are made within that folder.
  11. 11Which type of components exists in M2?Module
    Library
    Theme
    Language
  12. 12When model requires resource model?Only if the model data mut persist
  13. 13What responsibility of resource models?Executing all CRUD (create, read, update, delete) requests. The resource model contains the SQL code for completing these requests
    Performing additional business logic. For example, a resource model could perform data validation, start processes before or after data is saved, or perform other database operations.
    A simple resource model defines and interacts with a single table.
  14. 14Which pattern use Magento for persistence layerActive Record. In this system, the model object contains a resource model that maps an object to one or more database rows
  15. 15What is contain presentation layerThe presentation layer contains both view elements (layouts, blocks, templates) and controllers
  16. 16How Presentation code calls other layersPresentation code typically calls service contracts, particularly for a storefront. However, presentation code is occasionally dependent on a specific implementation that requires the presentation code to directly call the domain layer.
  17. 17What is a Service layer?The service layer provides a bridge between the presentation layer and the domain layer and resource-specific data. This is implemented using service contracts, which are defined using PHP interfaces.
  18. 18Service contract clients are?1. Controllers (initiated by actions of users of the storefront)
    2. Web services (SOAP and REST API calls)
    3. Other Magento modules through service contracts
  19. 19Who accesses the service layer?All calls from web service interfaces, or users working with your storefront (that is, controller-initiated requests), are typically routed through the service layer.
    External applications can make requests for business logic with simple SOAP and REST calls.
  20. 20What is a Magento module?A module is a logical group – that is, a directory containing blocks, controllers, helpers, models – that are related to a specific business feature.
  21. 21Module locationslive in the vendor in a directory with the following PSR-0 compliant format: vendor//-
    where can be one of the following values:
    module - for modules (module-customer-import-export)
    theme - for frontend and admin themes (theme-frontend-luma or theme-adminhtml-backend)
    language - for language packs (language-de_de)
    app/code//-
  22. 22What is areaAn area is a logical component that organizes code for optimized request processing.
  23. 23Magento area typesMagento Admin (adminhtml): entry point for this area is index.php or pub/index.php. The Admin panel area includes the code needed for store management. The /app/design/adminhtml directory contains all the code for components you’ll see while working in the Admin panel.
    Storefront (frontend): entry point for this area is index.php or pub/index.php. The storefront (or frontend) contains template and layout files that define the appearance of your storefront.
    Basic (base): used as a fallback for files absent in adminhtml and frontend areas.
    Cron (crontab): In cron.php, the \Magento\Framework\App\Cron class always loads the ‘crontab’ area.
    Web API REST (webapi_rest): entry point for this area is index.php or pub/index.php. The REST area has a front controller that understands how to do URL lookups for REST-based URLs.
    Web API SOAP (webapi_soap): entry point for this area is index.php or pub/index.php.
  24. 24Module/area interaction guidelinesModules should not depend on other modules’ areas.
    Disabling an area does not result in disabling the modules related to it.
    Areas are registered in the Dependency Injection framework di.xml file.
  25. 25registration.php load flowpub/index.php -> app/bootstrap.php -> app/autoload.php -> vendor/autoload.php -> vendor/module[]/registration.php
  26. 26What side effects can come from modules interaction?error when module is missing or disabled
    error when injecting missing class
    (?) null or error when using object manager for missing class ReflectionException - Class MissingClass does not exist objectManager->create() = new $type() or new $type(...args) --> PHP Warning: Uncaught Error: Class 'MissingClass' not found

Informationen

Beschreibung
Digital Technologies Karteikarten am 1.1 Describe Magento’s module-based architecture, erstellt von Aleksey Golota am 14/08/2019.
Erstellt von
Aleksey Golota
Aufrufe
123
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck