Expand my Community achievements bar.

Realistic example of a component developed through composition?

Avatar

Level 4

I'm a bit confused by the concepts of overriding, inheriting and composition to build components. It would seem that copying code directly from /libs/foundation would be strongly discouraged, (due to the issue that would result after upgrades), so I don't really want to consider that as as option. 

1. With inheritance, will I always have to completely re-write the javascript that provides the core functionality for the component? If so, what is the real benefit. Can I keep most of the functionality and selectively "override" to provide my own implementation for a particular behavior, and/or extend the functionality with additional javascript? If so, how do I go about  doing this? Just write a separate javascript file and call it as necessary, and then modify the presentation piece to accommodate the new behavior if necessary?

2. With composition, how do I go about combining existing components? Pull in and leverage/call the implementation, (i..e javascript, Java code etc.), and then write or modify the presentation module and dialog to accommodate all of the combined behaviors?

0 Replies