Magento Products

Last updated on Nov 10 2022
Prabhas Ramanathan

In this blog, we are going to discuss the architecture of Magento 2. Magento 2 has a totally different architecture than Magento 1. Its architecture is designed with the objective of making the source code as an extensive and modularized as possible. The main purpose of this approach is to allow it to be easily adapted and customized according to the need of the project. Every business logic and functionality are designed in the form of modules. So, every module can work as a standalone unit.
Magento 2 has a Model View ViewModel (MVVM) architecture. This MVVM architecture provides much more robust separation between the Model and View layer, as it is closely related to the Model View Controller (MVC). The brief description of MVVC is given below:

ma 6

Model: It holds the business logic of the application, and depends on an associated class – Resource Model for database access. Similar to the MVC, it is the logic of data management and description of the fundamental data which is necessary for the operation of the application. The model responds to the request coming from the view.
View: The view is a graphical interface that the users see on the screen. It is responsible for displaying the respond for the user request. The view is a structure or a layout, which represents the data in a particular format. Views specify that “how your data looks like”. It is a subscriber for the changes of the property values or commands provided by the ViewModel.
ViewModel: The ViewModel interacts with the Model layer and exposes only necessary information to the View layer. This is handled by module’s Block classes in Magento 2. An important thing to notice that this was usually part of the Controller role of an MVC system. In MVVM, the Controller is only responsible for handling the user flow means it receives requests and either tell the system to render a view or to redirect the user to another route.
It contains a Model which is converted to a View and also contains the commands that can be used to affect the Model. The ViewModel is basically an abstraction of the view exposing public properties and commands.
Magento 2 is split into four layers, according to the official documentation.
o Presentation Layer
o Service Layer
o Domain Layer
o Persistence Layer

ma 7

The detailed description of Magento 2’s layer architecture is given below.

Table of Contents

1) Presentation Layer

The presentation layer is the uppermost layer of Magento 2 architecture. When we interact with the web interface of Magento, that time, we are interacting with the presentation layer code. It contains all controllers and View elements such as – layouts, templates, block, and css.js, etc. The presentation layer calls the service layer using service contracts, usually. It can overlap business logic.
Web users, system administrators, are the user of the presentation layer

2) Service Layer

The service layer is the middle layer among the presentation layer and domain layer. It provides a bridge between the presentation and domain layer and resource-specific data. The service layer implements service contracts, which are defined using the PHP interface. These service contracts allow us to add or change the business logic resource model without breaking the system. This is done using the dependency injection configuration file (di.xml).
The service layer grants access to API (REST/SOAP or other modules). It resides above the domain layer and below the presentation layer.

3) Domain Layer

The domain layer is responsible for business logic. It does not contain database-specific or resource-specific information. The domain layer defines the generic Magento data objects or models which contain business logic. This logic describes that which operation can be performed on the particular types of data, such as Customer object.
To retrieve the data from the database with the MySQL calls, each domain-layer model has a reference to a resource model.

4) Persistence Layer

It describes the resource model, which is responsible for data extraction and modification in the database using the CRUD (Create, Read, Update, and DELETE) requests. For completing these requests, the resource model contains the SQL code. Additional business logic capabilities are also implemented.
For example – database functions implementation and data validation.

Magento – Product Overview

Magento Products

Products are the items or things that are sold in Magento. Product can be anything that is capable of satisfying the customer’s needs. This includes both physical products and services.

Product Types

Magento provides 6 different types of products. Appropriate selection of product type is essential for accessing the appropriate set of features required to sell the product. Following are the product types available in Magento.

• Simple Products
• Grouped Products
• Configurable Products
• Virtual Products
• Bundled Products
• Downloadable Products

Simple Products

These are general product type, which are the most used products. In this section, there are no options for selecting size or color of the product.

Example − Coffee cup, DVD’s, Camera lens, etc.

Grouped Products

This is a group of simple products. In this type, you cannot specify a specific price for a product; you can just specify the discount.

Example − Cell phone + Memory card + Ear phone

Configurable Products

In this type, customer can select products according to their color and size before purchasing.

Example − Cell phones obtained in different colors and sizes.

Virtual Products

Virtual products are those which do not have physical counterpart, i.e. these are used for virtual items. These products cannot be shipped or stocked.

Example − Online training course

Bundled Products

Bundled products are those products which cannot be sold separately and doesn’t give any choice to the end user.

Example − Consider you want to buy a cell phone which includes earphone, memory card, battery, charging cable, etc. These are together called bundled products. These products cannot be sold individually but can be sold within the bundle product.

Downloadable Products

Products which are available for download are known as downloadable products.

Example − MP3 file, ebook, documents, etc.

Product Attributes

Attribute describes the property of the product. Product attributes helps to set product properties such as color, size width, height, etc. and makes the product unique. You can add as many attributes to your product as required.
The following steps describe, how to set up the attributes for products in Magento −
Step 1 − Login to your Magento Admin Panel.
Step 2 − Go to Catalog and select Attributes from the dropdown menu and click on the Manage Attributes option.

