composition

How can I unload a dll in order to delete it after a MEF recomposition ?

1) With MEF, I compose my DLL 2) I work with my DLL 3) I recompose without this DLL 4) I want to delete it // => it doesn't work How can I unload a dll in order to delete it after a MEF recomposition in which this dll is not composed ? ...

Function Composition VS Function Application

Do anyone can give example of function composition? This is the definition of function composition operator? (.) :: (b -> c) -> (a -> b) -> a -> c f . g = \x -> f (g x) This shows that it takes two functions and return a function but i remember someone has expressed the logic in english like boy is human -> ali is boy -> ali is hum...

Haskell Type Error From Function Application to Function Composition

This question is related to this http://stackoverflow.com/questions/3116165/function-composition-vs-function-application which answered by antal s-z. How you can get this ? map has type (a -> b) -> [a] -> [b] head has type [a] -> a map head has type [[a]] -> [a] Why the following code has type error for function composition ? t...

MEF Global CompositionContainer in existing applications

I'm researching MEF as a solution to plug-in resolution in our existing .NET Application. In all of the examples that I can find, the main application creates an instance of the CompositionContainer and calls container.ComposeParts(this). The problem is, my application is not entirely built on MEF, so there is a hole in the object grap...

Difference between inheritance and composition

I have extracted following difference between inheritance and composition. I wanted to know what does delay of creation of back end object mean? Please find below difference. Composition allows you to delay the creation of back-end objects until (and unless) they are needed, as well as changing the back-end objects dynamically through...

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

Hi, 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 stage:Object; public function Dragfunctions(stage:Object) { this.sta...

Refactoring inheritance to composition using Vbex2005

I have a class that I wrote fairly early on in my vb.net programming experience which inherited from another class it really should have composed. The base class is a relatively generic nested dictionary-based collection; let's call the descendant class a "Car". Right now there's a lot of code that does things like 'MyCar!Color.st = "R...

UML diagrams question regarding composition/aggregation of Base class - does the Derived class need diamond link?

Hi. If, for example, I have the following requirements: 1. Dog is an Animal 2. Zoo has Animal(s) Do I still need the 2nd diamond connector (the lower one) as shown in the image below: https://docs.google.com/drawings/edit?id=1TlnDD8LrqPo-J9_gfHdGm6Y9BpeqC8N-c6Cnc9bPwko&hl=en&authkey=CNLq5bYB Thanks. ...

Why use inheritance at all?

I know the question has been discussed before, but it seems always under the assumption that inheritance is at least sometimes preferable to composition. I'd like to challenge that assumption in hopes of gaining some understanding. My question is this: Since you can accomplish anything with object composition that you can with classical...

Delphi support for Aero Glass and the DoubleBuffered property - what is going on and how do we use them?

I am confused by Delphi 2009/2010 support for the Aero Theme Glass features in Windows, and by what, exactly DoubleBuffered means, and what it has to do with Aero glass. I have found that DoubleBuffered is not only a property in the VCL, it also is found in .net WinForms. Initially I wondered if it set some kind of window style bit use...

Mixins vs composition in scala

In java world (more precisely if you have no multiple inheritance/mixins) the rule of thumb is quite simple: "Favor object composition over class inheritance". I'd like to know if/how it is changed if you also consider mixins, especially in scala? Are mixins considered a way of multiple inheritance, or more class composition? Is there...

Is there a workaround for Composition and Marker Interfaces?

I see myself regularly confronted with the following problem. I have some kind of Marker Interface (for simplicity let's use java.io.Serializable) and several wrappers (Adapter, Decorator, Proxy, ...). But when you wrap a Serializable instance in another instance (which is not serializable) you loose functionality. The same problem occur...

What is composition as it relates to object oriented design?

I hear (and read on this site) a lot about "favour composition over inheritance". But what is Compositon? I understand inheritance from the point of Person : Mammal : Animal, but I can't really see the definition of Compostion anywhere.. Can somebody fill me in? ...

Question on the nature of inherited Java classes

So I think I have a pretty basic question. Say there's an open source Java program called com.cow.moo that you include in your project com.bee.buzz. moo has a bunch of great classes, most of which you don't want to touch, but there are a couple you do. Now at this point, the best thing to do would be to extend the classes you want to mo...

Objective-C classes composition

I'm trying to clarify some of Obj-C classes composition issues. I have 3 classes: Car, Control, and Wheels. Car class initializes Control and Wheels classes. I was going to create a simple test iPhone application containing a UISlider and UILabel. When UISlider value is changed, a message must be sent (I was going to send it from Contr...

How to load data with class composition ?

Hi All, Here are my classes : class PriceScale -int ID -float bookingFees -Product product -List<PricePeriod> periods Class Product -int ID -string name -List<PriceScale> priceScales class PricePeriod -DateTime begin -DateTime end -float price -PriceScale scale As you can see I strictly applied business rules "A product as many pri...

C++ composition with iterator

Hi, I'll try and keep my sample code very straightforward, but it may have errors as I'm typing it on the spot. I have a class named Phone. class Phone { public: Phone(std::string manufacturer, std::string model, std::vector<Feature> features); private: std::vector<Features> features; std::string model; std::string manufactu...

How to know if a Type is MEF composable?

Hello, I often use MEF in my applications but I cannot figure out if there is some way to know if a particular type contains composition members. I could do it easily by retrieving member attributes using reflection but I was wondering if there was already a helper class or something like this which could do this work for me. At least ...

Has-A Relationship

Hi all, public class Elevator () { Button firstFloorbutton = ButtonFactory.getButtonInstance(this, 1); Button secondFloorbutton = ButtonFactory.getButtonInstance(this, 2); Button thirdFloorbutton = ButtonFactory.getButtonInstance(this, 3); Button fourthFloorbutton = ButtonFactory.getButtonInstance(this, 4); Fan fan1 = ...

Recursively (?) compose LINQ predicates into a single predicate.

(EDIT: I have asked the wrong question. The real problem I'm having is over at http://stackoverflow.com/questions/3782940/compose-linq-to-sql-predicates-into-a-single-predicate - but this one got some good answers so I've left it up!) Given the following search text: "keyword1 keyword2 keyword3 ... keywordN" I want to end up with t...