From Passion to Profession
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use

Temporal Collection

5/25/2020

0 Comments

 

overview

A temporal collection is a simple way to implement a Temporal Property or a Temporal Object.
​

A temporal instance (either a Temporal Property or Temporal Object), when going through a series of amendments, the property itself or the properties the object references change over time. Each version of the temporal instance captures the state of the instance that will last for some period of time until the instance changes again with another amendment.​

implementation

Temporal Collection

The basic representation and interface for a temporal collection provides get and put operations that use a date as an index:
TemporalCollection Interface

    

Read More
0 Comments

Data Transfer Object Design Pattern

5/19/2020

0 Comments

 

overview

Data Transfer Object (DTO) is an object used to pass data with multiple items in one shot between client and server, to avoid client from issuing multiple calls to a remote server to get each item in separate calls.

Optionally, we can make use of a DTO Assembler class as some sort of a mapper in between DomainObject and DataTransferObject to map from one side to another in either direction. That is, to create a serializable DTO object given a Domain Object, or to update a Domain Object given a DTO object.
Picture

Read More
0 Comments

Inversion of Control / Dependency Injection Pattern

3/20/2020

0 Comments

 
People who just started to learn Spring framework is often confused by the term "Inversion of Control" (IoC) which can be achieved through "Dependency Injection" (DI).

DI is a way of providing the dependencies (e.g. creating objects and its dependencies), wiring components into application. In Spring, those objects defined and instantiated by Spring containers then inject into application are called Spring Beans.

IoC is a concept, it means to create instances of dependencies first, the concept is usually achieved by using metadata-driven approach to assemble instances at runtime. IoC is the end result of DI. However, DI is not the only way to achieve IoC. For example, Workday's XpressO is a great example of metadata-driven development to achieve IoC.

Here are some more good explanations:
Inversion of Control (IoC) means to create instances of dependencies first and latter instance of a class (optionally injecting them through constructor), instead of creating an instance of the class first and then the class instance creating instances of dependencies. Thus, inversion of control inverts the flow of control of the program. Instead of the callee controlling the flow of control (while creating dependencies), the caller controls the flow of control of the program.

​~
https://stackoverflow.com/questions/3058/what-is-inversion-of-control
IoC is a programming technique, expressed here in terms of object-oriented programming, in which object coupling is bound at run time by an assembler object and is typically not known at compile time using static analysis.

​~
http://en.wikipedia.org/wiki/Inversion_of_control
IoC is a common pattern in the Java community that helps wire lightweight containers or assemble components from different projects into a cohesive application.
~
http://www.martinfowler.com/articles/injection.html (reworded)
Spring helps in the creation of loosely coupled applications because of Dependency Injection. 

​In Spring, objects define their associations (dependencies) and do not worry about how they will get those dependencies. It is the responsibility of Spring to provide the required dependencies for creating objects.

-https://stackoverflow.com/questions/9403155/what-is-dependency-injection-and-inversion-of-control-in-spring-framework

Read More
0 Comments

Flyweight Design Pattern Principle

6/15/2016

0 Comments

 
Flyweight pattern is a structural pattern in GoF as it supports large numbers of fine-grained objects efficiently. Since each fine-grained object (e.g. a character in an editor application) may incur overhead that adds up. This pattern shares objects in a pool (Flyweight Factory) to minimize memory use.
Picture
source: GoF

Read More
0 Comments

Composite and Prototype Design Pattern Example

4/21/2016

0 Comments

 
In a Composite (or Decorator) structure, Prototype uses a prototypical instance to create new Composite Component. Composite is a structural pattern where as Prototype is creational pattern. They are related to each other in a sense that Prototype only make sense in the context of a structural pattern like Composite or Decorator.
Picture
Composite (source: GoF)
Picture
Prototype source: GoF

Read More
0 Comments

Command Design Pattern Example

4/14/2016

0 Comments

 
Command pattern is a behavioral pattern in GoF as it allows us to decouple between the Invoker (a.k.a. sender, an object that invokes an operation) and the Receiver (an object that receives the request to execute a certain operation). 

 Also known as an action or transaction pattern.
Picture

Read More
0 Comments

Memento Design Pattern Example

8/28/2015

0 Comments

 
The word 'memento' refers to an object that is kept as a reminder or souvenir of a person or event. Memento pattern is a behavioral pattern in GoF, as it captures and externalizes an object's internal state. This allows the object to be restored to its previous state at a later time.
Picture
source: GoF

Read More
0 Comments

State Design Pattern Example

10/23/2013

0 Comments

 
State pattern is a behavioral pattern in GoF because it allows to alter its behavior when a context's internal state changes. The pattern handles each state using a separate state object and the transition from one state to another that does not call for if-then statements.
Picture
source: GoF

Read More
0 Comments

Chain of Responsibility Design Pattern Example

10/22/2013

0 Comments

 
Chain of Responsibility pattern is a behavioral pattern that sends data (a request, a Command) to an concrete handler object and if that handler object can't use/handle it, it passes the data/request to other objects along the chain until an handler object handles it.
Picture
source: GoF

Read More
0 Comments

Mediator Design Pattern Example

10/21/2013

0 Comments

 
Mediator pattern is a behavioral pattern that coordinates and encapsulates many-to-many communication/interaction among related objects (Colleagues) so that Colleagues interact not directly with other independent Colleagues, but indirectly with other Colleagues through a centralized Mediator.
Picture
source: GoF

Read More
0 Comments
<<Previous

    Categories

    All
    Algorithm
    Concurrency
    CQ
    Data Structure
    Design Pattern
    Developer Tool
    Dynamic Programming
    Entrepreneur
    Functional Programming
    IDE
    Java
    JMX
    Marketing
    Marklogic
    Memory
    OSGI
    Performance
    Product
    Product Management
    Security
    Services
    Sling
    Social Media Programming
    Software Development

    Feed Widget

    Archives

    May 2020
    March 2020
    April 2018
    March 2018
    February 2018
    December 2017
    March 2017
    November 2016
    June 2016
    May 2016
    April 2016
    October 2015
    September 2015
    August 2015
    September 2014
    July 2014
    June 2014
    May 2014
    March 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013

    RSS Feed

in loving memory of my mother  and my 4th aunt
Photos used under Creative Commons from net_efekt, schani, visnup, Dan Zen, gadl, bobbigmac, Susana López-Urrutia, jwalsh, Philippe Put, michael pollak, oskay, Creative Tools, Violentz, Kyknoord, mobilyazilar