Composition vs Delegation

Hi,
Composition is about the relationships between objects.
Delegation is about passing work from one object to another.
So both are different.
Example for Delegation:-
class RealPrinter { // the "delegate"
void print() {
System.out.print("something");
class Printer { // the "delegator"
RealPrinter p = new RealPrinter(); // create the delegate
void print() {
p.print(); // delegation
public class Main {
// to the outside world it looks like Printer actually prints.
public static void main(String[] args) {
Printer printer = new Printer();
printer.print();
The same example also denotes composition as well as where are not using inheritance for RealPrinter class as we are creating an instance of it in the Printer class
and making use of its method. Please correct me if i have gone wrong . If not please let me know how we can use composition in the above example.
Thanks.

Composition is about the relationships between objects.Composition is about what objects are used to compose another object.
Delegation is about passing work from one object to another.Correct.
So both are different.And from each other :-| at the same time :-)
please let me know how we can use composition in the above example.You have done so. However composition doesn't imply that any of the sub-objects performs work on behalf of the containing object.

Similar Messages

  • LVOOP composition and delegates

    LVOOP doesn't support multiple inheritance, deciding instead to favour composition and aggregation (which happens to coincide with the "Gang of four" IIRC).
    When we are working with composition (An object contains sub-objects for some or all of its functionality) when do we start to talk about delegates?  At what stage does a sub-object of any of my given classes become a delegate?  Are there any guidelines as to what is a delegate and what not?
    If I have a Class A which exposes Methods 1,2,3,4 and 5 to the outside world I may choose to use Class B (or a derivative class) to implement Methods 3,4,and 5.  When does this class become a delegate?
    Shane.
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

    Nickerbocker wrote:
    Could you explain more what about LVOOP not supporting multiple inheritance and why that is keeping you from accomplishing something?
    The way you describe delegation sounds right to me.  I do Composition and Delegation all the time in my LVOOP designs.  It is good to be on the same page when discussing what we call these patterns.  That being said, I read design pattern books to get my OOP juices flowing.  Not necessarily to look for exact solutions because they tend to be too generatlized to be directly applicable to a lot of real world problems.
    The lack of multiple inheritance is not keeping me from accomplishing anything at all.  I fully agree with AQ that anything which can be done with multiple inheritance can also be done with compositing.  I was just a little unclear as to when an object becones a delegate.
    Shane.
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • To subclass, or not to subclass? That is the question.

    I have a comand bar built from Command objects. The Command knows how to display itself (flat, then raised w/mouseOver, depressed w/mousePressed...). The command bar may be either an icon bar or a menu bar - the Command knows about icons, text names, tooltip text and so on.
    The icon bar is simpler in its painting (just icon). The menu shows icon (if any) name, shortcut, . . . So should I have a CommandBar class that knows how to display itself in two skins? Or should I have a MenuBar that extends IconBar? Or a MenuBar and an IconBar that both extend CommandBar?
    More generally, given close siblings when should you choose a single class with options and when should you subclass? (Assume that the single class is not so big that division is a practical necessity.)

    You can always use the Decorator (GoF) pattern. Look at what Sun did with collections. You have List (and ArrayList, etc.). There is also a method in Collections: synchronizedList(). That 'wraps' the normal list with a decorator that provides synchronization. For your application, take the 'base' functionality and add a decorator for paint() and fire().
    As far as general design principles, I follow something that is probably not an accepted standard: I only sub-class abstract classes. Sometimes, you get a non-sensical design, such as:
    AbstractButton
    DefaultButton extends AbstractButton (with only a constructor)
    ComplicatedButton extends AbstractButton (with constructor and extra methods)
    Now, from an efficiency perspective, it would probably be best to collapse AbstractButton into DefaultButton and have ComplicatedButton extend that class. However, I have been on too many projects where someone wants to create a hierarchy n levels deep (usually more than three). The problem is that tihs 'freezes' your design, as you can only inherit from a single superclass.
    So, my general solution to this is to have only one level of inheritance, and that inheritance only occurs from an abstract parent. For the remainder of the design, I use interfaces, composition and delegation liberally. This allows the most 'freedom' in your hierarchy without any loss in functionality.
    For example, why inherit from a concrete class when you can simply declare an interface, make a helper that implements that interface's methods and then delegate calls to the helper in subclasses? I now am only inheriting from Object, which allows me, in the future, to inherit from a Java class or my own abstract class.
    That probably did not help answer your question. But that's generally how I approach things. Caveat implementor: other designs may be equally valid.
    - Saish

  • Protected Methods in Interfaces

    Why don't interfaces allow you to declare protected methods? Is there a way around this?
    The reason I ask involves a current project of mine. I have an inheritance hierarchy including an abstract Event base class with many concrete derived Events. I want to define many protected methods in the base Event class, which all my derived Events will use, in order to save me a lot of coding. I'm also trying to make my program reusable, and isolate the protocol changes to this Event hierarchy and a Packet hierarchy as well. For both these hierarchies, I want to implement interfaces that make sure that the programmer defines these necessary, protected methods. Yet I cannot declare protected methods in my interfaces!

    > I have this same desire: to have protected
    methods within interfaces.
    Interfaces are not intended to (nor can they) provide
    implementation.Yes, this is clear. Yet they "promise" an implementation. In the Java interface model, they only promise the public interface. I have yet to see why they cannot promise protected methods. I'm not really interested in code inheritance (reusing the code). I'm interested in what is called interface inheritance to achieve certain polymorphic goals.
    >
    > any design patterns that can be used to get
    around this problem.
    I'd suggest using composition rather than
    inheritance. Let me know if I should explain
    further.
    Yes, I understand about composition (or delegation) as a way to "inherit" the functionality; however, I want to treat the subclasses polymorphically. I'm designing class library/frameworks that require a certain level of structure. The subclasses need to maintain the encapsulation provided by protected methods. I don't want external clients calling the protected methods, but the only way to achieve multiple (interface) inheritance is through Java's public interfaces, which then exposes the methods. I see no way around this problem. I'm not familar with the technical challenges of implementing multiple inheritance within compilers etc. At first glance, I don't see why allowing methods to be declared protected within the Java interface construct would cause serious technical problems.
    ~
    P.S. Yes, this is an old thread...
    Sorry, yes this is an old thread. I did some searching on this topic and this thread came up. Thanks for your reply.

  • Overloading hassle with no args, different return types

    We're trying to create a document object that can be parsed from XML with xerces and then used as the model for a jtree and a styled-text editor. That means we want to:
    1. subclass stuff from org.w3c.dom
    2. implement interfaces from javax.swing.tree
    3. implement interfaces from javax.swing.text
    We figured that since they all represent similar tree structures, this would be a nice and clever thing to do.
    Hit a snag this morning:
    * org.w3c.dom.Node.getAttributes() returns NamedNodeMap
    * javax.swing.text.Element.getAttributes() returns AttributeSet
    So, our class gets a compile error on the conflicting return types for what it thinks is the same method.
    Any suggestions for what to do? Abandoning xerces isn't an option, and rewriting styled text ourselves isn't practial either.
    --Chris (invalidname)

    This is the problem with multiple inheritance. In C++, the problem is more pronounced because you can inherit two implmentations of the same method.
    In Java, whenever you inherit two methods with the same signature, even if the return types are the same, you have a similar problem. These two methods will likely have two different contracts, and you cannot fulfuill both contracts with one method.
    Example:
    interface Graphical { /** Draw object on screen */ void draw() { } }
    interface CardDeck { /** Draw a card */ void draw() { } }
    class CardGame implements Graphical, CardDeck { /** ??? */ void draw() { } }It is unfortunate that you're inheriting two different getAttributes() methods. You'll have to use composition and delegation instead of inheritance to get around the problem.

  • /sbin/init high CPU usage (80%)

    My PC run slowly, I viewed the processes by htop utility and it revealed that /sbin/init has a constantly high CPU usage, around 70-80%. I scanned it with clamscan virus scanner, but not infected. What can I do to fix this problem?

    Did you mean "ps -ef" ? Then:
    UID PID PPID C STIME TTY TIME CMD
    root 1 0 8 Sep22 ? 08:27:41 /usr/lib/systemd/systemd --system --deserialize 131
    root 2 0 0 Sep22 ? 00:00:00 [kthreadd]
    root 3 2 0 Sep22 ? 00:45:38 [ksoftirqd/0]
    root 5 2 0 Sep22 ? 00:00:00 [kworker/0:0H]
    root 7 2 0 Sep22 ? 00:05:10 [rcu_preempt]
    root 8 2 0 Sep22 ? 00:00:03 [rcu_sched]
    root 9 2 0 Sep22 ? 00:00:00 [rcu_bh]
    root 10 2 0 Sep22 ? 00:00:02 [migration/0]
    root 11 2 0 Sep22 ? 00:00:01 [watchdog/0]
    root 12 2 0 Sep22 ? 00:00:01 [watchdog/1]
    root 13 2 0 Sep22 ? 00:00:02 [migration/1]
    root 14 2 0 Sep22 ? 00:54:35 [ksoftirqd/1]
    root 16 2 0 Sep22 ? 00:00:00 [kworker/1:0H]
    root 17 2 0 Sep22 ? 00:00:00 [khelper]
    root 18 2 0 Sep22 ? 00:00:00 [kdevtmpfs]
    root 19 2 0 Sep22 ? 00:00:00 [netns]
    root 20 2 0 Sep22 ? 00:00:00 [khungtaskd]
    root 21 2 0 Sep22 ? 00:00:00 [writeback]
    root 22 2 0 Sep22 ? 00:00:00 [ksmd]
    root 23 2 0 Sep22 ? 00:00:52 [khugepaged]
    root 24 2 0 Sep22 ? 00:00:00 [crypto]
    root 25 2 0 Sep22 ? 00:00:00 [kintegrityd]
    root 26 2 0 Sep22 ? 00:00:00 [bioset]
    root 27 2 0 Sep22 ? 00:00:00 [kblockd]
    root 30 2 0 Sep22 ? 00:05:54 [kswapd0]
    root 31 2 0 Sep22 ? 00:00:00 [fsnotify_mark]
    root 35 2 0 Sep22 ? 00:00:00 [kthrotld]
    root 36 2 0 Sep22 ? 00:00:00 [ipv6_addrconf]
    root 37 2 0 Sep22 ? 00:00:00 [deferwq]
    root 63 2 0 Sep22 ? 00:00:00 [khubd]
    root 64 2 0 Sep22 ? 00:00:00 [firewire]
    root 65 2 0 Sep22 ? 00:00:00 [firewire_ohci]
    root 66 2 0 Sep22 ? 00:00:00 [ata_sff]
    root 68 2 0 Sep22 ? 00:00:00 [scsi_eh_0]
    root 69 2 0 Sep22 ? 00:00:00 [scsi_tmf_0]
    root 70 2 0 Sep22 ? 00:00:00 [scsi_eh_1]
    root 71 2 0 Sep22 ? 00:00:00 [scsi_tmf_1]
    root 74 2 0 Sep22 ? 00:00:00 [scsi_eh_2]
    root 75 2 0 Sep22 ? 00:00:00 [scsi_tmf_2]
    root 76 2 0 Sep22 ? 00:00:00 [scsi_eh_3]
    root 77 2 0 Sep22 ? 00:00:00 [scsi_tmf_3]
    root 88 2 0 Sep22 ? 00:01:22 [kworker/0:1H]
    root 89 2 0 Sep22 ? 00:00:00 [scsi_eh_4]
    root 90 2 0 Sep22 ? 00:00:00 [scsi_tmf_4]
    root 91 2 0 Sep22 ? 00:00:07 [usb-storage]
    root 99 2 0 Sep22 ? 00:00:00 [kworker/1:1H]
    root 101 2 0 Sep22 ? 00:00:27 [jbd2/sda1-8]
    root 102 2 0 Sep22 ? 00:00:00 [ext4-rsv-conver]
    root 130 1 0 Sep22 ? 00:08:22 /usr/lib/systemd/systemd-journald
    root 145 2 0 Sep22 ? 00:00:00 [rpciod]
    root 147 2 0 Sep22 ? 00:00:00 [nfsiod]
    root 163 1 0 Sep22 ? 00:00:00 /usr/lib/systemd/systemd-udevd
    root 221 2 0 Sep22 ? 00:00:00 [kpsmoused]
    root 243 1 1 Sep22 ? 01:39:24 /sbin/mount.ntfs-3g /dev/sda2 /mnt/ntfs -n -o rw,uid=1000,gid=100,dmask=022,fmask=133
    root 251 1 0 Sep22 ? 00:00:34 /usr/lib/systemd/systemd-logind
    dbus 253 1 0 Sep22 ? 00:02:38 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
    root 254 1 0 Sep22 ? 00:02:32 /usr/bin/haveged -w 1024 -v 1
    root 255 1 0 Sep22 ? 00:00:00 /usr/bin/dhcpcd -q -b
    rpc 258 1 0 Sep22 ? 00:00:00 /usr/bin/rpcbind -w
    root 288 1 0 Sep22 ? 00:00:13 /usr/bin/NetworkManager --no-daemon
    root 295 1 0 Sep22 ? 00:00:00 /usr/sbin/rpc.idmapd
    root 330 2 0 Sep22 ? 00:00:00 [cfg80211]
    polkitd 333 1 0 Sep22 ? 00:00:09 /usr/lib/polkit-1/polkitd --no-debug
    tor 436 1 0 Sep22 ? 00:03:27 /usr/bin/tor -f /etc/tor/torrc
    privoxy 438 1 0 Sep22 ? 00:00:00 /usr/bin/privoxy --pidfile /run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config
    root 445 1 0 Sep22 ? 00:00:00 /usr/sbin/rpc.statd --no-notify
    root 449 1 0 Sep22 ? 00:00:00 /usr/sbin/rpc.mountd
    root 466 2 0 Sep22 ? 00:00:00 [nfsv4.0-svc]
    root 500 1 0 Sep22 ? 00:00:00 /usr/sbin/lxdm-binary
    root 503 500 6 Sep22 tty7 06:37:07 /usr/bin/Xorg.bin :0 vt07 -nolisten tcp -novtswitch
    root 1755 500 0 Sep22 ? 00:00:00 /usr/lib/lxdm/lxdm-session
    walaki 1756 1 0 Sep22 ? 00:00:00 /usr/lib/systemd/systemd --user
    walaki 1757 1756 0 Sep22 ? 00:00:00 (sd-pam)
    walaki 1763 1755 0 Sep22 ? 00:00:00 /bin/sh /etc/xdg/xfce4/xinitrc -- /etc/X11/xinit/xserverrc
    walaki 1773 1 0 Sep22 ? 00:00:00 dbus-launch --sh-syntax --exit-with-session
    walaki 1774 1 0 Sep22 ? 00:00:21 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
    walaki 1781 1763 0 Sep22 ? 00:00:46 xfce4-session
    walaki 1784 1 0 Sep22 ? 00:00:00 /usr/lib/xfce4/xfconf/xfconfd
    walaki 1789 1 0 Sep22 ? 00:00:16 /usr/bin/gpg-agent --sh --daemon --enable-ssh-support --write-env-file /home/walaki/.cache/gpg-agent-info
    walaki 1792 1781 0 Sep22 ? 00:01:54 xfwm4 --display :0.0 --sm-client-id 23fec2b63-e849-4a72-8ded-64b47902bd41
    walaki 1795 1781 0 Sep22 ? 00:00:35 Thunar --sm-client-id 2d0147b28-0a91-4a3b-a669-064fc26ae553 --daemon
    walaki 1797 1781 0 Sep22 ? 00:09:43 xfce4-panel --display :0.0 --sm-client-id 247d7309b-f81b-4064-adbd-0875fed923d4
    walaki 1798 1781 0 Sep22 ? 00:00:18 xfdesktop --display :0.0 --sm-client-id 2e572e480-670a-4c6f-af62-2339f19929ef
    walaki 1799 1 0 Sep22 ? 00:00:36 xfsettingsd --display :0.0 --sm-client-id 26269b48e-af0b-4399-b385-5305502e24f1
    walaki 1802 1781 1 Sep22 ? 01:24:09 /usr/lib/skype/skype -session 21d1f7d38-8c0a-41de-98b7-021e4f2a5bd7_1410900031_251500
    walaki 1803 1781 0 Sep22 ? 00:00:06 kruler -session 20c051002-8d7b-4c2c-bf0b-c384f149b9b5_1410900031_629257
    walaki 1806 1 0 Sep22 ? 00:00:01 xfce4-power-manager --restart --sm-client-id 2154ad16d-be90-40bc-8354-c2647728cf16
    walaki 1810 1 0 Sep22 ? 00:00:00 /usr/lib/gvfs/gvfsd
    walaki 1823 1 0 Sep22 ? 00:00:00 /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
    walaki 1825 1797 0 Sep22 ? 00:00:02 /usr/lib/xfce4/panel/wrapper /usr/lib/xfce4/panel/plugins/libsystray.so 6 14680094 systray Notification Area Area where notification icons appear
    walaki 1833 1797 0 Sep22 ? 00:00:07 /usr/lib/xfce4/panel/wrapper /usr/lib/xfce4/panel/plugins/libmixer.so 15 14680095 mixer Audio Mixer Adjust volume levels
    walaki 1834 1797 0 Sep22 ? 00:44:27 /usr/lib/xfce4/panel/wrapper /usr/lib/xfce4/panel/plugins/libweather.so 16 14680096 weather Weather Update Show current weather conditions
    walaki 1835 1797 0 Sep22 ? 00:46:02 /usr/lib/xfce4/panel/wrapper /usr/lib/xfce4/panel/plugins/libsystemload.so 17 14680097 systemload System Load Monitor Monitor CPU load, swap usage and memory footprint
    walaki 1836 1797 0 Sep22 ? 00:00:03 /usr/lib/xfce4/panel/wrapper /usr/lib/xfce4/panel/plugins/libactions.so 2 14680098 actions Action Buttons Log out, lock or other system actions
    walaki 1841 1797 0 Sep22 ? 00:00:03 /usr/lib/xfce4/panel/wrapper /usr/lib/xfce4/panel/plugins/libthunar-tpa.so 8 14680102 thunar-tpa Trash Applet Display the trash can
    walaki 1843 1 0 Sep22 ? 00:00:04 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
    walaki 1846 1 0 Sep22 ? 00:00:03 /usr/lib/gvfs/gvfsd-trash --spawner :1.9 /org/gtk/gvfs/exec_spaw/0
    root 1856 1 0 Sep22 ? 00:00:00 /usr/lib/upower/upowerd
    root 1857 1 0 Sep22 ? 00:02:10 /usr/lib/udisks2/udisksd --no-debug
    walaki 1862 1 0 Sep22 ? 00:09:10 kwooty -session 2fc05dbf4-9492-4cf1-bd80-efe7e47dfb90_1410900031_251208
    walaki 1895 1 0 Sep22 ? 00:00:00 /usr/lib/GConf/gconfd-2
    walaki 1904 1 0 Sep22 ? 00:00:05 /usr/bin/python2 /usr/bin/glipper
    walaki 1907 1 0 Sep22 ? 00:00:06 nm-applet
    walaki 1922 1 0 Sep22 ? 00:00:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
    walaki 1926 1922 0 Sep22 ? 00:00:25 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
    walaki 1930 1 0 Sep22 ? 00:00:03 /usr/lib/evolution/3.12/evolution-alarm-notify
    walaki 1936 1 1 Sep22 ? 01:59:26 firefox
    walaki 1938 1 0 Sep22 ? 00:01:08 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
    walaki 2023 1 0 Sep22 ? 00:00:00 /usr/lib/evolution-data-server/evolution-source-registry
    walaki 2043 1 0 Sep22 ? 00:00:25 /usr/lib/gnome-online-accounts/goa-daemon
    walaki 2058 1 0 Sep22 ? 00:00:01 /usr/lib/evolution-data-server/evolution-calendar-factory
    walaki 2084 1 0 Sep22 ? 00:00:00 kdeinit4: kdeinit4 Runnin e
    walaki 2089 2084 0 Sep22 ? 00:00:00 kdeinit4: klauncher [kdei e
    walaki 2101 1 0 Sep22 ? 00:00:06 kdeinit4: kded4 [kdeinit]
    walaki 5752 1 0 Sep22 ? 00:00:01 /usr/bin/gnome-keyring-daemon --start --foreground --components=secrets
    walaki 5887 1789 0 Sep22 ? 00:01:01 scdaemon --multi-server
    walaki 7557 11505 0 11:19 pts/8 00:00:00 /bin/bash
    walaki 8876 19571 0 12:04 pts/4 00:00:03 mc
    walaki 8878 8876 0 12:04 pts/9 00:00:00 bash -rcfile .bashrc
    root 10950 2 0 18:10 ? 00:00:02 [kworker/u4:1]
    walaki 10953 18727 0 18:10 pts/6 00:00:04 mc
    walaki 10955 10953 0 18:10 pts/7 00:00:00 bash -rcfile .bashrc
    walaki 11492 1797 0 Sep23 ? 00:02:06 /usr/bin/python2 /usr/bin/terminator
    walaki 11504 11492 0 Sep23 ? 00:00:00 gnome-pty-helper
    walaki 11505 11492 0 Sep23 pts/8 00:00:00 /bin/bash
    walaki 12283 1797 0 13:19 ? 00:00:26 /usr/bin/python2 /usr/bin/terminator
    walaki 12299 12283 0 13:19 ? 00:00:00 gnome-pty-helper
    walaki 12300 12283 0 13:19 pts/1 00:00:00 /bin/bash
    walaki 12707 1797 0 13:23 ? 00:02:59 geany
    walaki 12713 12707 0 13:23 ? 00:00:00 gnome-pty-helper
    walaki 12714 12707 0 13:23 pts/11 00:00:00 /bin/bash
    walaki 13471 1797 0 18:31 ? 00:00:18 /usr/bin/python2 /usr/bin/terminator
    walaki 13487 13471 0 18:31 ? 00:00:00 gnome-pty-helper
    walaki 13488 13471 0 18:31 pts/3 00:00:00 /bin/bash
    walaki 13751 13488 0 18:33 pts/3 00:00:00 /bin/bash
    walaki 16906 1797 46 13:59 ? 04:12:08 /usr/lib/opera-next/opera-next
    walaki 18711 1797 0 Sep23 ? 00:05:05 /usr/bin/python2 /usr/bin/terminator
    walaki 18726 18711 0 Sep23 ? 00:00:00 gnome-pty-helper
    walaki 18727 18711 0 Sep23 pts/6 00:00:00 /bin/bash
    walaki 19550 1797 0 Sep22 ? 00:01:48 /usr/bin/python2 /usr/bin/terminator
    walaki 19570 19550 0 Sep22 ? 00:00:00 gnome-pty-helper
    walaki 19571 19550 0 Sep22 pts/4 00:00:00 /bin/bash
    walaki 21931 23464 3 20:17 ? 00:04:59 /opt/google/chrome/chrome --type=renderer --lang=en-US --force-fieldtrials=AutoReloadExperiment/Enabled/ChromeSuggestions/Most Likely with Kodachrome/ExtensionInstallVerification/None/OmniboxBundledExperimentV1/StandardR4/Prerender/PrerenderEnabled/PrerenderFromOmnibox/OmniboxPrerenderEnabled/PrerenderLocalPredictorSpec/LocalPredictor=Disabled/SPDY/SpdyDisabled/SettingsEnforcement/no_enforcement/Test0PercentDefault/group_01/UMA-Dynamic-Binary-Uniformity-Trial/default/UMA-New-Install-Uniformity-Trial/Experiment/UMA-Population-Restrict/normal/UMA-Session-Randomized-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-1-Percent/group_22/UMA-Uniformity-Trial-10-Percent/group_05/UMA-Uniformity-Trial-100-Percent/group_01/UMA-Uniformity-Trial-20-Percent/group_03/UMA-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-50-Percent/default/VoiceTrigger/Install/ --renderer-print-preview --enable-offline-auto-reload --enable-threaded-compositing --enable-delegated-renderer --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --channel=23445.24.769536197
    walaki 22985 23464 0 20:39 ? 00:00:55 /opt/google/chrome/chrome --type=renderer --lang=en-US --force-fieldtrials=AutoReloadExperiment/Enabled/ChromeSuggestions/Most Likely with Kodachrome/ExtensionInstallVerification/None/OmniboxBundledExperimentV1/StandardR4/Prerender/PrerenderEnabled/PrerenderFromOmnibox/OmniboxPrerenderEnabled/PrerenderLocalPredictorSpec/LocalPredictor=Disabled/SPDY/SpdyDisabled/SettingsEnforcement/no_enforcement/Test0PercentDefault/group_01/UMA-Dynamic-Binary-Uniformity-Trial/default/UMA-New-Install-Uniformity-Trial/Experiment/UMA-Population-Restrict/normal/UMA-Session-Randomized-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-1-Percent/group_22/UMA-Uniformity-Trial-10-Percent/group_05/UMA-Uniformity-Trial-100-Percent/group_01/UMA-Uniformity-Trial-20-Percent/group_03/UMA-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-50-Percent/default/VoiceTrigger/Install/ --renderer-print-preview --enable-offline-auto-reload --enable-threaded-compositing --enable-delegated-renderer --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --channel=23445.25.841939391
    walaki 23052 23464 2 20:40 ? 00:03:57 /opt/google/chrome/chrome --type=ppapi --channel=23445.26.1843768387 --ppapi-flash-args --lang=en-US
    walaki 23445 1 3 15:02 ? 00:16:57 /opt/google/chrome/chrome
    walaki 23453 23445 0 15:02 ? 00:00:05 /opt/google/chrome/chrome --type=sandbox-ipc
    walaki 23454 23445 0 15:02 ? 00:00:00 /opt/google/chrome/chrome-sandbox /opt/google/chrome/chrome --type=zygote
    walaki 23455 23454 0 15:02 ? 00:00:00 /opt/google/chrome/chrome --type=zygote
    walaki 23461 23455 0 15:02 ? 00:00:00 /opt/google/chrome/chrome-sandbox /opt/google/chrome/nacl_helper
    walaki 23462 23461 0 15:02 ? 00:00:00 /opt/google/chrome/nacl_helper
    walaki 23464 23455 0 15:02 ? 00:00:00 /opt/google/chrome/chrome --type=zygote
    walaki 23484 23445 0 15:03 ? 00:00:04 /opt/google/chrome/chrome --type=gpu-process --channel=23445.0.587379006 --supports-dual-gpus=false --gpu-driver-bug-workarounds=1,14,20,23,43 --disable-accelerated-video-decode --gpu-vendor-id=0x10de --gpu-device-id=0x0322 --gpu-driver-vendor --gpu-driver-version
    walaki 23672 23464 0 15:04 ? 00:01:06 /opt/google/chrome/chrome --type=renderer --lang=en-US --force-fieldtrials=AutoReloadExperiment/Enabled/ChromeSuggestions/Most Likely with Kodachrome/ExtensionInstallVerification/None/OmniboxBundledExperimentV1/StandardR4/Prerender/PrerenderEnabled/PrerenderFromOmnibox/OmniboxPrerenderEnabled/PrerenderLocalPredictorSpec/LocalPredictor=Disabled/SPDY/SpdyDisabled/SettingsEnforcement/no_enforcement/Test0PercentDefault/group_01/UMA-Dynamic-Binary-Uniformity-Trial/default/UMA-New-Install-Uniformity-Trial/Experiment/UMA-Population-Restrict/normal/UMA-Session-Randomized-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-1-Percent/group_22/UMA-Uniformity-Trial-10-Percent/group_05/UMA-Uniformity-Trial-100-Percent/group_01/UMA-Uniformity-Trial-20-Percent/group_03/UMA-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-50-Percent/default/VoiceTrigger/Install/ --renderer-print-preview --enable-offline-auto-reload --enable-threaded-compositing --enable-delegated-renderer --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --channel=23445.5.858801638
    root 23962 288 0 Sep25 ? 00:00:00 /usr/bin/dhclient -d -sf /usr/lib/networkmanager/nm-dhcp-helper -pf /var/run/dhclient-enp2s8.pid -lf /var/lib/NetworkManager/dhclient-a8966a98-c9d9-4425-9e4d-459c41d83921-enp2s8.lease -cf /var/lib/NetworkManager/dhclient-enp2s8.conf enp2s8
    root 24159 1 0 15:08 tty2 00:00:00 /sbin/agetty --noclear tty2 linux
    root 24165 1 0 15:08 tty3 00:00:00 /sbin/agetty --noclear tty3 linux
    root 24169 1 0 15:08 tty5 00:00:00 /sbin/agetty --noclear tty5 linux
    root 24174 1 0 15:08 tty6 00:00:00 /sbin/agetty --noclear tty6 linux
    walaki 25161 1 2 Sep23 ? 02:22:03 audacious
    root 25840 2 0 21:32 ? 00:00:01 [kworker/1:1]
    walaki 27082 23464 4 21:51 ? 00:02:56 /opt/google/chrome/chrome --type=renderer --lang=en-US --force-fieldtrials=AutoReloadExperiment/Enabled/ChromeSuggestions/Most Likely with Kodachrome/ExtensionInstallVerification/None/OmniboxBundledExperimentV1/StandardR4/Prerender/PrerenderEnabled/PrerenderFromOmnibox/OmniboxPrerenderEnabled/PrerenderLocalPredictorSpec/LocalPredictor=Disabled/SPDY/SpdyDisabled/SettingsEnforcement/no_enforcement/Test0PercentDefault/group_01/UMA-Dynamic-Binary-Uniformity-Trial/default/UMA-New-Install-Uniformity-Trial/Experiment/UMA-Population-Restrict/normal/UMA-Session-Randomized-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-1-Percent/group_22/UMA-Uniformity-Trial-10-Percent/group_05/UMA-Uniformity-Trial-100-Percent/group_01/UMA-Uniformity-Trial-20-Percent/group_03/UMA-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-50-Percent/default/VoiceTrigger/Install/ --renderer-print-preview --enable-offline-auto-reload --enable-threaded-compositing --enable-delegated-renderer --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --channel=23445.29.1207326524
    root 27424 2 0 22:00 ? 00:00:00 [kworker/0:1]
    root 27664 2 0 15:42 ? 00:00:04 [kworker/u4:2]
    root 27769 2 0 22:07 ? 00:00:00 [kworker/1:2]
    walaki 28865 1 0 Sep25 ? 00:00:00 /usr/lib/gvfs/gvfsd-http --spawner :1.9 /org/gtk/gvfs/exec_spaw/1
    walaki 29628 8878 0 22:54 pts/9 00:00:02 /usr/bin/ruby /home/walaki/util/mr1 Nekem az ég - hazafutás
    walaki 29652 23464 0 22:54 ? 00:00:00 /opt/google/chrome/chrome --type=renderer --lang=en-US --force-fieldtrials=AutoReloadExperiment/Enabled/ChromeSuggestions/Most Likely with Kodachrome/ExtensionInstallVerification/None/OmniboxBundledExperimentV1/StandardR4/Prerender/PrerenderEnabled/PrerenderFromOmnibox/OmniboxPrerenderEnabled/PrerenderLocalPredictorSpec/LocalPredictor=Disabled/SPDY/SpdyDisabled/SettingsEnforcement/no_enforcement/Test0PercentDefault/group_01/UMA-Dynamic-Binary-Uniformity-Trial/default/UMA-New-Install-Uniformity-Trial/Experiment/UMA-Population-Restrict/normal/UMA-Session-Randomized-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-1-Percent/group_22/UMA-Uniformity-Trial-10-Percent/group_05/UMA-Uniformity-Trial-100-Percent/group_01/UMA-Uniformity-Trial-20-Percent/group_03/UMA-Uniformity-Trial-5-Percent/group_14/UMA-Uniformity-Trial-50-Percent/default/VoiceTrigger/Install/ --renderer-print-preview --enable-offline-auto-reload --enable-threaded-compositing --enable-delegated-renderer --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --channel=23445.30.161699173
    root 29693 2 0 22:55 ? 00:00:00 [kworker/0:2]
    root 29915 2 0 23:00 ? 00:00:00 [kworker/0:0]
    root 29930 27664 89 23:00 ? 00:00:31 /usr/lib/systemd/systemd-coredump 29431 1000 100 6 1411765249 wavparse1374:si
    walaki 29946 10955 0 23:01 pts/7 00:00:00 ps -ef
    walaki 29948 10955 0 23:01 pts/7 00:00:00 leafpad
    walaki 30148 1 0 Sep23 ? 00:00:00 /usr/lib/dconf/dconf-service
    walaki 30523 1 0 Sep25 ? 00:00:00 /bin/sh /home/walaki/jdownloader/JDLauncher
    walaki 30544 30523 0 Sep25 ? 00:04:54 /usr/lib/jvm/java-default-runtime/bin/java -Dinstall4j.jvmDir=/usr -Dexe4j.moduleName=/home/walaki/jdownloader/JDLauncher -Xmx512m -Xms64m -Dinstall4j.launcherId=26 -Dinstall4j.swt=false -Di4j.vmov=true -Di4j.vmov=true -Di4j.vmov=true -Di4j.vmov=true -Di4j.vmov=true -Di4j.vpt=true -classpath /home/walaki/jdownloader/.install4j/i4jruntime.jar:/home/walaki/jdownloader/JDownloader.jar com.install4j.runtime.launcher.Launcher launch jd.Main true false true true false true true 0 0 20 20 Arial 0,0,0 8 500 version 0.9 20 40 Arial 0,0,0 8 500 -1

  • BSP Extension Composite Element with Body

    Hello,
    I created an own BSP Extension element "myLink" which should be a composite element containing HTMLB:LINK element.
    The myLink-DO_AT_BEGINNING looks like follows:
      DATA: orgLink  TYPE REF TO CL_HTMLB_LINK.
      orgLink = CL_HTMLB_LINK=>FACTORY( id = id
                                      reference = reference
                                      text = text ).
      WHILE m_page_context->element_process( element = orgLink )
        EQ CO_ELEMENT_CONTINUE.
      ENDWHILE.
      rc = CO_ELEMENT_CONTINUE.
    This works fine for  - Tag (coming from DO_AT_END of HTMLB:LINK) is inserted before the body of my element.
    It is possible to add the text "LinkText" as a literal in the WHILE - loop. But: I don´t find a way to do this dynamically! The body of a myExtension:myLink can contain text, images, other BSP elements. How can I access this during runtime so that I can supply the BODY-parameter of method "element_process"? How to do this? Or isn´t this the solution for this problem?
    Maybe I´m to silly to see obvious things. I read a lot of articles about composite BSP elements - but I didn´t find an example handling dynamic or unknown element-bodies.
    Thank you for any help,
    best regards,
    Stefan

    Hi Stefan,
    I understand what you want to achieve - maybe you have to play around with the "delegated" attributes/methods to really achieve what you want using HMTLB:LINK from within your element this way.
    Here is what I did for a similar problem: I created my own tooltip-on-mouseover extension, which can be wrapped around any kind of other elements that are placed in the tooltip element body.
    I also have a special attribute in this element, "contentAsLink". If this attribute is set, I render the opening href HTML tag (<a>) in method DO_AT_BEGINNING, and the closing tag (</a>) in DO_AT_END. Not the best way if you really want to stick with HTMLB everywhere, but it's nice and easy.
    Here is the precise opening tag I use:
    <a class="urLnkFunction" href="javascript:void(0);">
    Hope this helps you to find a solution for your needs.
    Cheers,
    Max

  • How to achieve polymorphisim using composition

    How to achieve polymorphisim using composition

    Not possible. This is very wrong, polymorphism is very much facilitated by Composition (or Aggregation).
    Polymorphism goes hand in hand with
    either imlementing an interface or extending a class.The fundamental objective of Polymorphism is the handling/using Objects of multiple types in a uniform manner, i.e. to a fixed contract.
    Composition may be used to delegate the
    implementation of an interface or subclass' method.Composition allows much more than delegation, it about defining a static contract between two objects.
    composition itself is not polymorphic.The main difference between simple composition and polymorphism is the valence. In Polymorphism it is explicityly 1. .N in the case of composition it is implicitly 0..N
    I think this code proves that a Composition of classes for Odd and Even can be used polymorphically.
    public class Polymorphism {
      abstract public class Base {
        public void method()
          System.out.println( this.getClass().getName() + ".method()" ) ;
      public class Odd extends Base {
      public class Even extends Base {
      final int ARRAY_SIZE = 10;
      Base[] composition = new Base[ARRAY_SIZE] ;
      public Polymorphism() {
        for(int i = 0 ; i < ARRAY_SIZE ; i+=2 )
          composition[i] = new Even() ;
          composition[i+1] = new Odd() ;
      public void process() {
        for(int i = 0 ; i < ARRAY_SIZE ; i++ ) {
          composition.method() ;
    public static void main(String[] args) {
    Polymorphism polymorphism = new Polymorphism();
    polymorphism.process() ;

  • What is the difference between Aggregation and Composition with example

    plz help me to find the difference between Aggregation and Composition with example

    Dear [email protected]:
    Get back to work.
    August 4, 2007 stalin_gnana asked:
    I would like to know the description about 'is a' ,'has a' ..relationship in java.plz reply me to the above doubt if known
    August 8:
    Can any one encounter the clarification on how and where Observer class and Observable interface can be applied..plz answer me
    August 10:
    May you find a solution on why not have the concept of pointer,opterator overloading,virtual function and destructor in java
    (Also August 10):
    I would desire to apprehend the brief description about usage of Singletone class and where it can be applied.plz help me
    Today:
    I am having the doubt of 'is there any relation among Delegation and composition'.if have,plz answer to regarding question.
    And then this thread today too.
    sniff sniff
    I smell a lazy attempt at getting others to do one's homework for him.

  • How do I use edge commons composition loader to load multiple compositions with a next and back button?

    I am working on an interactive book and have set up each page as a separate composition in edge.
    I am using  the edge commons JS library to load multiple compositions into a main composition.
    You can see how this works here: Edge Commons - Extension Library for Edge Animate and Edge Reflow | EdgeDocks.com
    The way the edge commons tutorial is set up requires a button for each composition i want to load. I am interested in loading multiple compositions with a "next" and "back" button, and a "swipe left, "swipe right" gesture on the content symbol that each composition is loaded into. I also need the swipe features on the content symbol not to interfere with the interactive elements on the loaded composition.
    Please suggest a solution that will work without adding additional scripts beyond edge commons and jquery.

    Sort of. I'm using this code inside an action for a button symbol. But it doesn't work perfectly. Trying to debug it.
    Let me know if you have any luck.
    //Check to see if pageCounter already exists
    if (typeof EC.pageCounter === 'undefined') {
      // it doesn't exist so initialize it to first page
        EC.pageCounter = 2;
    //check if the page is only 1 digit -- patch for single digit
    if (EC.pageCounter < 9) {
       // it is, so we need to pad a 0 on the front.
      EC.pageCounterString = "0" + EC.pageCounter;
      //e.g.  01 ...09,11,12,13....115,222352,,....
    else {
      EC.pageCounterString = EC.pageCounter;
    EC.loadComposition(EC.pageCounterString + "/publish/web/" + EC.pageCounterString + ".html", sym.$("container"));
    EC.pageCounter = EC.pageCounter + 1;
    //TODO for back  -1

  • Mini DVI to S-video and composite giving complete distorted output!!

    I tried to hook up my 20" Sony Trinitron either through S-video or composite to the powerbook without any success. I got completely distorted picutre. I have tried all the video resolution setting that is available on the Displays reference window with the same result. Does anybody out there run into this problem at all.

    I have a 12" PowerBook 1.5ghz and had the same problem with garbled video today. When I plugged in the Mini-DVI > Composite/S-Video adapter the PowerBook would consistently think it was attached to an ordinary VGA monitor, and could not sync with the television. This caused a B&W, warped, split in half picture.
    I took the adapter back to the Apple store, plugged it into one of their demo units, and saw it behaved the same way. They gave me a replacement and everything has been fine since.
    QS2002, 1.4ghz, 1gb, GeForce 4 Ti4600, SATA; 12" PB 1.5ghz, 512mb   Mac OS X (10.4.4)  

  • Mini dvi to s-video/composite adapter doesn't seem to work?

    basically i'm trying to hook my rather new 2.53 ghz mac mini to my tv, which basically has rca inputs. so, having seen several laptops hooked to this tv as simply as using an s-video to composite adapter, i figured it would be as simple as getting the mini dvi to composite adapter and i'd be good. well, for some reason this doesn't seem to do anything. the other weird thing is that when i hook the cable from the composite adapter to the tv, i get a buzz out of the speakers as the connection is being made. why is a video signal having anything to do with the audio? plugging my playstation 2 into the same input works fine. why the difference?

    Boece wrote:
    !http://images2.monoprice.com/productmediumimages/47241.jpg!
    +
    !http://images2.monoprice.com/productmediumimages/48501.jpg!
    That's the setup I've used. Works great for video and photos, but webpage text can be difficult to read.
    I used the yellow composite input rather than the s-video. My old tv is inside an “entertainment center” type tv stand and is so friggin heavy, it’s a pain in the axx to move, so I just used the composite plug on the front of my tv. Since the Mac mini is sitting in front of the tv it works great:-)
    http://discussions.apple.com/thread.jspa?threadID=2430645&tstart=0
    Message was edited by: James Press1

  • Does DVI to Video adapter send both s-video and composite simoutanesly?

    Hi,
    I´m wondering if you connect the DVI to Video adapter on the new MacMini (DVI to s-video+composite), does the Mini send BOTH s-video and composite at the same time?
    If connected to TV and projector, I want to see both simotanesly, not neede to change something in the setup...
    The both having same resolution I guess is a must!
    Regards,
    Pat

    Yes, many think, but i´ve havnt heard anyone whoose sure?! Can´t be such a odd thing, connect a Mini to two displays at same same time...

  • Mini-DVI to Video (composite or S-Video), can't get it to work

    hi guys,
    I got a MacBook (bought in Japan) and a mini-DVI to Video adapter (Bought in Canada recently).
    I am trying to watch TV, but I am getting a very bad b&w image (as if I was watching using a very old antenna).
    I changed the display resolution to the lowest option 640x480 (60Mhz) (Actually I tried every single resolution)
    I tried both the yellow composite cable or the S-Video to yellow composite cable but both produce the exact same image.
    I am out of ideas, I have a feeling that it's trying to send a PAL signal on a NTSC television (Is that even possible?)
    Any suggestions are highly appreciated.
    Many thanks
    ps. I'm running on Leopard
    ps2. My TV is not old, it's a pretty decent Toshiba

    I found this:
    QUOTE
    Thanks guys for your help, I actually found some advice from this website
    http://forums.macrumors.com/showthread.php?t=101628
    Success!
    Here is the content below from the site, tricky to find if your a novice like me!;
    Indeed there is.
    1.First connect the DVI cable, so the Powerbook switches to multiple display.
    2. Launch system preferences>display
    3. There should now be 3 tabs on the top (Display, Arrangement,Color). Select the 'Arrangement' tab.
    4. Check the 'Mirror Displays' box. The Powerbook display will reset to mirror mode.
    5. When the display settles, pull out the dvi cable, let it settle and plug it in again.
    6. You should now see two dialogs, Color LCD and NTSC/PAL.
    7. Select the resolution you want on the Color LCD dialog.
    8. Select to bring to front the NTSC/PAL dialog and you will see the Refresh rate drop down list available for 50 Hertz(PAL) selection.
    Looks quite bothersome but works for me. Was trying to record game session on a PAL camcorder and stumbled on your discussion while looking for solutions, found it while meddling the Preferences. Thought I'd share it even though it's been some time. Happy New Year.
    END QUOTE
    Hope that helps!

  • Connect macbook to composite tv

    Hi there,
    I have a macbook (2009) model that I want to connect to a composite tv. I think the Apple Mini-DVI to Video Adapter will not work as it states on the mac site that "This adapter is not compatible with the 2.0GHz Intel Core 2 Duo white MacBook introduced in January 2009."
    Any ideas?
    Thanks

    Mort,
    The article only indicates the ability to output video via DVI and VGA. There is no mention for Composite.
    This article (for a late-2007 MacBook) does indicate compatibility for composite:
    http://support.apple.com/kb/sp12
    The OP may need a different solution, such as this:
    VGA to RCA converter box
    ~Lyssa

Maybe you are looking for

  • Got Mac/Apple Questions? We've Got Experts! HP Expert Day – Nov 6, '13

    Thank you for coming to Expert Day – the event has now concluded. **To find out about future HP Expert Day events, check out this page** On behalf of the Experts, I would like to thank you for coming to the Forum to connect with us.  We hope you will

  • Command line rendering using aerender

    I am facing a problem rendering about 200 after effect files using aerender, because i need to specify the comp name for each file. Is there anyway where i can render my files and link them to only one comp, since all the files need to be rendered wi

  • Premiere Pro CS3 crashing on export

    I have been using Premiere Pro CS3 for a while and I assure you I have NEVER touched any export settings, but now it is suddenly crashing on export. There is no error message or anything, the program just turns off. A friend suggested I change the se

  • Running Windows 7, missing iTunes64.msi

    Hello, recently after itunes 10 came out,my computer could not remove itunes or bonjour from the add/remove program files list. When i try to remove both,it says i have to locate a file named iTunes64.msi. I have been looking around the internet to f

  • App that make screen like blackberry

    I'm looking for an app that will display all of the things on my schedule at the front screen like blackberry. you know when u look at a blackberry screen there will be list of what u input just to remind u every time u look at the phone. I don't wan