For the first part, I'd go with an abstract content object that
doesn't define getContent, and which Module, Category, Product, and
Page all extend.  That's where you'd house all the common
functionality, leaving just the 'getContent' method up to the
individual implementations.

I didn't quite understand the Template stuff.  But it sounds to me
like the templates aren't really nested, they're just applied in
sequence, right?  I.e. for a category, the 'page' template has no idea
that a 'category' template was applied, it just knows that it's
getting some content from somewhere.  Is that accurate?

cheers,
barneyb

On 10/13/05, Paul <[EMAIL PROTECTED]> wrote:
>
>
>
> I'm experimenting with inheritance… I'll try to be concise explaining what
> I'm up to…
>
>
>
> My app contains Pages, Modules, Categories and Products, all objects that
> are quite similar.  Each is used to generate a static page to display in the
> browser, and each has common attributes (ie meta_keywords, filename,
> template_id etc.)  The only difference really is in the way they get their
> actual content; pages fetch simple html from the database, categories fetch
> and display their associated products, and a product fetches its description
> etc.  Modules actually read xml config files to build very specific content
> – store locator functionality and the like.
>
>
>
> So am I on track to assume I can have my Modules, Categories and Products
> extend Pages?  Then I just overwrite the getContent() function to suit the
> specific needs?
>
>
>
> If that much makes sense, how to I handle nested templates?  For example a
> Page uses a Template to render itself, as do the other objects mentioned.
> But a Category will have a Template of type Page (to render the browser
> page) and also a Template of type Category (to determine the way its
> products should render on the page).  Similarly, a Product needs a Page
> Template as well as a Product Template.
>
>
>
> It scarcely makes sense to me, so if I need to clarify let me know…
>
>
>
> (By the way most of the conversation on this list goes over my head so use
> small words and speak slowly… ;))
>
>
>
> Thanks,
>
>
>
> Paul
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.
b����.n�+�����qׯN�����r��zǧu�ޙ����qׯq�3�w��"�a{
+v˧���r��y��u�ڲ�^���y�h~�^zf��!B
�ⲻ�o �  �'{0q�3�w���v˩���y��UǢ�b�
0�����-�x�`�7���.��+��[�װ�Z�֦jG�����热�(�m����  
���ej{Zr������l��ny�ڂ���w^���v�r�z�����7��+-�Ưj)ZnW��0���j�!����o�}�^���Ήޢ�

Reply via email to