Comments (7)
Could this also go in the contributing document? Something like:
Code in ACS AEM Commons must be designed for reuse and extensibility. Specifically:
- Java Code
** Only export necessary API
** Exported abstract classes should follow guidlines from http://checkstyle.sourceforge.net/config_design.html#DesignForExtension
** Exported non-abstract classes should generally be final - AEM Components
** Make liberal use of "partial" scripts to decompose componet scripts to allow extending components to override sections of the component's HTML.
** Partial scripts should be in a 'partials' folder.
from acs-aem-commons.
Regarding your questions, I don't think there's a good way to put hard-and-fast rules about what the right level of decomposition is. It's a judgement call. I'm not sure why there would be code duplication per se.
from acs-aem-commons.
Sure - but we should agree this is a good idea first and there isnt a better way to tackle the problem.
I've never done this on any "real-life" use case, since most customer components don't have the use-case of being overlayed/copy-downed.
Agree its judgement calls all the way down - but guidelines are helpful!
If each partial is responsible for rendering its content or placeholder for its content, might be a good approach, BUT you could end up w multiple placeholders for a component (ala OOTB text and image). Ill have to check if ComponentHelper has a good way of handling this use case (i really like ComponentHelper.printEditBlockOrNothing(..)).
Just trying to think of ways to avoid the entire copy/down which is ugly and (should be) unnecessary; itd be a shame for someone to need to muck around w your nice audio.jsp code!!
Either way, this approach can be applied post-release-1 without breaking anything.
from acs-aem-commons.
Decomposition is definitely a good idea :)
from acs-aem-commons.
kk - ill try to POC/write something up around this to supplement the CONTRIBUTING doc; IME a clear example goes along way for others.
Anyhow - no immediate rush -- nice part is this is very backwards compatible.
from acs-aem-commons.
IMHO, Core Components might be along the same lines. Does ACS Commons need to focus on that, or would it be more productive to have an ACS fork of core components and direct our efforts there?
from acs-aem-commons.
Closing as the new HTL + Sling Model abstraction supersedes. Some good ideas, but closing as to not confuse.
from acs-aem-commons.
Related Issues (20)
- Package Garbage Collector does not find all packages to clean up in v6.3.4 HOT 1
- touchui-composite-multifield.js - isUndefined check not working as expected HOT 1
- Package Garbage Collector doesn't remove old snapshot packages
- Font Awesome Icons are not loading
- Invalid max-age header set from property HOT 2
- release 6.3.8 failed to install on cloud service HOT 1
- Remove usages of deprecated org.apache.sling.commons.json HOT 1
- MCP Report performance slow HOT 5
- OOTB users to CSV exports not working HOT 3
- ACS Commons Report Builder References Column component showing incorrect data
- MCP Overview page doesn't show any processes HOT 2
- ACS commons | Garbage collection scheduler failing HOT 1
- Allow usage of BundleDisabler and ComponentDisabler via factory configuration
- ACS composite multifield error prevents to load values in the nested fields on author dialog. HOT 1
- NullPointerException when trying to open dialog generated via @DialogProvider
- Remove JSR305 dependency
- Only JUnit5 tests executed by m-surefire-p HOT 3
- OSGi support for Java HTTP Client HOT 1
- Raise minimum required Java version to 11 HOT 3
- Content Sync - Version history not preserving from source to destination HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acs-aem-commons.