I've taken some time to analyze and draw the relationships in this module so people would or could have an easier understanding of what is happening under the hood whenever they try to code for this module

Some comments :

  • There are a number of loop-references between the adapter and it's relations. I think this could be avoided by thinking the architecture through (see the references that have 2 lines to each other)
  • The variable facet in FacetapiFacet might be a bit too un-descriptive and it looks like it could be renamed to "settings" or "facet_settings"

Also I've generated doxygen documentation with loads of diagrams and easy to read documentation. In addition to the attached images it should make the facetapi module easier to understand. The documentation can be found on http://facetapi.nickveenhof.be

ClassDiagram_facetapi.png
Classes in facetapi

Comments

nick_vh’s picture

Issue summary: View changes

testing image field

nick_vh’s picture

Issue summary: View changes

Updated issue summary.

nick_vh’s picture

Issue summary: View changes

Updated issue summary.

nick_vh’s picture

Issue summary: View changes

Updated issue summary.

cpliakas’s picture

This is excellent! Thanks for putting this together.

cpliakas’s picture

One question I have is about the "loop-references". One of the loops is between the FacetapiAdapter and FacetapiFacet classes. Multiple FacetapiFacet classes are instantiated by the adapter, and the adapter passes itself as a parameter since some of the methods in the adapter are needed. If we broke this pattern we would have to the FacetapiFacet methods into the adapter, store all of the FacetapiFacet data in the adapter keyed by the facet, and then add contextual parameters to the methods determining which facet we are acting on. One of the benefit of OO code is the ability to store data that is local only to the instance of that class. Breaking this paradigm would add a lot of logic and complexity to the adapter which is effectively eliminated by allowing multiple FacetapiFacet class instances. I am definitely for cleaning up the architecture where it makes sense, I just don't want to add complexity where it isn't needed. I am curious to see some patches in terms of how the loops could be broken in a way that improved the overall architecture.

Thanks for raising these points,
Chris

cpliakas’s picture

Status: Active » Postponed

Marking as postponed. This would be a great exercise after starting the 2.x branch.

cpliakas’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Postponed » Active

Moving to the 2.x branch.

cpliakas’s picture

Issue summary: View changes

changed target