Orchestration vs. Choreography

Basic technologies (such as XML, SOAP, WSDL) provide means to describe, locate, and invoke services as an entity in its own right. However, these technologies do not give a rich behavioral detail about the role of the service in more complex collaboration. This collaboration includes a sequence of activities and relationships between activities, which build … Read more

Mixins for ES6 classes, transpiled with babel

Subclass Factory Mixins There is another way to realize mixins in Javascript: With subclass factories. A subclass factory is a function that excepts a base class and returns an extended subclass of this base class: const mixin = base => class extends base { /* properties to mix in */ } Subclass factories are possible … Read more

Why use inheritance at all? [closed]

[note: This question was originally tagged as being language-agnostic. Based on that, this answer was written to be fairly language agnostic, so it discusses inheritance as it’s used across a wide range of languages, such as Smalltalk, C++, and Object Pascal. It’s since been re-tagged as being specifically about Java. Java is different in defining … Read more

What is composition as it relates to object oriented design?

Composition refers to combining simple types to make more complex ones. In your example, composition could be: Animal: Skin animalSkin Organs animalOrgans Mammal::Animal: Hair/fur mammalFur warm-blooded-based_cirulation_system heartAndStuff Person::Mammal: string firstName string lastName If you wanted to go totally composition (and get rid of all inheritance) it would look like this: Animal: Skin animalSkin Organs animalOrgans … Read more

Avoiding duplicate ids when reusing facelets compositions in the same naming container

Depending on the purpose of the <ui:include> template, you’ve several options: Use <f:subview>. It creates another NamingContainer context (like as <h:form>, <h:dataTable>, and friends all do): <f:subview id=”top”> <ui:include src=”https://stackoverflow.com/WEB-INF/includes/some.xhtml” /> </f:subview> … <f:subview id=”bottom”> <ui:include src=”https://stackoverflow.com/WEB-INF/includes/some.xhtml” /> </f:subview> The components definied in some.xhtml will end up getting respectively top: and bottom: prefix in their … Read more

Implementation difference between Aggregation and Composition in Java

Composition final class Car { private final Engine engine; Car(EngineSpecs specs) { engine = new Engine(specs); } void move() { engine.work(); } } Aggregation final class Car { private Engine engine; void setEngine(Engine engine) { this.engine = engine; } void move() { if (engine != null) engine.work(); } } In the case of composition, the … Read more

tech