Wednesday, February 16, 2022

Type or Category or Classification of Design Patterns

 Type or Category or Classification of Design Patterns

Creational  Based on the concept of creating an object.
    Class
      Factory MethodThis makes an instance of several derived classes based on interfaced data or events.
    Object
      Abstract FactoryCreates an instance of several families of classes without detailing concrete classes.
      BuilderSeparates object construction from its representation, always creates the same type of object.
      PrototypeA fully initialized instance used for copying or cloning.
      SingletonA class with only a single instance with global access points.
        
  Structural  Based on the idea of building blocks of objects.
    Class
      AdapterMatch interfaces of different classes therefore classes can work together despite incompatible interfaces.
    Object
      AdapterMatch interfaces of different classes therefore classes can work together despite incompatible interfaces.
      BridgeSeparates an object's interface from its implementation so the two can vary independently.
      CompositeA structure of simple and composite objects which makes the total object more than just the sum of its parts.
      DecoratorDynamically add alternate processing to objects.
      FacadeA single class that hides the complexity of an entire subsystem.
      FlyweightA fine-grained instance used for efficient sharing of information that is contained elsewhere.
      ProxyA place holder object representing the true object.
 
  Behavioral  Based on the way objects play and work together.
    Class
      InterpreterA way to include language elements in an application to match the grammar of the intended language.
      Template
       Method
Creates the shell of an algorithm in a method, then defer the exact steps to a subclass.
    Object
      Chain of
      Responsibility
A way of passing a request between a chain of objects to find the object that can handle the request.
      CommandEncapsulate a command request as an object to enable, logging and/or queuing of requests, and provides error-handling for unhandled requests.
      IteratorSequentially access the elements of a collection without knowing the inner workings of the collection.
      MediatorDefines simplified communication between classes to prevent a group of classes from referring explicitly to each other.
      MementoCapture an object's internal state to be able to restore it later.
      ObserverA way of notifying change to a number of classes to ensure consistency between the classes.
      StateAlter an object's behavior when its state changes.
      StrategyEncapsulates an algorithm inside a class separating the selection from the implementation.
      VisitorAdds a new operation to a class without changing the class.

 

Difference between webstorage, cookie, local storage & session storage

WebStorage

The Window object implements the WindowLocalStorage and WindowSessionStorage objects which has localStorage(window.localStorage) and sessionStorage(window.sessionStorage) properties respectively. These properties create an instance of the Storage object, through which data items can be set, retrieved and removed for a specific domain and storage type (session or local). For example, you can read and write on local storage objects as below

localStorage.setItem('logo', document.getElementById('logo').value);

localStorage.getItem('logo');

What are the differences between cookie, local storage and session storage

Below are some of the differences between cookie, local storage and session storage,

FeatureCookieLocal storageSession storage
Accessed on client or server sideBoth server-side & client-sideclient-side onlyclient-side only
LifetimeAs configured using Expires optionuntil deleteduntil tab is closed
SSL supportSupportedNot supportedNot supported
Maximum data size4KB5 MB5MB

Wednesday, February 2, 2022

Cloud Computing basics

SaaS - Software as a Service

is on-demand access to ready-to-use, cloud-hosted application software.

E.g. Google Docs, Google Form, Google Spreadsheet. 


PaaS - Platform as a Service

is on-demand access to a complete, ready-to-use, cloud-hosted platform for developing, running, maintaining, and managing applications.

E.g. Amazon EC2 T2 Micro instances 1 GB memory & 1 vCPU under free tier, Microsoft Azure


IaaS - Infrastructure as a Service

The service provides all of the infrastructures to the business. It provides on-demand access to cloud-hosted physical and virtual servers, storage, and networking - the backend IT infrastructure for running applications and workloads in the cloud.

E.g. host.com that provides dedicated servers to organizations. VMware offers support for IaaS for carving out a system rack, network storage & computer into an isolated system for customers.


StaaS - Storage as a Service

E.g. Carbonite, Amazon S3

Storage as a service (STaaS) is a data storage business model where a provider rents storage resources to a customer through a subscription. STaaS saves you money through operating expenditure (OpEx) agility—you only pay for the storage you need, when you need it.

Private & Public Cloud

Amazon AWS is the poor man's public cloud due to its inexpensive pricing model & is the biggest provider.

HPE/Microsoft are mostly used by Enterprise companies as they hold their server on their enterprise public cloud data center are more responsive to their requests & allow them to perform service testing & site maintenance with escort service. 

GoDaddy - Cheaper public cloud-based hosting solutions though not as customizable as Amazon AWS. 

Critical custom data & sensitive IP, in-house information are kept in a Private cloud & the public-facing web server & catalog information is stored in the Public cloud (e.g. Akamai).

To offer more resilient services load balancing with VM on multiple cloud providers is a hot research topic.








Featured

TechBytes on Linux

This is a growing list of Linux commands which might come handy for the of Linux users. 1. Found out i had to set the date like this: ...

Popular Posts