-
-
Save shahariaazam/707d863dcaaa65247faf to your computer and use it in GitHub Desktop.
ERP class diagram to solve real life OOP case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Erp | |
{ | |
public function init($login) | |
{ | |
//Which module | |
} | |
public function create($data) | |
{ | |
} | |
public function read($id) | |
{ | |
} | |
public function update($id, $data) | |
{ | |
} | |
public function delete($id) | |
{ | |
} | |
} | |
class Module | |
{ | |
//Will apply some rules to load any specific module. Turn off, turn on any specific module to load | |
public function load($module) | |
{ | |
} | |
} | |
class Sales | |
{ | |
//Basic sales configuration will be here like which sub modules will be loaded. Sales managers info, etc... | |
} | |
class Customer extends Sales | |
{ | |
//All customer related operation means read, write data from ERP class | |
} | |
class Billing extends Sales | |
{ | |
//All billing operation means read, write data from ERP class | |
} | |
/** | |
* ERP is the main class that can perform CRUD after init it | |
* | |
* Module => ERP has many modules. We will have to choose one module at a time. i.e: Sales, HR, etc... | |
* | |
* Sales module has more 2 sub-module like Customer, Billing, etcc.... | |
* | |
* | |
* | |
* Now suppose I want to do a read operation on Customer Submodule like this way | |
* | |
* $data = Erp->init()->Sales()->Customer()->read(1); | |
* | |
* or what can be a the best practice? | |
* | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment