Coder Social home page Coder Social logo

Comments (7)

justinedelson avatar justinedelson commented on May 24, 2024

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.

justinedelson avatar justinedelson commented on May 24, 2024

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.

davidjgonzalez avatar davidjgonzalez commented on May 24, 2024

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.

justinedelson avatar justinedelson commented on May 24, 2024

Decomposition is definitely a good idea :)

from acs-aem-commons.

davidjgonzalez avatar davidjgonzalez commented on May 24, 2024

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.

badvision avatar badvision commented on May 24, 2024

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.

davidjgonzalez avatar davidjgonzalez commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.