If we’re going to be creating new functions, maybe standardizing some conventions on function naming would be in order. Looking at the current function list for CMFL (http://www.luceedocs.org/functions), the functions use many different conventions:
Verb prefix:
verb[type]Noun() - i.e. createODBCDate() or createObject()
Noun prefix with verb appendix:
nounVerb() - e.g. fileOpen()
Transformers:
typeDescriptorNewType - e.g. arrayToList()
Verb only:
verb() - i.e. encrypt() or duplicate()
Verb Descriptor and Type:
verbForType() - e.g. encodeForXML()
Noun prefix with adjective appendix (and optional type):
noun[type]Adjective() - e.g. arrayNew();
There are more, of course, and Alex’s recommendations would be the noun[type]Adjective(), which makes total sense, but doesn’t match the existing or verbType() or verbTypeNoun() conventions uses to create complex objects. Only simple or native containers currently use noun[type]Adjective() - arrayNew(), structNew(), queryNew().
I would be in favor of moving to that type of syntax instead of a verbType() syntax which tends to be more verbose, but I’d like to see those conventions applied consistently as the language evolves - otherwise we end up like PHP where the function name conventions are all over the map and I never know if the “needle” comes before the “haystack” when searching or evaluating strings and objects.
Jon
I think
objectNew()
javaObjectNew()
webServiceNew()
The whole proxy thing to me is over detail with regard to the implementation that is frankly of little interest to the person calling
A
I always use New with non-persistent components (which always have an
init method returning the instance), EntityNew() with ORM entities and
CreateObject() with java classes.
“New” feels right to me, so I’d vote for:
ObjectNew
JavaNew
(Don’t do much with web services. WebserviceClientNew sounds clearer
to me, but WebserviceProxyNew may be more accurate.)
Julian
http://cfsimplicity.com/On April 15, 2015 at 11:00:31 AM, Alex Skinner (@Alex_Skinner) wrote:
On 15 April 2015 at 15:48, Julian Halliwell <@Julian_Halliwell> wrote:
On Wednesday, April 15, 2015, Micha wrote:
So my suggestions are (in order i like them):
- ObjectNew (like ArrrayNew, EntityNew,StructNew,…)
- createInstance
- loadComponent
- instantiateComponent
JavaProxy
i have coosen this name to follow the pattern of the only existing Java
function in CFML “JavaCast”.
My suggestions are (in order i like them):
- JavaNew
- JavaProxyNew
- createJavaProxy
WebserviceProxy
i have chosen this name to reflect the name “JavaProxy”
My suggestions are (in order i like them):
- WebserviceProxyNew
- createWebServiceProxy
- WebserviceClientNew
- createWebserviceClient
–
You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAC_5Vopx%2B12R32xQ-iifRkjxfgN65C_dMs3o8-5acGZDjS75Gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
–
Alex Skinner
Managing Director
Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom
T: +44 [0] 845 260 0726• W: www.pixl8.co.uk• E: info@pixl8.co.uk
Follow us on: Facebook Twitter LinkedIn
CONFIDENTIAL AND PRIVILEGED - This e-mail and any attachment is intended solely for the addressee, is strictly confidential and may also be subject to legal, professional or other privilege or may be protected by work product immunity or other legal rules. If you are not the addressee please do not read, print, re-transmit, store or act in reliance on it or any attachments. Instead, please email it back to the sender and then immediately permanently delete it. Pixl8 Interactive Ltd Registered in England. Registered number: 04336501. Registered office: 8 Spur Road, Cosham, Portsmouth, Hampshire, PO6 3EB
–
You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAFrbJ5WT%2B5DuE_ahnRPfO9DnX2J2kxjUNfyKFwKnaeBMMFyToQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.