joechastain
10/20/2022, 2:07 PMbdw429s
10/20/2022, 2:08 PMbdw429s
10/20/2022, 2:08 PMjoechastain
10/20/2022, 2:08 PMzackster
10/20/2022, 2:08 PMjoechastain
10/20/2022, 2:08 PMjoechastain
10/20/2022, 2:09 PMAdam Cameron
Happening for both ACF and Lucee.Ugh.
states that it can't create the abstract componentDouble ugh
bdw429s
10/20/2022, 2:17 PMAdam Cameron
// AbstractBase.cfc
abstract component {
public static function f(){
return "hi"
}
}
// testAbstractBase.cfm
writeOutput(AbstractBase::f())
If I create a ConcreteImplementation.cfc and extend AbstractBase and call ConcreteImplementation::f()
it works finejoechastain
10/20/2022, 2:24 PMjoechastain
10/20/2022, 2:36 PMAdam Cameron
joechastain
10/20/2022, 2:55 PMcfvonner
10/20/2022, 3:15 PMAn abstract component can have abstract method without body and can also have methods with implementation.
Use the abstract keyword to create an abstract component and method. In ColdFusion, you cannot instantiate an abstract component. An abstract component is mostly used to provide base for sub-components. The first concrete component should have the implementation of all the abstract methods in its inheritance hierarchy.
cfvonner
10/20/2022, 3:16 PMseancorfield
seancorfield
seancorfield
cfvonner
10/20/2022, 3:30 PMbdw429s
10/20/2022, 3:37 PMbdw429s
10/20/2022, 3:39 PMbdw429s
10/20/2022, 3:43 PMzackster
10/20/2022, 3:45 PMcfvonner
10/20/2022, 3:53 PMCase3::splitFullName("John Doe"))
cfvonner
10/20/2022, 3:54 PMcfvonner
10/20/2022, 3:55 PMbdw429s
10/20/2022, 4:04 PMMath.round( float a )
to be a static method so you can just import the class and call it directly.bdw429s
10/20/2022, 4:07 PMcomponent singleton {
function round( a ){ ... }
}
and then
property name='Math' inject;
...
Math.round( foo )
I don't really _nee_d anything to be static for that to work, I don't have to worry about instantiation due to the IOC container, and there's no real performance overhead since it's still a singleton and not re-created everywhere.bdw429s
10/20/2022, 4:10 PMthis.OFF = -1;
this.FATAL = 0;
this.ERROR = 1;
this.WARN = 2;
<http://this.INFO|this.INFO> = 3;
this.DEBUG = 4;
However it feels a bit like a micro-optimization in CFML to worry about a few Bytes here and there in a language which already significantly expands the memory overhead for a single class instance.Adam Cameron
Adam Cameron
Adam Cameron
Adam Cameron
<cftagisland>
then".seancorfield
zackster
10/20/2022, 5:11 PMseancorfield
onMissingMethod()
because I pushed for it -- because Ruby and Smalltalk have something very similar. And that makes sense in a dynamic OOP language.seancorfield
seancorfield
zackster
10/20/2022, 5:19 PMseancorfield
zackster
10/20/2022, 5:25 PMjoechastain
10/24/2022, 12:57 PMjoechastain
10/24/2022, 1:11 PMzackster
10/24/2022, 1:23 PMjoechastain
10/24/2022, 1:39 PMzackster
10/24/2022, 1:39 PM