PHP Classes

Your class is a method collection.

Recommend this page to a friend!

      JSON XML Creator and Parser  >  All threads  >  Your class is a method collection.  >  (Un) Subscribe thread alerts  
Subject:Your class is a method collection.
Summary:Package rating comment
Messages:4
Author:Matthias Kaschubowski
Date:2016-04-24 13:22:44
 

Matthias Kaschubowski rated this package as follows:

Utility: Insufficient
Consistency: Sufficient

  1. Your class is a method collection.   Reply   Report abuse  
Picture of Matthias Kaschubowski Matthias Kaschubowski - 2016-04-24 13:22:44
Your class is a method collection. Static should only be used to implement the factory method pattern. This is not OOP.

  2. Re: Your class is a method collection.   Reply   Report abuse  
Picture of Hakob Hakobyan Hakob Hakobyan - 2016-04-24 15:50:23 - In reply to message 1 from Matthias Kaschubowski
This class was written to parse data to xml format, that was used in ebay API.

For example you create an input with name
"Item.AttributeArray.Attribute.Value.ValueLiteral", and it will be parsed to

<AttributeArray> AttributeArrayType
<Attribute attributeLabel="string"> AttributeType
<Value> ValType
<ValueLiteral> string </ValueLiteral>
</Value>
</Attribute>
</AttributeArray>

You're right, this is a method collection, which helped me a lot when working with ebay api, as the xml was generated automatically and I thougth it can be usefull to anyone else.

  3. Re: Your class is a method collection.   Reply   Report abuse  
Picture of Matthias Kaschubowski Matthias Kaschubowski - 2016-04-24 15:59:40 - In reply to message 2 from Hakob Hakobyan
Collections of Methods which does not operate on the class instance are an abuse of classes ( factory methods are a exception for that ).

Your implementation works against OOP.

  4. Re: Your class is a method collection.   Reply   Report abuse  
Picture of Hakob Hakobyan Hakob Hakobyan - 2016-04-24 16:19:26 - In reply to message 3 from Matthias Kaschubowski
Thanks for Your comment. It'll help me to improve my skills in programming. I'll look into factory pattern for deeply understanding what I'm doing wrong.
Again, Thanks a lot.