Jump to content

Recommended Posts

Now that I'm finally looking into properly organizing my frameworks components I find myself struggling with dividing classes into packages.

Example:
Config_Xml - provides interface to configuration variables stored in an XML file.

Should I put that in a Config (allows for different storage methods like ini), or XML package (various classes that have a high level on dependancy on each other)?

My guts originally said to go with XML, then Config, now I'm back with XML, because of the dependancy issue. One should probably try to limit package dependancy when possible.

Another caveat:
Xml_Xhtml - used to manipulate Xhtml documents that will eventually be output. Part of the view package or XML?

Any thoughts?
Link to comment
https://forums.phpfreaks.com/topic/28637-packaging/
Share on other sites

Right. I went on and did so in my framework class diagram (dataObject) already. It was the "package dependancy" issue that had me doubting again.

How about Xhtml? View_Xml_Xhtml or DataObject_Xml_Xhtml?

Option 1 seems more natural, but option 2 more logical... :(
Link to comment
https://forums.phpfreaks.com/topic/28637-packaging/#findComment-131172
Share on other sites

I think you misunderstand, I'm not talking about markup, I'm talking about a subclass of a class currently named BB_DataObject_Xml. Used to manipulate Xhtml documents, that will eventually be output.

So I guess the real question is: when can logic be considered "presentation logic", and ordered as part of the view... The class can both load basic templates (I refer to as "Xhtml frames") or make a document from scratch.

A similar issue with my BB_Output class. It handles HTTP headers (although I plan on separating that) and assembles the final document from regenerated and cached chunks.

My thoughts now:

BB_DataObject_Xml (Xml document manipulation)
BB_DataObject_Xhtml (xhtml specific document manipulation, inherits functionality from BB_DataObject_Xml)
BB_View_Document (assemble final document)
BB_View_Header (send appropiate headers)
Link to comment
https://forums.phpfreaks.com/topic/28637-packaging/#findComment-131431
Share on other sites

Asuming we're using the same definition of "data source", then yes and no.

It CAN use a Xhtml template, or "frame" as you will, as a datsource, but it is also able to create a document from scratch, were different classes create diffent parts of the tree, eventually creating a full document.
Link to comment
https://forums.phpfreaks.com/topic/28637-packaging/#findComment-131822
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.