0

I am trying to implement OOP in making an admin panel for my ecommerce website.

I am fairly new to OOP. I need few suggestions before starting my project.

I have:

  1. Brands pages (Add, View) where admin can add brands (Companies) or view them in a grid;
  2. categories / Subcategories;
  3. products page (CRUD) with image upload;
  4. customers;
  5. orders;
  6. payments;

Now the problem i am facing to jump in is that how to do it in OOP. For example:

  1. Should i make seperate classes for every identity and add CRUD methods for every identity?
  2. should i make a generic CRUD class and inherit it in every identity?
Andrew Edgecombe
  • 39,594
  • 3
  • 35
  • 61
Raheel
  • 8,716
  • 9
  • 60
  • 102
  • First start your project in framework, best framework in php is a very complicated topic, but i think yii will be better – Nanhe Kumar Sep 24 '13 at 22:26
  • @NanheKumar , I would [argue](http://stackoverflow.com/a/10960679/727208) that Yii is one of the worst frameworks in PHP. Surpassed in it's hideousness only by turds like CodeIgniter and CakePHP. – tereško Sep 25 '13 at 07:28
  • 1
    I can understand you're eager to learn. But the way you ask is not leading you to good results. Before asking about OOP it's good to actually understand the broader meaning of the term otherwise you will look into the wrong places for too long. – hakre Sep 25 '13 at 07:31

1 Answers1

0

Perhaps its better for you to use a Framework like Symfony2, Codeigniter or something else. Then you can look at the important things and not the structure.

And the second is that you can look in existing Frameworks for good solutions to solve such problems.

The Framework gives you the structure to write your application with CRUD and many more.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
  • 2
    is it good to start with framework without getting basics of implementation with myself ? I'm scared of jumping in frameworks without making my basics strong – Raheel Sep 24 '13 at 22:13
  • 1
    @user2812955 I am of the beliefe that you should at least get some fundamentals down before jumping into frameworks. Then look at frameworks to get a better idea on how to doe what you want to do in a more polished manner. – Mike Brant Sep 24 '13 at 22:17
  • All of the Frameworkds are written with OOP. So you should learn the basics first. But the frameworks gives you the way to do it. Read about it. – René Höhle Sep 24 '13 at 22:17
  • I think its better to copy some basic application made in OOP before starting my own ! as classes and objects are not enough i guess.. – Raheel Sep 24 '13 at 22:21
  • 2
    "All of the Frameworkds are written with OOP" Really that is just not true at all. Especially your Cake/Ci suggestion are really not. – PeeHaa Sep 24 '13 at 22:35
  • Then you should take a look at Cake PHP ;) its OOP and MVC... – René Höhle Sep 25 '13 at 07:37
  • And Codeigniter the same http://ellislab.com/codeigniter/user-guide/overview/mvc.html i have used both of them. – René Höhle Sep 25 '13 at 07:39
  • 2
    Yes, @Stony, they both are terrible. And they have made up "new definition" of MVC just so that they could market is as "MVC framework". You obviously have no idea what OOP practices and principles are. Maybe you should look into that subject, before you continue peddling bad frameworks to newbies. – tereško Sep 25 '13 at 07:55
  • Hey i haven't said that they are good ;) but when i write only Symfony2 we get here a big flame war so i wrote some alternatives... – René Höhle Sep 25 '13 at 08:00