Application Development, Product to Market
  • 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

Data Structure - Implement Stack and Queue

10/29/2013

0 Comments

 
A clear thought process helps coders to get to the solutions. This post simply walks you through my thought process of how to implement some very basic data structure - a stack and a queue.

Read More
0 Comments

Behavior-Driven Development (BDD)

10/27/2013

0 Comments

 
BDD is basically TDD done properly. It is an agile methodology for building a shared understanding of what software to build by discussing using examples. It is a technique that uses a business language to define acceptance criteria. It is about figuring out what to build with an outside-in approach - having conversations, capturing conversations, automating conversations. In other words, first think about what you’re about to write, then think about how you would test the code, before writing it.

BDD is not an agile project framework (e.g. SCRUM) nor a project management approach.

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

Bridge Design Pattern Example

10/16/2013

0 Comments

 
Bridge pattern is categorized as a structural pattern in GoF because it structurally decouples abstraction from its implementation so that the two can vary independently. However, it is very similar to Strategy pattern which is categorized as a behavioral pattern. 
Picture
source: GoF

Read More
0 Comments

Strategy Design Pattern Example

10/15/2013

0 Comments

 
Strategy pattern is a behavioral pattern that lets the algorithm vary independently from clients that use it by defining a family of algorithms, encapsulate each one, and make them interchangeable. An algorithm that's encapsulated in this way is called a strategy. Strategy is concerned with changing the behavior of an object.
Picture
source: GoF

Read More
0 Comments

Data Structure - Whether a Small tree is a Sub-tree of a Large Tree?

10/13/2013

0 Comments

 
Picture
In this post, I note the approach and my thought process about determining whether a given smaller tree (t2) is a sub-tree of another larger tree (t1).

First, the approach: Since I know t2 is smaller and it is to be matched/found in a larger tree t1, I'll take the approach of scanning through the larger tree t1, and t1's children, by trying to find a match of t2 in t1's left child tree and find a match of t2 in t1's right child tree, recursively.


Read More
0 Comments

Visitor Design Pattern Example

10/10/2013

0 Comments

 
Visitor pattern is a behavioral pattern that lets you define a new operation to apply toward classes of the elements (Element Class, a.k.a. Visitable Class) without changing the classes of the elements on which it operates. The new operations are grouped together each is called a separate Visitor class.

overview

Visitor pattern lets you add a new operation to a structure of objects (Visitable/Elements) to be traversed through, without changing the Visitable/Element on which it operates.

Visitor class separates out would-be virtual functions into a Visitor class. 

Each Visitable/Element should implement an accept(Visitor) function which delegate the request to the underlying Visitor class via calling visitor.visit(this) from accept(Visitor).

Each concrete Visitor class implements a set of visit(Object) functions that does the real work for the operation to be applied to the structure of objects. Each visit(Object) function takes in a different type of concrete Visitable/Element object. The Visitor can optionally maintain a context during a traversal.



Picture
source: GoF

Read More
0 Comments

Data Structure - Mark Entire Row and Column Zero if an Element of an MxN Matrix is Zero

10/6/2013

0 Comments

 
Picture
When you're asked to mark an entire row and an entire column with 0's if an element of an MxN matrix is 0, here's my thought process:

  1. Define the contract of the function.
  2. Code the 2-passes algorithm.


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