Skip to content

Instantly share code, notes, and snippets.

View jpartogi's full-sized avatar

Joshua Partogi jpartogi

View GitHub Profile
@jpartogi
jpartogi / BadDesign1.php
Last active October 17, 2015 14:28
Bad OO Design in PHP
<?php
/**
* @BankAccount.php
* BankAccount is a domain object (POPO) for bank account holder.
**/
class BankAccount {
private $accountNumber;
private $accountBalance;
@jpartogi
jpartogi / BadDesign1.java
Last active March 15, 2017 04:53
Bad OO Design in Java
/**
* @BankAccount.java
* BankAccount is a domain object (POJO) for bank account holder.
**/
public class BankAccount {
private String accountNumber;
private double accountBalance;
private static final double interestRate = 5;
public BankAccount(String accountNumber){
@jpartogi
jpartogi / BadDesign1.cs
Last active September 18, 2015 09:16
Bad OO Design in C#
public class BankAccount
{
public BankAccount(string AccountNumber)
{
this.AccountNumber = AccountNumber;
}
public string AccountNumber { get; private set; }
public double AccountBalance { get; set; }
public double Interest { get; private set; }
@jpartogi
jpartogi / BadDesign1.cpp
Last active September 18, 2015 09:13
Bad OO Design in C++
#include <iostream>
#include <string>
using namespace std;
class BankAccount {
private:
string m_accountNumber;
double m_accountBalance;
static const double interestRate = 5.0;
Public Class BankAccount
Public Sub New(AccountNumber As String)
Me.AccountNumber = AccountNumber
End Sub
Public Property AccountNumber() As String
Get
Return m_AccountNumber
End Get
Private Set
@jpartogi
jpartogi / BadDesign1.m
Last active March 26, 2017 17:14
Bad OO Design in Objective C
#import <Foundation/Foundation.h>
@interface BankAccount : NSObject
@property NSString* accountNumber;
@property double accountBalance;
extern const double interestRate;
-(double) calculateInterest;
-(double) save:(double) amount;