Tag Archives: Magento

Singleton Pattern

An object is a singleton if the application can include one and only one of that object at a time.

The Singleton Pattern is one of the GoF (Gang of Four) Patterns. This particular pattern provides a method for limiting the number of instances of an object to just one. It’s an easy pattern to grasp once you get past the strange syntax used.

It ensure a class has only one instance and provide a global point of access to it.

It achieves this by only creating a new instance the first time it is referenced, and thereafter it simply returns the handle to the existing instance.

Factory Pattern

The factory pattern is a class that has some methods that create objects for you. Instead of using new directly, you use the factory class to create objects. That way, if you want to change the types of objects created, you can change just the factory. All the code that uses the factory changes automatically.

It refers to the newly created object through a common interface

When developing larger, more complex systems though, object creation can become difficult. There are situations where different objects may need to be created based on different conditions or based on the context of the object creating it. Creating objects of concrete types explicitly in code can make these situations a nightmare when it comes time to make revisions and additions. When a new class is introduced, you get to follow a trail of code and commence the hours of debugging that will inevitably follow such an endeavor.

The Factory Method pattern defines an interface for object creation but defers the actual instantiation to subclasses.

Magento

Magento is an e-commerce platform created on open source technology, which provides online merchants with an exceptional flexibility and control over the content, look and functionality of their e-commerce store.

Magento is an open-source content management system for e-commerce web sites. The software was originally developed by Varien Inc., a US private company headquartered in Culver City, California, with assistance from volunteers.

Varien published the first general-availability release of the software on March 31, 2008, under the name Bento. Roy Rubin, former CEO of Varien, later sold a substantial share of the company to eBay, which is now the sole owner.

According to research conducted by aheadWorks in October 2014, Magento’s market share among the 30 most popular e-commerce platforms is about 30%.

Magento employs the MySQL relational database management system, the PHP programming language, and elements of the Zend Framework. It applies the conventions of object-oriented programming and model-view-controller architecture. Magento also uses the entity–attribute–value model to store data.

Simple XML

Simple XML is a variation of XML containing only elements. All attributes are converted into elements. Not having attributes or other xml elements such as the XML declaration / DTDs allows the use of simple and fast parsers. This format is also compatible with mainstream XML parsers.

PDO

The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP.

Features

  • Supports 12 different databases
  • Object Mapping
  • Supports prepared statements
  • Supports multiple statements
  • Object oriented interface
  • Named parameters
  • PDO has built-in support for Large Objects (LOBs).
  • When something goes wrong, PDO can throw an instance of its own exception class.
  • PDO does not emulate missing database features.
  • Placeholders within PDO prepared statements need not be named.

pcre

Perl Compatible Regular Expressions (PCRE) is a regular expression C library inspired by Perl’s external interface, written by Philip Hazel. PCRE’s syntax is much more powerful and flexible than either of the POSIX regular expression flavors and many classic regular expression libraries. The name is misleading, because PCRE is Perl-compatible only if you consider a subset of PCRE’s settings and a subset of Perl’s regular expression facilities.

The PCRE library is incorporated into a number of prominent open-source programs, such as the Apache HTTP Server and the PHP and R scripting languages; and can be incorporated in proprietary software too (BSD license). As of Perl 5.10, PCRE is also available as a replacement for Perl’s default regular expression engine through the re::engine::PCRE module.

mcrypt

mcrypt is a replacement for the popular UNIX crypt command. crypt was a file encryption tool that used an algorithm very close to the World War II enigma cipher, which was broken. Mcrypt provides the same functionality but uses several modern algorithms such as AES. Libmcrypt, Mcrypt’s companion, is a library of code which contains the actual encryption functions and provides an easy method for use.

iconv

iconv is a computer program and a standardized API used to convert between different character encodings.

The iconv API is the standard programming interface for converting character strings from one character encoding to another in Unix-like operating systems. Initially appearing on the HP-UX operating system, it was standardized within XPG4 and is part of the Single UNIX Specification (SUS).

 

Hash

A hash function is any algorithm or subroutine that maps large data sets, called keys, to smaller data sets. For example, a single integer can serve as an index to an array (cf. associative array). The values returned by a hash function are called hash values, hash codes, hash sums, checksums or simply hashes.

Hash functions are mostly used to accelerate table lookup or data comparison tasks such as finding items in a database, detecting duplicated or similar records in a large file, finding similar stretches in DNA sequences, and so on.