What if the init function doesn't require any args at all? Will we have to pass null or an empty struct/array all the time?
I have followed all your blog posts regarding this issue. I think it is too much discussion over something so minor. The past 4 and a half years I have only faced one case where I had to use dynamic cfc naming. I think we should focus our energy to more common problems than this. Overall I don't say I favor the loadComponent function, but I have no serious problem with it being around.
--
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/hM3m-o9pyhg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/dc04388f-fe6b-4d24-b894-06c438a4113d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I have followed all your blog posts regarding this issue. I think it is too much discussion over something so minor. The past 4 and a half years I have only faced one case where I had to use dynamic cfc naming. I think we should focus our energy to more common problems than this. Overall I don't say I favor the loadComponent function, but I have no serious problem with it being around.
When the new Lucee version inherits all the crap from the CFML, one more won't make such a difference.
If we had something clean made from scratch, it would have meaning to give a lot of thought and consideration to each and any new feature/function added.
I know this is bad thinking, its already a mess why should I bother, but thats how I feel. The community isn't responsible for all the crap of CFML, we have just inherited them, and if we try to fix the current version we will be held responsible for all the previous versions too.
--
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/hM3m-o9pyhg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/1126ccc0-ab3f-4aea-8ce1-0fef11821555%40googlegroups.com.
--
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+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/58912dc1-89b0-435b-aa5d-3244f70bfeb9%40googlegroups.com.
I answered this in detail in the first comment of this blog post
I answered this in detail in the first comment of this blog post
This doesn't stick to the rules:
* it should be on the mailing list
* it refers to previous attempts to answer, all of which were substandard, not actual answers, or just wrong-headed
* createObject() ignoring init() is *required optional functionality*, so not grounds for change. You've even accepted this (you mentioned your discussion with Luis regarding this, and Sean has also confirmed this). Plus there's over a decade's worth of CFML code which works this way. Invalid.
* plus, anyway, my solution works around that, so doubly invalid.
* no, the developer should not. Invalid.
* it might be the rule in other languages, but it's never been that way in CFML, and we are discussing a CFML situation. Invalid.
Now. Start again. Answer the question. Answer the question *as asked*. Don't invent another question and answer that one instead (which is what you've been doing).
This doesn't stick to the rules:* it should be on the mailing list
* it refers to previous attempts to answer, all of which were substandard, not actual answers, or just wrong-headed
* createObject() ignoring init() is *required optional functionality*, so not grounds for change. You've even accepted this (you mentioned your discussion with Luis regarding this, and Sean has also confirmed this). Plus there's over a decade's worth of CFML code which works this way. Invalid.
* plus, anyway, my solution works around that, so doubly invalid.
* no, the developer should not. Invalid.
* it might be the rule in other languages, but it's never been that way in CFML, and we are discussing a CFML situation. Invalid.Now. Start again. Answer the question. Answer the question *as asked*. Don't invent another question and answer that one instead (which is what you've been doing).
"it might be the rule in other languages, but it's never been that way in CFML"
Sorry but that is a terrible argument and I'm not speaking about other languages I'm speaking about OO.
There are 4 base rules in OO, one of them is encapsulation, the reason we have this rule is to make sure that an instance is is only use the way the developer of the class has designated.
I have made clear from beginning that we will most likely never remove createObject, we maybe will when acf will remove it, what I don't think will happen. People should simply consider not to use it anymore for be code, best use the "new" operator, in the rare case you need the dynamic approach and you don't need to be acf compatible, it will maybe a option.
"plus, anyway, my solution works around that, so doubly invalid."
Micha's answer (sorry, from my blog, I'm trying to coerce him into actually replying here):
--
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+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/e68914fc-5652-4c04-a16a-d66dbe03e8e5%40googlegroups.com.
I did, but try me to do it with other words ;-)
if I make a init method that is private I expect that it is not possible to create an instance from outside,
if a make a init method with a required argument, I expect that it is only possible to create a instance by passing that argument.
If I have a init method I expect that it is executed, always independent of the syntax I use!
Everything else is a flaw in the design of the language.
Because of that createObject("susi"); Is bad and we cannot change it, the only thing we can do is mark it as bad.So hopefully I'm following your rules now .... ;-)
--
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+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/40089b3b-2241-4a36-ab5f-17dcda35d593%40googlegroups.com.
I think you have lost focus a little bit, we are not talking about removing createObject, if you dont care about this new function don't use them, nobody is stopping you from using createObject.
No it's not. You're taking a dogmatic view of OO which is inappropriate here. There is nothing saying an object can't exist in two states: created and initialised. It's not something that other languages do, but it's not the only thing CFML does that isn't the way that other languages do it, and this does not intrinsically make it a problem. However there is no OO axiom that prohibits this.And if this would be a design choice of ACF i would even consider to agree with you, i could say it was a bad decision but it was decided this way so this is how cfml works. But this was never a design decision, when they added the "new" operator they did simply not change the behaviour of createObject.
My personal opinion always had influence on how things are done in Railo/Lucee and that will not change.
Requirements:* create a CFML object and have its init() called* the reference to the object might be a runtime value, presented as a string (see createObject())* the existing approach using the new keyword is unacceptable* there are no backwards compat issuesGiven the requirements, how is it my mooted solution will not resolve the problem in a CFML-friendly way?It does, i never said that createObject cannot be used the right way and getting a proper result in any case.
That is not the point,
the point is that there is a right and a wrong way with createObject, the person that does make the instance has to make sure that the instance is proper instantiated, but this is not the job of the person that makes the instance.
I'm sure that you still will disagree because this answer has nothing I have not already written more than once but this is my position.
...you also seem to think that your opinion is intrinsically right, and that your reasoning is always sound.
I asserted that instead of the delivered solution to this, createObject("path.to.component", initArgs) should work.
Micha asserted that createObject()'s non-init()-calling behaviour is fundamentally wrong
A fundamental part of Micha's solution was the deprecation of createObject(), and a move to three other functions, each dealing with CFML objects, Java objects and web service... objects
In my opinion Lucee simply can't deprecate this function.
If Micha meant deprecation as "end of support, and flagged for eventual removal", this has impact on framework / library authors
I don't think anyone would complain if createObject() was simply fixed in .lucee
Accordingly [createobject] cannot be deprecated.
Accordingly the need for new functions (at least in the context of CFC-based objects) is voided