Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@buiquangduc
Created September 26, 2017 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buiquangduc/8cd0cd3638afa13075e61484c958fb5b to your computer and use it in GitHub Desktop.
Save buiquangduc/8cd0cd3638afa13075e61484c958fb5b to your computer and use it in GitHub Desktop.
Move unrelated information to another class
<?php
// Coding Horror
interface Employee
{
/* The abstraction of all these routines belove is at the Employee level */
public function getEmployee($id);
public function removeEmployee($id);
public function updateEmployee($id, $data);
/* The abstraction of all these routines belove is at Database level */
public function getQueryToCreateEmployee($data);
public function getQueryToModifyEmployee($id, $data);
public function getQueryToRemoveEmployee($id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment