Skip to content

Instantly share code, notes, and snippets.

Loves clean code, brewed beer and playing snooker

Rajendra Uppal rajendrauppal

Loves clean code, brewed beer and playing snooker
View GitHub Profile
// 1. Implement Serializable interface
public class User implements Serializable {
// 2. All attributes must be private
private int id;
private String name;
// 3. Should have a no argument public default constructor
rajendrauppal / CarBuilder.cpp
Created Nov 30, 2013
Car builder example of builder design pattern
View CarBuilder.cpp
* Example of Builder design pattern.
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
rajendrauppal / ActionFactory.cpp
Created Nov 28, 2013
Real world example of Factory method pattern. Depending on the platform, client may request ActionFactory for either the DMGMountAction object or ExtractZIPAction object.
View ActionFactory.cpp
The MIT License (MIT)
Copyright (c) 2013 rajendrauppal
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
You can’t perform that action at this time.