Questions tagged [composition]

Composition is the process of combining, or composing, parts of a program into a larger program.

1737 questions
0
votes
2 answers

Dojo, creating composite widgets

I am using dojo 1.10 and am desperately trying to find a clean way to create composite widgets, I have the following code: TabsWidget.js require([......], function(.....template ....){ var Tabs = declare('...', [....], { templateString :…
user1383163
  • 577
  • 1
  • 7
  • 24
0
votes
1 answer

Flash, ActionScript 3: define a variable as a variable from its creator without constantly using creator.var

I am trying to split up my code in classes. but there is a issue what really bothers me. when i create a class for functions i am giving its own stage. like this dragf:Dragfunctions = new Dragfunctions(this) and in the class i use this var…
matthy
  • 8,144
  • 10
  • 38
  • 47
0
votes
1 answer

Difference between deployment and enactment

What is the difference between deployment and enactment? I keep coming across the term "enactment" when I read about choreographies.
Andrei
  • 7,509
  • 7
  • 32
  • 63
0
votes
1 answer

Accesing field's methods in composition

I have a class Player which contains few private fields of other classes ( I believe it is called composition ). public class Player { private String name; private Statistics statistics; private Experience experience; private Effort…
Julian Rubin
  • 1,175
  • 1
  • 11
  • 23
0
votes
1 answer

ui:composition hides h:form parameter enctype

I have a problem with ui:composition and h:form parameter enctype="multipart/form-data". When h:form is nested in ui:compostion, h:inputFile throws: javax.servlet.ServletException: The request content-type is not a multipart/form-data When I place…
0
votes
1 answer

Store a reference to component class in compositional relationship

I'm looking at composition. What does it mean to 'store a reference to a component'? To me this means that there will be two classes, and that one class will be instantiated from within the other class. Is this correct? How else could you represent…
Zach Smith
  • 8,458
  • 13
  • 59
  • 133
0
votes
3 answers

.NET MVC -- Using Composition in a View Model

I am trying to wrap my head around the idea of Composition. Never used it before. I have a class that looks like this (thinned down): public class AccountProfile { public string AccountNumber { get; set; } public string…
Casey Crookston
  • 13,016
  • 24
  • 107
  • 193
0
votes
2 answers

Best practice to implement composition and aggregation

What practice is considered the best one when i have to translate an aggregation/composition of an UML Diagram drawn in Design Phase in implementation phase?
EagleOne
  • 541
  • 1
  • 10
  • 28
0
votes
1 answer

HTML Canvas composition: combining "lighter" and "source-atop" effects

Essentially, I have a gray-scale image of a cube that I would like to color different colors using an HTML 5 canvas. I don't care much about browser compatibility at the moment, so I've been looking at the globalCompositeOperation property values…
Ragnaraxis
  • 332
  • 2
  • 8
0
votes
1 answer

Re-initializing parent of a class

I have become stuck on a problem with a class that I am writing where I need to be able to reinitialize the parents of that class after having created an instance of the class. The problem is that the parent class has a read and a write mode that is…
Sam Perry
  • 145
  • 1
  • 12
0
votes
0 answers

Acquiring Parent Mutex from Child Object

#include #include using namespace std; class A; class B { public: B(A *_parent = nullptr) { parent = _parent; } A *parent; }; class A { public: std::mutex m; B *b; A() { b = new B(this); } }; int main()…
user2411693
  • 533
  • 4
  • 14
0
votes
2 answers

Why does the main function returns unexpected execution result?

I am trying to understand the source code: public class InstrumentedSet extends HashSet { // Keeps the number of attempted element insertions private int addCount; public InstrumentedHashSet(Collection c) { super(c); …
Francisco Maria Calisto
  • 2,841
  • 4
  • 22
  • 54
0
votes
2 answers

Constructor of a children class that have an array that contains objects of another class

Dialog.h #include "WBasic.h" #include "WButton.h" #include "WData.h" #ifndef WDIALOG_H_INCLUDED #define WDIALOG_H_INCLUDED class WDialog : public WBasic { private: WButton wB; WData wD; public: //Constructor …
Imnus
  • 3
  • 1
0
votes
4 answers

Using MEF to build a tabbed application dynamically

I'm rather taken with MEF and plan to use it to build a demo application to load different tabs. I am a begineer at MEF and WPF and although MEF is loading the assemblies I'm stuck at loading the controls into the TabItem I have created. My code…
mmmm
  • 2,431
  • 2
  • 35
  • 56
0
votes
1 answer

Composition over Inheritance Real life example

I am trying to understand the phrase "favor composite over inheritance". Could someone give me a real life example why composition is better than inheritance. Also if there are any drawbacks?
AndroidJava
  • 31
  • 2
  • 7