THE APP DEVELOPMENT FRAMEWORK OF MAGENTO

The Magento app development framework manages the interaction of application components containing request flow, routing, indexing, caching, and exception handling. This framework can provide services reducing the effort of creating modules include business logic, contributing to make Magento code more modular and decrease dependencies.

The Magento app development framework manages the interaction of application components containing request flow, routing, indexing, caching, and exception handling. This framework can provide services reducing the effort of creating modules include business logic, contributing to make Magento code more modular and decrease dependencies.

 The logical groups named “libraries” included primary PHP software components. Most of the framework code sits under the domain layer or encloses the presentation, service, and domain layers. Normally, the framework contains no business logic. (This framework does not possess resource models but it does have a library of code to implement a resource model.)

Modifying app development framework files is unnecessary. If you are extending Magento, you just need to call Framework libraries. Modules you create will typically inherit from classes and interfaces defined in the Framework directories. 

Next up, we will introduce to you about responsibilities, operations and highlights of the Magento app development framework.

Responsibilities

 The libraries supplied by the Magento framework will reduce your effort in creating modules including business logic.

 The operations (responsible by the framework) are useful for potentially all modules, concluding: 

  • handling HTTP protocols
  • interacting with the database and filesystem
  • rendering content

Organization

Here is the Magento App Development Framework folder structure:

vendor/

    ../magento

        ../framework

lib/

    ../internal

        ../LinLibertineFont

    ../web

  • /vendor/magento/framework includes only PHP code. These are libraries of code plus the application entry point that routes requests to modules (that in turn call the Framework libraries). For instance, libraries in the Framework help implement a resource model (base classes and interfaces to inherit from) but not the resource models themselves. While certain libraries also support CSS rendering.
  • /lib/internal contains some non-PHP as well as PHP components. Besides, Non-PHP framework libraries includes JavaScript and LESS/CSS.
  • /lib/web contains JavaScript and CSS/LESS files which reside under web and not internal because they are accessible from a web browser, while the PHP code under internal is not. (Any code that a web browser must access should be under web, while everything else under internal.)
  • The vendor/magento/framework directory maps to the Magento\Framework namespace.

Highlights of Magento Framework

  • The Magento structure (lib/internal/Magento/Framework/) provides a robust range of functionality.  Perhaps, extension developers may be interested in this subset of Framework namespaces.

Namespace Purpose
Magento\Framework\DataObject Standard functionality for storing and retrieving data, which is the base class for many Magento classes.
Magento\Framework\Model Base Model classes that almost all Magento Model classes extend from.
Magento\Framework\Model\AbstractModel  
Magento\Framework\Model\ResourceModel\AbstractResource  
Magento\Framework\Controller Classes to help return different types of results (for example, redirects).
Magento\Framework\View Code to render pages and layouts.
Magento\Framework\Data Additional classes that handle forms.
Magento\Framework\Url Code to look up other pages in Magento.

 

  • Other namespaces under Magento\Framework that will interest extension developers:

Namespace Purpose
Magento\Framework\ObjectManager Provide dependency injection.
Magento\Framework\App Framework code of the Magento application. Functions of this code: bootstraps the application, reads in initial configuration, contains the entry point to the command line tools/the web application/the cron job,routes requests, provides the deployment context.
Magento\Framework\Api Base classes for advanced functionality of extendable objects through the system (Add new data through Magento Marketplace extensions to extend objects).
Magento\Framework\Config The generic configuration reader file which has its own specialized reader extending these classes.
Magento\Framework\Filesystem Classes that handle reading from and writing to the file system.
Magento\Framework\HTTP\PhpEnvironment  
Magento\Framework\Session  
Magento\Framework\Stdlib\Cookie Code to handle the HTTP request/responses with session/cookies is found here.
Magento\Framework\Exception The basic exceptions that are thrown via the Magento codebase.
Magento\Framework\Event Code which publishes synchronous events that handles observers for any Magento event is handled here.
Magento\Framework\Validator Code that validates data (currencies, not empty) and handles observers for any Magento event.

Bài viết liên quan

tip-for-android-app-development

9 BEST TIPS FOR ANDROID APP DEVELOPMENT

Users are the main criteria that decide an app’s survival. So what can the developers do to ensure that the users approve an app? Let us discuss some interesting and simple tips for android app development process to provide an appealing user experience.

Đọc thêm
tips to market android app

6 TIPS TO MARKET A NEWLY BUILT ANDROID APP

Nowadays, mobile phones are vital to our lives. And to serve our needs, there are tons of mobile apps on the market, which means it’s harder than ever to promote a new app. However, you can prepare for yourself 6 tips to market a newly-build Android app in this article.

Đọc thêm
 
Join us