Jump to content

Bladescope

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by Bladescope

  1. Whoa, thanks for the topic attention O.o. I think the general method I've been taught is to create a page/template class, and to use that object to take the raw template data and insert the data in that way. I've usually used something like str_replace for that. As for the singleton pattern, I've been using the singleton pattern for one class only, which is my main control class to save passing the object through to each object who needs to use it. I don't particulaly know if it's the best option, most likely isn't, but I haven't been taught otherwise. I am aware that using the singleton pattern breaks encapsulation, and that it probably would actually be better to go with the other method mentioned in my post, so I may change that around now. In the meantime, I'll continue reading about the theory behind OOP which you kind folks have provided. Once again, thanks for the feedback. I'm still here! Edit: As for the law of demeter, I assumed that was the standard way to approach OOP, so I've been using that logic from the start. (:
  2. Would you care to clarify? I'm rather confused.
  3. Hey PHPFreaks! I'm designing an online application using OOP. This is by no means my first application, but it is using Object Oriented techniques, so I come to you helpful folks with a question.Essentially, I would like to be able to find out about recommended ways to approach page templates in a class design, as well as other general good class design practices specific to server-side languages. So, without further ado, what is considered a good/recommended method of approaching template design using OOP? For example, a base template class which can be extended for multiple themes, so additional themes don't have to recreate the core functionality if they decide not to change it. It seems that there are a lot of methods to approach it, which is why I'm here! Any help you can provide 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.