ma 8

Step 3 − Under Manage Attributes section, you will find different attributes used in the system. For adding new attribute, click on Add New Attribute seen on the top right corner of the screen.

ma 9

Step 4 − Now you need to set the attribute properties for your product. After setting up all the required attribute properties, click on Save Attribute button to store the product information.

ma 10

So, this brings us to the end of blog. This Tecklearn ‘Architecture of Magento 2 and Product Overview’ blog helps you with commonly asked questions if you are looking out for a job in Magento Programming. If you wish to learn Java and build a career Java Programming domain, then check out our interactive, Java and JEE Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

Java and JEE Training

Java and JEE Training

About the Course

Java and JEE Certification Training is designed by professionals as per the industrial requirements and demands. This training encompasses comprehensive knowledge on basic and advanced concepts of core Java & J2EE along with popular frameworks like Hibernate, Spring & SOA. In this course, you will gain expertise in concepts like Java Array, Java OOPs, Java Function, Java Loops, Java Collections, Java Thread, Java Servlet, and Web Services using industry use-cases and this will help you to become a certified Java expert.

Why Should you take Java and JEE Training?

• Java developers are in great demand in the job market. With average pay going between $90,000/- to $120,000/- depending on your experience and the employers.
• Used by more than 10 Million developers worldwide to develop applications for 15 Billion devices.
• Java is one of the most popular programming languages in the software world. Rated #1 in TIOBE Popular programming languages index (15th Consecutive Year)

What you will Learn in this Course?

Introduction to Java

• Java Fundamentals
• Introduction to Java Basics
• Features of Java
• Various components of Java language
• Benefits of Java over other programming languages
• Key Benefits of Java

Installation and IDE’s for Java Programming Language

• Installation of Java
• Setting up of Eclipse IDE
• Components of Java Program
• Editors and IDEs used for Java Programming
• Writing a Simple Java Program

Data Handling and Functions

• Data types, Operations, Compilation process, Class files, Loops, Conditions
• Using Loop Constructs
• Arrays- Single Dimensional and Multi-Dimensional
• Functions
• Functions with Arguments

OOPS in Java: Concept of Object Orientation

• Object Oriented Programming in Java
• Implement classes and objects in Java
• Create Class Constructors
• Overload Constructors
• Inheritance
• Inherit Classes and create sub-classes
• Implement abstract classes and methods
• Use static keyword
• Implement Interfaces and use it

Polymorphism, Packages and String Handling

• Concept of Static and Run time Polymorphism
• Function Overloading
• String Handling –String Class
• Java Packages

Exception Handling and Multi-Threading

• Exception handling
• Various Types of Exception Handling
• Introduction to multi-threading in Java
• Extending the thread class
• Synchronizing the thread

File Handling in Java

• Input Output Streams
• Java.io Package
• File Handling in Java

Java Collections

• Wrapper Classes and Inner Classes: Integer, Character, Boolean, Float etc
• Applet Programs: How to write UI programs with Applet, Java.lang, Java.io, Java.util
• Collections: ArrayList, Vector, HashSet, TreeSet, HashMap, HashTable

Java Database Connectivity (JDBC)

• Introduction to SQL: Connect, Insert, Update, Delete, Select
• Introduction to JDBC and Architecture of JDBC
• Insert/Update/Delete/Select Operations using JDBC
• Batch Processing Transaction
• Management: Commit and Rollback

Java Enterprise Edition – Servlets

• Introduction to J2EE
• Client Server architecture
• URL, Port Number, Request, Response
• Need for servlets
• Servlet fundamentals
• Setting up a web project in Eclipse
• Configuring and running the web app with servlets
• GET and POST request in web application with demo
• Servlet lifecycle
• Servlets Continued
• Session tracking and filter
• Forward and include Servlet request dispatchers

Java Server Pages (JSP)

• Fundamentals of Java Server Page
• Writing a code using JSP
• The architecture of JSP
• JSP Continued
• JSP elements: Scriptlets, expressions, declaration
• JSP standard actions
• JSP directives
• Introduction to JavaBeans
• ServletConfig and ServletContext
• Servlet Chaining
• Cookies Management
• Session Management

Hibernate

• Introduction to Hibernate
• Introduction to ORM
• ORM features
• Hibernate as an ORM framework
• Hibernate features
• Setting up a project with Hibernate framework
• Basic APIs needed to do CRUD operations with Hibernate
• Hibernate Architecture

POJO (Plain Old Java Object)

• POJO (Plain Old Java Object)
• Persistent Objects
• Lifecycle of Persistent Object

Spring

• Introduction to Spring
• Spring Fundamentals
• Advanced Spring

Got a question for us? Please mention it in the comments section and we will get back to you.

 

0 responses on "Magento Products"

Leave a Message

Your email address will not be published. Required fields are marked *