-- Alex Howansky <[EMAIL PROTECTED]> wrote
(on Tuesday, 18 November 2008, 06:06 PM -0500):
>
> Let's say that I'm developing some extensions to ZF and I'm adopting the
> documented coding standards. I'll use a namespace of NS, so my classes
> will all be named NS_*. I'll be creating a class that implements an
> existing and well-defined specification. Let's say I name this class
> ABC_Spec. There are multiple versions of this specification in use,
> let's call them revision 1.0, revision 2.0, and revision 2.5. I want to
> be able to use the same interface regardless of which revision I need,
> so I'll create one subclass of ABC_Spec for each revision. The question
> is, if these already-established revision identifiers are numerical in
> nature, but the ZF standards frown upon numerical names, what's the best
> naming scheme for my subclasses?
>
> This seems just wrong:
> class NS_Spec_10 extends NS_Spec { }
> class NS_Spec_20 extends NS_Spec { }
> class NS_Spec_25 extends NS_Spec { }
>
> This seems rather vague:
> class NS_Spec_R10 extends NS_Spec { }
> class NS_Spec_R20 extends NS_Spec { }
> class NS_Spec_R25 extends NS_Spec { }
>
> This seems best:
> class NS_Spec_Revision10 extends NS_Spec { }
> class NS_Spec_Revision20 extends NS_Spec { }
> class NS_Spec_Revision25 extends NS_Spec { }
I'd go with this one (above); it could be shorted to NS_Spec_Rev10,
which is shorter, but not so short as R10.
> This seems a bit much:
> class NS_Spec_OnePointZero extends NS_Spec { }
> class NS_Spec_TwoPointZero extends NS_Spec { }
> class NS_Spec_TwoPointFive extends NS_Spec { }
I agree with you here. :)
> I don't see any examples in the current ZF code to compare against. How
> would you do it?
Zend_Amf actually uses this -- Amf0 and Amf3 are specification types
used within class names.
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/