Details
Assignee
Michael OffnerMichael OffnerReporter
Eric PetersonEric PetersonLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Priority
New
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Eric Peterson
Eric PetersonLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Priority
Created 5 March 2018 at 16:25
Updated 5 May 2023 at 09:42
If I want a static constructor method right now I need to use the component name.
This works, but is not very flexible. Even adding basic inheritance breaks this down:
This will still return
Foo
since that is the component being created in the staticcreate
method.You can override the static
create
method inBar
to return the right value:But that isn't very flexible.
I propose being able to create a new instance of a component from a static method like so:
Using the static keyword as a constructor would create a new instance of the component and call that component's
init
method with any arguments passed. With this syntax, we could bring back our oldBar
component:And this code would execute as expected: