afawcett / apex-toolingapi

Apex wrapper for the Salesforce Tooling API
BSD 3-Clause "New" or "Revised" License
134 stars 98 forks source link

Added type and type_att_info to fix Issue 37 #38

Closed scolladon closed 8 years ago

scolladon commented 8 years ago

Just added type_att_info field as private and type field as public to each element extending sOject_x class. I tried to add it as public member of the sObject_x class but did not worked

afawcett commented 8 years ago

Thanks for this, while i think the way your initialising the type member has it benefits, i am concerned about Salesforce modifying the behaviour of valueOf, as its not really documented. I understand the desire not to hard code literal text but on balance i think the stability of a literal string or perhaps Class.class.getName() is better. What do you think?

scolladon commented 8 years ago

MyClass.class.getName() is the same has the hard coded string for maintenability to me. If the class name change, the code has to change too. And in this case, the hard coded string is better for performance reason I think. This is why I use this method. I think it is better for maintainability. I tried to put it in the base class with public for the type string and protected attribut for the att_type_info String array because it works dynamically but it seems the WebService do not take that and we have to put those attribut in each sub class. What do you prefer ? We let it this way ? Or we hard code the string ?

On Wed, Mar 30, 2016 at 11:34 PM Andrew Fawcett notifications@github.com wrote:

Thanks for this, while i think the way your initialising the type member has it benefits, i am concerned about Salesforce modifying the behaviour of valueOf, as its not really documented. I understand the desire not to hard code literal text but on balance i think the stability of a literal string or perhaps Class.class.getName() is better. What do you think?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/afawcett/apex-toolingapi/pull/38#issuecomment-203644345

afawcett commented 8 years ago

I appreciate your motivations, however on balance i think the frequency of such an error occuring is low as its not often such type classes will be created and its a concern of the developer of the library rather than the user of it. Given the possibly fragile nature of the valueOf value returning something else in the future impacting the user of the library, i think on balance i'd go for the string option.

afawcett commented 8 years ago

Thanks for this, sorry it dropped off my radar for bit. Thanks for your submission! 👍

scolladon commented 8 years ago

Bonjour afawcett/apex-toolingapi, Sebastien Colladon vous a laissé un message sur IQ Elite Cliquez ici a.iqelite.com/j/z8pJaH/q10/?hg=BLWDpeq7cT pour lire votre message

L'équipe d'IQ Elite


Ce message est destiné à reply@reply.github.com. Si vous ne souhaitez pas recevoir d'autres messages de la part de IQ Elite, veuillez cliquer sur ce lien : a.iqelite.com/common/unsubscribe/?code=b9fa6f22&email=reply@reply.github.com.&hg=BLWDpeq7cT

IQ Elite est un service de IQ Elite S.L., dont le siège se trouve à : C/ Gran De Gràcia 15, 1a 1a, 08012 Barcelone, Espagne.

scolladon commented 8 years ago

Bonjour afawcett/apex-toolingapi,

Sebastien Colladon vous a laissé un message sur IQ Elite

Cliquez ici a.iqelite.com/j/z8pJaH/q10/?hg=SlG7xbHLKj pour lire votre message

L'équipe d'IQ Elite


Ce message est destiné à reply@reply.github.com. Si vous ne souhaitez pas recevoir d'autres messages de la part de IQ Elite, veuillez cliquer sur ce lien : a.iqelite.com/common/unsubscribe/?code=b9fa6f22&email=reply@reply.github.com.&hg=SlG7xbHLKj

IQ Elite est un service de IQ Elite S.L., dont le siège se trouve à : C/ Gran De Gràcia 15, 1a 1a, 08012 Barcelone, Espagne.