From: Demian K. <dem...@vi...> - 2011-02-11 17:00:54
|
I can see how that could work... but it doesn't feel right to me. The idea of the current design is that only a certain subset of records need MARC, and other formats may be needed for other as-yet-undetermined purposes. Putting MARC at the bottom of the tree makes sense right now, but it doesn't seem like the right way to generalize things - I feel that we might regret it in the future as other use cases come up. This is a situation where multiple inheritance would be awfully nice if only PHP could handle it! Maybe I'm just being an anti-MARC snob, though, and there may be no harm in having a few MARC functions floating around even if nobody uses them; I'd be interested to see if anyone else has thoughts on this... but for the moment, I'm definitely much happier with a solution that gives us a reusable MARC module rather than ubiquitous MARC functionality. - Demian From: Seaman, Graham [mailto:Gra...@rh...] Sent: Friday, February 11, 2011 11:53 AM To: Demian Katz; vuf...@li... Subject: RE: RecordDrivers I wondered about inverting it, and making MarcRecord the common ancestor of SummonRecord and IndexRecord. Someone mentioned to me they might be interested in using pazpar2 as an alternative to Solr - I don't think it was a particularly concrete suggestion (ie. nobody's that likely to get round to it..) but this kind of structure would allow you to have a Pazpar2Record class in parallel with SummonRecord and IndexRecord (maybe renamed SolrRecord), all adding their own features to the common Marc core as the ancestor. Graham ________________________________ From: Demian Katz [mailto:dem...@vi...] Sent: 11 February 2011 16:29 To: Seaman, Graham; vuf...@li... Subject: RE: RecordDrivers Regarding your MARC problem, I think the only design pattern that could really work here is delegation - move the existing MARC logic out of MarcRecord.php and into a stand-alone utility class. Instantiate the utility class inside MarcRecord and pass requests to it. Then the Summon class can also instantiate the utility class and make similar calls. There's still an undesirable degree of duplication, but at least the real meat of the logic is in only one place. Without crazy inheritance patterns that PHP doesn't support, I can't think of another way off the top of my head. |