portal entry

select a category, or use search below
(searches all categories and all time range)
Title:

Default Function In Interface

| View in Portal
July 12, 2018 08:09:49 AM GMT
1 Comment
Default functions can be provided to an interface without affecting implementing components as it includes an implementation. If each added method in an interface is defined with implementation then no implementing component is affected. An implementing component can override the default implementation provided by the interface. Imagine a scenario where you want to add a new function to a public interface, without default function, it would be a Herculean task since all consumers will need to provide an implementation. A default function is the solution, as the default […]
Labels: Blog, Uncategorized, cfml coldfusion default interface function

Comments:

"default Any function returnsAny(){" shouldn't that be something like "default public Any function returnsAny(){ ? Or just do away with "default" and allow public/private in interface...
Comment by Tom Chiverton
1173 | July 13, 2018 09:41:20 AM GMT