Jump to content

Michdd

Members
  • Posts

    510
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling
  • Location
    USA

Michdd's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Maybe I explained it in a bad fashion. I meant something like: class Base { /* Might have some methods to load different classes, packages, etc.. */ } class Controller extends Base { public function __construct() { parent::__construct(); } /* ... */ } class PageName extends Controller { public function __construct() { parent::__construct(); } /* ... */ } So in this simple MVC pattern there's only 1 instance of the lower level "PageName" class that needs to be invoked, but in a more involved (non-MVC, nor web-based) application there's not such a clear way to do this. It's pretty hard to explain what I mean, maybe I just need to do more research into design patterns.
  2. I've been using OOP for a long time, and I feel like I have a decent grasp on it, but when it comes to designing certain applications in OOP I'm unable to determine the correct route I should take. Building a PHP application that utilizes MVC is easy for me. I have a base class, the controller class extends the base class and then I have classes that extend the controller class to represent each individual page. In this way I get all the functionality of the base class. I want to be able to get this same kind of functionality in other programs (not web based, nor PHP, but that doesn't really matter). In my MVC applications an instance of a class extending the controller class is created when a page is accessed and that in turn gives me the functionality of all the other classes through hierarchy. I can't seem to figure out how I would do this in another type of application (or even if I should). At the moment I end up creating a base class that will hold other objects and I pass a reference of that base class to other objects held by that base object so I can access anything anywhere through that base object. However, I feel this isn't the right way to be using OOP. I've been doing a lot of searching to find examples of entire programs written in OOP that are involved, but I can't seem to find much. Everything I find is extremely basic applications that while do a good job in teaching you what OOP is about, they don't really show you real-world applications. Any suggestions or links would be greatly appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.