Untitled

Service Locator Design Pattern

0

What is Service Locator Design Pattern?

We’ll be discussing the service locator and when, how to implement the service locator pattern to simplify the code and provides separate responsibilities and increase maintainability.

 

The service locator pattern is also known as creational pattern that was identified with abstract factory, builder, factory method, prototype and singleton patterns.

We also see the reference in the Core J2EE Business Tire, session facade, service locator, value list handler.

With the Inversion of Control Containers its reference are spring.net, structure map, ninject, and castle windsor. Implementations of Service Locator are used by Service Locator, Dependency Injection or Factory Pattern.

 

A good example on when to use Service Locator is when we implement logging. It is use through the application and is independent through the business application. It is also easy to implement for each application for simple needs and is also often changed based More >

nullobject

Null Object Design Patterns

0

What is Null Object Pattern?

The Null Object pattern directly relates to how we program in defense of null references. This is similarly called as “Defensive Programming”.

Intent

  • Rid program logic of null checks where possible
  • Provide a non-functional object in place of a null reference
  • Allow methods to be called on Null objects, unlike a null reference

Normally, these are in the getter or setter (Properties) in your classes but with Null Object Pattern its different. So If I ask for a class property that is a null, then I could either create a new object of it but if it does have a value, then you just return it.

Applicability

  • When we want to shield  our client from needing to handle a null case so that we can provide a null implementation and not our client worry to how it is actually implemented
  • When an

More >

memento

Memento Design Patterns

0

What is Memento Design Pattern?

Memento is a useful pattern for implementing undo and redo functionality in your application.

When is it useful?

  • The classic case for the memento is when you want to provide a useful functionality to rollback one or more objects within your application to a previous state. e.g, Implementing Undo’s
  • When you are providing a undo functionality within one or more classes would violate the Single Responsibility Principle because those objects already have other responsibilities
  • When you are providing full access to object’s internal state it violates the encapsulation principle
The memento pattern helps you to capture object’s internal state without violating the principles of OOP, specifically the Single Responsibility Principle.

Intent

In the Design Patterns of the Gang of Four book, it describes that the intent of the memento of the pattern as

“Without violating encapsulation, capture and externalize an object’s internal state so More >

final

Digital Painting

0

This is how I painted Natalie Portman.

Reference: http://www.murraymitchell.com/wp-content/uploads/2011/07/natalie_portman_portrait.jpg

I started with an outline of Natalie’s face.

Then a more detailed outline:

I usually start with the forehead because for me, that’s the easiest part to mix the colors when painting a portrait. I used the Mixer Brush Tool so that I can blend better, but sometimes if I can’t get the look that I want, I use the Smudge Tool.

As for the hair, I just color the whole hair with a base color(dark brown in this case), then I add a new layer then paint a lighter color over it(Number 1), then I use the Smudge Tool to push the outside parts to the middle in order to create a highlight effect on my hair(Number 2). And for the strands, I used Stephanie Valentin’s hair strand brush which can be downloaded for free here: http://www.stval.fr/index.php?option=com_content&view=category&layout=blog&id=71&Itemid=109 More >

MVP_FullColor_ForScreen

Re-awarded as a Microsoft MVP for 2012

0

What is MVP Award?

People may want to know, what is this MVP Award? So, this point is for those who don’t know about the Microsoft MVP Award Programme. Here is a short snippet from the Microsoft MVP site:

The MVP Award recognizes exceptional technical community leaders from around the world who voluntarily share their deep, real-world knowledge about Microsoft technologies with others.

 

Potential MVPs are nominated by other technical community members, current and former MVPs, and Microsoft personnel who have noted their leadership and their willingness and ability to help others make the most of their Microsoft technology.

 

To receive the Microsoft MVP Award, MVP nominees undergo a rigorous review process. A panel that includes members of the MVP team and Microsoft product groups evaluates each nominee’s technical expertise and voluntary community contributions for the past 12 months. The panel considers the quality, quantity, and level of

More >

dsd

How to make a Stratocaster in Maya

0

This is a tutorial on how to make models in Maya with the help of Adobe Illustrator.

Step 1

Open desired photo in Illustrator. I chose the Fender Stratocaster.

Step 2

Using the pen tool, make an outline of the whole guitar like this:

Then save it.

Click File>Save As>Save on desired location>Save.

I saved mine as body.ai

A pop-up like this will appear:

Choose Illustrator 8 then click ‘Ok’.

Step 3

Open Autodesk Maya

Click Create on the Main Menu bar then Click Adobe(R) Illustrator(R) Object

Open body.ai

And this is what it will look like when imported in Maya:

Step 4

Go back to Illustrator then start making the outlines of the other parts of the guitar.

  • Save it and don’t forget to choose Illustrator 8 in the version pull down menu.
  • Import it in Maya using the Adobe(R)

More >

@

2

0

Thank you. Thank you for always being by my side even if everyone else has turned their backs on me. I know I am far from perfect but you still chose to be with me. I love you and I’ll spend everyday of my life proving it. Thank you for always giving me your time even if you have a really busy schedule. Work, school, time difference, plus distance, you made it all seem so small and conquerable. You told me that you’re never patient enough, that you hate waiting and stuffs like that. But it’s funny how I never see all of that. You are always so patient to me. We may be miles apart but don’t worry baby, when we’re together again, we’ll be inseparable. I miss you so much. Super miss!

LI

Penguin

0

Hi baby.

You make it so easy for me to tell you everything that I am feeling. You have this extraordinary way of getting deep into my life. I find you as one of the best gift that the Lord has given me. You have this exceptional way of making me realize things that I never even thought would be good for me. Thank you for always correcting me, for leading me, for helping me see what is best for me and for always believing in me. It’s flabbergasting how you encourage me that I could do things. Oh and not simply just ‘things’ but ‘great things’. You make me feel like I am considered a sui generis. Nobody has ever made me see that I am special before. The kind of special where you make me feel like I am something that the world will never see again when More >

nok

Windows Phone 7.5 – Defining the database schema

0

In Windows Phone, we use the code first approach to define our database factory using LINQ to SQL. So here we start by defining our data model in code, we do that by creating a datacontext and a set of entity classes. The datacontext class is the main entry point for the LINQ to SQL Framework, it allows us to actually create the database, build and send queries to it and send data updates as a Unit of Work in our application. We’ll see more about that, you can learn more about the Unit of Work pattern in my Design Patterns blog category.

Model = Datacontext + Entity Types

Data Context : creates DB, build queries, send updates as UoW

Entity types : mapped to DB tables and columns

Entity classes represents our object model types that LINQ to SQL will eventually More >

templatepattern

Template Method Design Pattern

0

What is template method pattern?

The template method is used when you have a process or an algorithm that consist of several steps that you want to allow different implementations of this algorithm. For an instance, if you want to allow variation of the details of each steps or certain steps while enforcing the structure and order of the steps themselves then the template method pattern is appropriate.

For instance, a game engine could be used for a multiplayer turn based game such as tic tac toe, chess, or monopoly might consist of the following algorithms

  1. SetUpGame()
  2. TakeTurn(Player p)
  3. IsGameOver()
  4. DisplayWinner()
Given this structure like this, specific games like Tic-Tac-Toe, Chess, Monopoly, etc, could be implemented as subclasses.
The intent of the template pattern is to encapsulate and enforce the work flow or process that is not variable in an algorithm. This allows subclasses to alter specific

More >

Go to Top