Hi all, Composition vs Inheritance

Hi,All which is better Composition or Inheritance in the realtime issues??
Thanks in Advance,

What does real time have to do with it? Composition can almost always be used where inheritance can, with less tricky side effects
You're welcome in retrospect :-)

Similar Messages

  • Forced non-transparent background for all compositions in certain dimension

    At one point After Effects started to have this background image on all compositions (existing old files to new ones) in 640x1136 dimension.
    Problem is, I'm a UI designer and 80% of my works are in that dimension.
    Funny thing is, if the dimension is a pixel off, then the transparency returns back again. BTW, that background image with shoes is something one of the projects that I'm working on.
    All of my old compositions now have those shoes flashing whenever there's supposed to be transparency and it's just driving me crazy.
    I need to get this thing fixed ASAP. please help!

    Awesome that worked!
    Thanks Tim and Dave for your help, greatly appreciated
    btw, I raised this issue to a few of Adobe Help Chat representatives and they all replied back as "it's a known issue, but there is no fix for it". and none of them were even apologetic about it. Just terse "yes it's a known issue" and when I asked if there is a way to fix it then simple response of "no".
    I understand not all of them could resolve all problems, but Adobe's customer help service is on par with cable and wireless companies'.
    Grateful to have such forum space where there are people willing to help each other. Thanks to Tim and Dave once again. Happy Thanksgiving!

  • Composition versus inheritance

    I am working on a large project with multiple levels of control.  There is a top system level, an intermediate subsystem level, and a low level component.  I am interested in implementing a configuration from a file for all 3 levels.  So, I am contemplating 2 solutions.  This can allow me to edit the config file and not require a recompile of the code.  So here are the options I am thinking about to enable configuration.
    1.  Make a parent class that is "Configurable".  Have the System, Subsystems and Components inherit from this "Configurable" object.  Have dynamic dispatch methods for Read Configuration and Write Configuration, etc.  Define a override method for these for each thing.  This only adds one class to the architecture, but it is the parent of almost everything.
    2  Make a "Configuration" class.  Give each system, subsystem and component a child class of Configuration.  Such that each thing "has a" configuration.  This would add an additional class for every system, subsystem and component.
    Thoughts?
    Casey Lamers
    Phoenix Nuclear Labs
    [email protected]

    Hi,
    extending an Application Module is design best practices in that it allows you to build your own base framework classes and reuse existing code. Nesting an application Module puts it under the same transaction context as the root application module.
    This is a different usecase and thus there no need to decide for one versus the other
    Frank

  • When to use inheritance and When to use Composition

    java support both inheratiance and composition .I also know "is a" and
    "has a realitionship" but there is always a problem with me to understanding whethere i have to use extends or having a object of a class has a member of othere class.
    and also "A pure OOP must support polimorphisim,inheretiance,encapluction,Abstraction and Composition" correct me if i am wrong
    thank you and have a nice day.

    Bruce Eckel, author of Thinking In Java, has this to say about composition vs. inheritance:
    When deciding between inheritance and composition, ask if you need to upcast to the base type. If not, prefer composition (member objects) to inheritance. This can eliminate the perceived need for multiple base types. If you inherit, users will think they are supposed to upcast.
    Choose composition first when creating new classes from existing classes. You should only used inheritance if it is required by your design. If you use inheritance where composition will work, your designs will become needlessly complicated.
    Bill Venners: Composition versus Inheritance
    Use inheritance (of implementation) only when the class satisfies the following criteria:
    1) "Is a special kind of," not "is a role played by a";
    2) Never needs to transmute to be an object in some other class;
    3) Extends rather than overrides or nullifies superclass;
    4) Does not subclass what is merely a utility class (useful functionality you'd like to reuse); and
    5) Within PD: expresses special kinds of roles, transactions, or things.
    -- from Java Design: Building Better Apps and Applets (2nd Edition), by Peter Coad and Mark Mayfield

  • Deleting all instances of a particular composite using scripts

    Hi,
    I am trying to delete all the instances for a particular composite id in Linux. I got some reference to some script in user guide as below
    Deleting Composite Instances, Rejected Messages, and Orphaned Instances
    This procedure internally invokes the procedures for deleting composite instances, rejected messages, and orphaned instances. This procedure is convenient for deleting all composite instances, rejected messages, and orphaned instances in a single invocation.
    FABRIC.DELETE_ALL(FILTER IN INSTANCE_FILTER,
    MAX_INSTANCES IN INTEGER,
    PURGE_PARTITIONED_DATA IN BOOLEAN DEFAULT TRUE) RETURN INTEGER;
    The following example deletes composite instances, rejected messages, and orphaned instances based on the specified filter.
    DECLARE
    FILTER INSTANCE_FILTER := INSTANCE_FILTER();
    MAX_INSTANCES NUMBER;
    DELETED_INSTANCES NUMBER;
    BEGIN
    FILTER.COMPOSITE_PARTITION_NAME:='default';
    FILTER.COMPOSITE_NAME := 'OrderBookingComposite';
    FILTER.COMPOSITE_REVISION := '1.0';
    FILTER.STATE := fabric.STATE_COMPLETED_SUCCESSFULLY;
    FILTER.MIN_CREATED_DATE := to_timestamp('2009-07-01','YYYY-MM-DD');
    FILTER.MAX_CREATED_DATE := to_timestamp('2009-08-24','YYYY-MM-DD');
    MAX_INSTANCES := 100;
    DELETED_INSTANCES := FABRIC.DELETE_ALL(
    FILTER => FILTER,
    MAX_INSTANCES => MAX_INSTANCES
    END;
    But how do I use it. Should I just run @purge_fabric_oracle.sql and will it prompt for parameters. Also Is this the right script to delete all the instances.
    Regards
    Edited by: user5108636 on 22/06/2010 16:53

    For deletion scripts I am particularly cautious. I want to delete all the instances for a particular composite id. How do I get the composite id. ProcessData [1.0] is shown in the EM under the soa application tree. Is it the composite id.
    Thanks

  • Java Programming: Selective Inheritance possible ?

    Hello Java pros,
    I am looking for help on ideas to selectively inherit public methods of a super-class.
    eg.I create a new class z_stack to implement the classic features of the Stack Data Structure, by 'extending' the vector class.
    z_stack has methods push(Object, int), pop(int) and peek(int).
    But because z_stack extends vector, the public methods of vector,
    get(int), insertElementAt(Object, int) & remove(int)
    also get inherited by z_stack.
    Because Stack is, per definition, a "controlled" vector that needs to enforce a LIFO mechanism and to avoid confusion among eqvivalent methods (eg. peek = get), I would like to "suppress"/make-invisible the 'get', 'insertElementAt' and 'remove' methods inherited from vector.
    In other words, I want z_stack to inherit all other properties of vector excluding the methods 'get', 'insertElementAt' and 'remove'.
    Would this be possible ?
    Thanks in advance for your help.
    Sree Nidhi

    fyi -
    #1
    From the book �Core Java 2� Volume II by Cay Horstmann, chapter 2 Collections, Section Stacks
    �However, the Stack class extends the Vector class, which is not satisfactory from a theoretical perspective � you can apply such un-stack-like operations as insert and remove to insert and remove values anywhere, not just the top of the stack.�
    #2
    From the book �Effective Java� by Joshua Block (who designed and implemented the Java Collections Framework), Item 14 Favor Composition Over Inheritance
    "Inheritance is appropriate only in circumstances where the subclass really is a subtype of the superclass"..."It is often the case that B should contain a private instance of A and expose a smaller and simpler API"..."There are a number of violations of this principle in the Java platform libraries. For example, a stack is not a vector, so Stack should not extend Vector."
    ("Java Programming Language" and "Effective Java" have helpful discussions on composition and forwarding.)

  • URGENT: Importing deployed-composites.xml File into MDS

    Gurus,
    I am running into a problem whereby soa-infra application crashes upon server restart.
    This doesn't allow soa_server (managed server) to come up properly.
    I see the following error during server start up:
    <Sep 20, 2011 3:02:18 AM PDT> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'soa-infra'.
    weblogic.application.ModuleException: [HTTP:101216]Servlet: "FabricInit" failed to preload on startup in Web application: "/soa-infra".
    oracle.fabric.common.FabricException: Error in getting XML input stream: oramds:/deployed-composites/default/AttachmentSR_Sample_Composite_rev1.0/SCA-INF/lib/rt.jar: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/deployed-composites/default/AttachmentSR_Sample_Composite_rev1.0/SCA-INF/lib/rt.jar does not exist.
    at oracle.fabric.common.metadata.MetadataManagerImpl.getInputStreamFromAbsoluteURL(MetadataManagerImpl.java:276)
    at oracle.integration.platform.common.MDSMetadataManagerImpl.getInputStreamFromAbsoluteURL(MDSMetadataManagerImpl.java:545)
    at oracle.integration.platform.common.MDSMetadataManagerImpl.transferFile(MDSMetadataManagerImpl.java:820)
    at oracle.integration.platform.common.MDSMetadataManagerImpl.copyTree(MDSMetadataManagerImpl.java:801)
    at oracle.fabric.composite.model.CompositeModel.getClassLoaderFiles(CompositeModel.java:347)
    at oracle.fabric.composite.model.CompositeModel.getCompositeClassloader(CompositeModel.java:203)
    at oracle.integration.platform.kernel.WLSFabricKernelInitializer.deployComposite(WLSFabricKernelInitializer.java:506)
    What I am doing is this: I have added a SCA-INF/lib folder inside the project and added rt.jar file in it. Then I tried to deploy it, deployment did not happen successfully however, it made an entry in MDS as I could see entire composite in MDS along with rt.jar file. Now, when server restarts, it always tries to load the jar file from MDS and for some reason, it doesn't find the jar file despite it being very much in MDS at the correct path.
    Because of this, I ran into a deadlock situation.
    I cannot remove the composite from MDS (using removeSharedData ant task or WLST offline command) as my soa managed server is not up. So, request to http://serverhost:8001 throws 404 error when I use removeSharedData Ant task and WLST offliine sca_undeployCompoiste command. And, this composite entry in MDS doesn't allow the server to start up properly!!
    As another workaround, I've modified deployed-composites.xml file. But without soa-infra listed in EM Console, I cannot import the file.
    Does anyone know how I can import/upload deployed-composites.xml file from outside EM console (and without soa-infra being up!)?
    Thanks-
    Ashish

    If its urgent maybe you can delete the record from all the deployed composites from the Metadata database (you will have to redeploy all of them and you will leave some tush in the content tables).
    connect to the metadata database (XXXXX_MDS schema) configured for that soa_server, you will find a table named MDS_PATHS.
    there you will see all the paths of the files stored in the MDS.
    backup the table and then try
    1) THIS COMMAND DELETE ALL COMPOSITES PAHTS FROM METADATA but it leaves some blob content orphan:
    Execute:
    delete from mds_paths where path_fullname like '/deployed-composites%' and path_fullname <> '/deployed-composites' and path_fullname <> '/deployed-composites/default'; --if you have another partition you can filterit there
    restart the soa_server and the soa-infra will start with no composites. You will have to redeploy them all (but it will come up :).
    I use this method when the soa-infra wont come up because it doesnt found some file on /deployed-composites/.....................
    Anyway, if something goes wrong you can restore the table from your backup ;)
    글 수정: user7691407

  • Assigning an ActionListener to an inherited JButton

    Dear all,
    I have a base JPanel class with a button, a border and not much else. This class is extended by 2 other classes in my application.
    I needed a means of associating an action with the button in my application's main class, so I added a static method addButtonListener to the base class, assuming that once I invoked this, the button would be 'activated' in all the panels inheriting from my base class. addButtonListener() simply invokes the button's addActionListener() method.
    Unfortunately this doesn't work, the ActionListener only gets linked to the button in one of the child classes (the first one that's instantiated).
    What's going on? The code for the base class is below...
    import java.awt.BorderLayout;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import javax.swing.border.CompoundBorder;
    import javax.swing.border.EmptyBorder;
    import javax.swing.border.EtchedBorder;
    import javax.swing.border.TitledBorder;
    public class LoadVolPanel extends JPanel {
         protected JPanel buttonPanel;
         protected static JButton loadButton;
         public static void addButtonListener(ActionListener a) {
              loadButton.addActionListener(a);
         public LoadVolPanel(String title) {
              super();
              setBorder(new CompoundBorder(
                        new TitledBorder(new EtchedBorder(), title), new EmptyBorder(3,
                                  5, 3, 5)));
              loadButton = new JButton("Load surfaces");
              loadButton.setMnemonic('L');
              buttonPanel = new JPanel();
              buttonPanel.add(loadButton);
              setLayout(new BorderLayout());
              add(buttonPanel, BorderLayout.SOUTH);
    }

    I apologise for the amount of the code I've posted but it does compile, and will hopefully show you what I'm trying to do.
    I would like:
    - the Load button to appear at the bottom of each tab in the parent JTabbedPane;
    - the Load button perform the same action in all panes;
    - to be able to assign an action to the Load button from the main class.
    Cheers!
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestClass {
         public class LoadVolPanel extends JPanel {
              protected JPanel buttonPanel;
              protected JButton loadButton;
              public void AddButtonListener(ActionListener a) {
                   loadButton.addActionListener(a);
              public LoadVolPanel(String title) {
                   super();
                   setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(),
                             title), new EmptyBorder(3, 5, 3, 5)));
                   loadButton = new JButton("Load surfaces");
                   loadButton.setMnemonic('L');
                   buttonPanel = new JPanel();
                   buttonPanel.add(loadButton);
                   setLayout(new BorderLayout());
                   add(buttonPanel, BorderLayout.SOUTH);
         public class LogPanel extends LoadVolPanel {
              public LogPanel() {
                   super("Log");
                   JTextArea ta = new JTextArea();
                   ta.setLineWrap(true);
                   ta.setWrapStyleWord(true);
                   ta.setEditable(false);
                   ta.append("The Load Surfaces button below kicks off\n");
                   ta.append("a shell script on a unix box\n");
                   ta.append("Output from the script appears here.\n");
                   JScrollPane scroll = new JScrollPane();
                   scroll.getViewport().add(ta);
                   add(scroll, BorderLayout.CENTER);
         public class LoadPanel extends LoadVolPanel {
              protected JList securitiesList;
              public final int VISIBLE_ROWS = 12;
              private JTabbedPane tabbedPane;
              private CheckListCell[] volCodes = { new CheckListCell("AMP"),
                        new CheckListCell("ALN"), new CheckListCell("ANN"),
                        new CheckListCell("ANZ"), new CheckListCell("ASX"),
                        new CheckListCell("AXA"), new CheckListCell("BNB"),
                        new CheckListCell("BIL"), new CheckListCell("BSL"),
                        new CheckListCell("CBA"), new CheckListCell("CML"),
                        new CheckListCell("CSR"), new CheckListCell("DJS"),
                        new CheckListCell("FOA"), new CheckListCell("FXJ"),
                        new CheckListCell("GNS"), new CheckListCell("GPT"),
                        new CheckListCell("IAG"), new CheckListCell("JHX"),
                        new CheckListCell("LEI"), new CheckListCell("MAP"),
                        new CheckListCell("MBL"), new CheckListCell("MIG"),
                        new CheckListCell("NAB"), new CheckListCell("NWS"),
                        new CheckListCell("NWSLV"), new CheckListCell("ORG"),
                        new CheckListCell("OST"), new CheckListCell("PBG"),
                        new CheckListCell("PBL"), new CheckListCell("PMN"),
                        new CheckListCell("QAN"), new CheckListCell("RIN"),
                        new CheckListCell("RIO"), new CheckListCell("SEV"),
                        new CheckListCell("SGB"), new CheckListCell("SHL"),
                        new CheckListCell("SSX"), new CheckListCell("STO"),
                        new CheckListCell("TAH"), new CheckListCell("TCL"),
                        new CheckListCell("TLS"), new CheckListCell("VBA"),
                        new CheckListCell("WBC"), new CheckListCell("WDC"),
                        new CheckListCell("WMR"), new CheckListCell("WOW"),
                        new CheckListCell("WPL"), new CheckListCell("WSF"),
                        new CheckListCell("ZFX"), new CheckListCell("CCL"), };
              public LoadPanel() {
                   super("Codes");
                   securitiesList = new JList(volCodes);
                   CheckListCellRenderer renderer = new CheckListCellRenderer();
                   securitiesList.setCellRenderer(renderer);
                   securitiesList
                             .setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                   securitiesList.setLayoutOrientation(JList.VERTICAL_WRAP);
                   securitiesList.setVisibleRowCount(VISIBLE_ROWS);
                   JScrollPane ps = new JScrollPane();
                   ps.getViewport().add(securitiesList);
                   JButton refreshButton = new JButton("Refresh Securities List");
                   buttonPanel.add(refreshButton);
                   add(ps, BorderLayout.CENTER);
         public final class CheckListCell {
              private String name;
              private boolean selected;
              public CheckListCell(String name) {
                   this.name = name;
                   selected = false;
              public String getName() {
                   return this.name;
              public void setSelected(boolean selected) {
                   this.selected = selected;
              public void invertSelected() {
                   selected = !selected;
              public boolean isSelected() {
                   return selected;
              public String toString() {
                   return name;
         public final class CheckListener implements MouseListener, KeyListener {
              private LoadPanel parent;
              private JList securitiesList;
              public CheckListener(LoadPanel parentPanel) {
                   parent = parentPanel;
                   securitiesList = parentPanel.securitiesList;
              public void mouseClicked(MouseEvent e) {
                   int index = securitiesList.locationToIndex(e.getPoint());
                   if (index == securitiesList.getSelectedIndex())
                        doCheck();
              public void mousePressed(MouseEvent e) {
              public void mouseReleased(MouseEvent e) {
              public void mouseEntered(MouseEvent e) {
              public void mouseExited(MouseEvent e) {
              public void keyPressed(KeyEvent e) {
                   if (e.getKeyChar() == ' ')
                        doCheck();
              public void keyTyped(KeyEvent e) {
              public void keyReleased(KeyEvent e) {
              private void doCheck() {
                   int index = securitiesList.getSelectedIndex();
                   if (index >= 0) {
                        CheckListCell cell = (CheckListCell) securitiesList.getModel()
                                  .getElementAt(index);
                        cell.invertSelected();
                        securitiesList.repaint();
         public class CheckListCellRenderer extends JCheckBox implements
                   ListCellRenderer {
              private Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
              public CheckListCellRenderer() {
                   setOpaque(true);
                   setBorder(noFocusBorder);
              public Component getListCellRendererComponent(JList list, Object value,
                        int index, boolean isSelected, boolean cellHasFocus) {
                   if (value != null)
                        setText(value.toString());
                   setBackground(isSelected ? list.getSelectionBackground() : list
                             .getBackground());
                   setForeground(isSelected ? list.getSelectionForeground() : list
                             .getForeground());
                   CheckListCell data = (CheckListCell) value;
                   setSelected(data.isSelected());
                   setFont(list.getFont());
                   setBorder((cellHasFocus) ? UIManager
                             .getBorder("List.focusCellHighlightBorder") : noFocusBorder);
                   return this;
         public static void main(String argv[]) {
              JFrame frame = new JFrame("Load Volatility");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(370, 330);
              TestClass myTest = new TestClass();
              JPanel logPanel = myTest.new LogPanel();
              LoadPanel loadPanel = myTest.new LoadPanel();
              JTabbedPane jtp = new JTabbedPane();
              jtp.addTab("Load Volatility", loadPanel);
              jtp.addTab("Log", logPanel);
              frame.getContentPane().add(jtp);
              frame.pack();
              frame.show();
    }

  • Shutdown composite before SOA server goes down or shuts down

    Hi,
    i s there any ways where we can shutdown all the composites in a node before we shutdown SOA Node, and similarly bring up all composites after SOA node is up.
    Shirish

    Hi,
    You can override your python script for SOA server shutdown to include commands to stop Composites.
    Python Script location which is called when you stop your soa_server1
    Oracle/Middleware/user_projects/domains/<domain_name>/shutdown.py
    In case of soa_server1 running as a managed server you would need to check the server name to ensure invocation of script at the right place.
    Example::
    if [ "<server_name>" = "soa_server1" ] ; then
    //Python script to stop composites
    // refer this link for details
    http://docs.oracle.com/cd/E15586_01/web.1111/e13813/custom_soa.htm#CDEEEIAA
    fi
    else
    fi
    Do mark the question as answered in case you see your query resolved.
    Thanks,
    Wajid
    Edited by: Wajid Mehraj on Apr 24, 2013 12:53 AM
    Edited by: Wajid Mehraj on Apr 24, 2013 12:53 AM

  • Inheritance in Java

    I have a little confusion regarding inheritance in Java... or perhaps the general concept... I was trying to write polymorphic code and I encountered this question...
    When a class inherits from another class, all the member variable is supposed to be inherited right? So, if I have something like:
    abstract class super{
    private SomeObject someObj;
    public abstract void foo();
    class sub extends super{
    public void foo(){
    someObj = new SomeObject();
    the class sub does not know about someObj. I tried different visibility for someObj but none worked...
    Something I have not tried, but might as well settle my question with inheritance here, is that if the super class were a concrete class, are all member variables inherited into its subclasses regardless of the member variables' visibility?
    Can someone clear my confusion? Thanx!

    I changed the visibility to protected and then public and it still would not compile... I think there might be something to do with the abstract.
    However, I remember that long time ago (I had this question for a while) I tested the concept with concrete classes and it seems that the private member variable is not inherited...
    That confused me quite a bit because I thought that when a parent class's member variable was private, a sub-class's object has no access to that variable of an instance of the parent class. But the subclass should have inherited it and should have its own copy of that variable. And when the visibility was protected, that's when an object of the subclass has access to that variable of an object of the parent class...
    I think the confusion comes from if visibility is meant for the class or for the instances of the class...

  • Synchronous Composite Services with Immediate Response

    Hi
    The paltform is currently SOA 11.1.1.2.0 which is to be moved to SOA 11.1.1.3.0 once environments are complete
    Essentially I have a requirement by where the way we build some of our composites needs to apply to a certain pattern. This patterm is a synchronous request - response by where an immediate response to the client / calling service is provided. By this I mean a client / service will call a SOA composite, the callled composite will receive the message and reply imemdiately with some tracking information and then the called service will carry on its processing. However in terms of the client / callee service the interaction is complete. (e.g. do not provide further updates).
    The above is an adaptation of Fire and Forget however we desire to pass back some meaningful trascking / support information to the client.
    Following implementation of this in development, we have noticed that the interaction is essentially blocked until all services are complete. Therefore A --> B --> C, even though B has responded to A and then called C, A remains running until all composites are complete
    I'd envisage this is related to transactions and threads etc, however I was wondering if there were any properies thats could be set to alleviate this problem. I have considered using bpel.config.transaction etc.
    Currently placing a checkpoint (by no means ideal) after the reply resolves the issue. Presumeably as this forces dehydration
    Any thoughts would be appreciated
    Regards Dave

    Hello Dave,
    From my point of view, you should pass the message (immediately after receiving) to a intermediate storage (AQ, JMS, FILE/FTP) and then reply back with required info to the client. Let process C poll the intermediate location for incoming messages and perform rest of the processing. So calls will be like -
    A--> B --> Storage (JMS/AQ/FILE/FTP)
    Storage --> C
    Above solution would be good in case the frequency of messages from client is high. I don't know whether it fits in your requirement but this is an option.
    Regards,
    Anuj

  • Type of inheritance

    what is the meaning of type of inheritance.
    What is the importance of Normal inheritance(additive),local value overwrite inherited values,no inheritance and no local redefinition of inherited values.
    can anybody explain in detail.
    Thank you
    Regards,
    Yshu

    Hi. The easiest way to find out is go into a sandbox system and change the types in SM30 and view T77OMATTR and see what the difference is.
    Normal inheritance (additive) means that attributes are inherited and can be added to at lower levels. You get a little + button and can add extra values lower down. If you want to exclude values lower down you need to add the same value and tick the "exclude" option.
    Local values overwrite means that you can not add extra values lower down. You get a replace button and can press it and put in a new value at the lower level, that is all.
    No inheritance means that the attribute is not passed down at all to lower levels.
    Inherited values can not be redefined locally means that the values can not be changed or added to at a lower level. They can be excluded or set as default lower, but not changed.
    Regards,
    Dave.

  • Interfaces instead of multiple inheritance?

    I've read that "The Java programming language does not permit multiple inheritance , but interfaces provide an alternative."
    But I also read contradictory information-There are no method bodies in an interface.
    Java interfaces only contain empty methods? Apparently, if I want to share a method among classes, I have to re-write the methods in each class that implements the interface. That doesn't seem at all like multiple inheritance. Am I missing something?
    It seems that I will have to cut and paste the implementation code from one class to another, and if I change the methods, I have to cut and paste it all over again.
    I've read that interfaces save a lot of time re-writing methods, but how?
    Does this really provide the same capabilities as multiple inheritance, or am I missing something?
    Thanks,
    Pat

    Pat-2112 wrote:
    I've read that "The Java programming language does not permit multiple inheritance , but interfaces provide an alternative."
    But I also read contradictory information-There are no method bodies in an interface. That's not contradictory.
    Inheritance is about type, which interfaces provide. It is NOT about sharing code, which is all that's lacking by not having multiple inheritance of implementation.
    Java interfaces only contain empty methods? Apparently, if I want to share a method among classes, I have to re-write the methods in each class that implements the interface. That doesn't seem at all like multiple inheritance. Am I missing something? Yup. You're missing the point of inheritance, and the fact that delegation allows you to use an implementation defined in one class in another class.
    It seems that I will have to cut and paste the implementation code from one class to another, Nope.
    public interface Cowboy {
      void ride();
      void draw();
    public interface Artist {
      void sculpt();
      void draw();
    public interface CowboyArtist extends Cowboy, Artist {
    public class CowboyImpl implements Cowboy {
      public void ride() {
       System.out.println("Giddyup!");
      public void draw() {
        S.o.p("Bang!");
    public class ArtistImpl implements Artist {
      public void sculpt() {
        S.o.p("Demi Moore in Ghost. Yum!");
      public void draw() {
        S.o.p("Sketch a picture of a gun.");
    public class CowboyArtistImpl implements CowboyArtist { // or implements Cowboy, Artist
      private final Cowboy cowboy = new CowboyImpl();
      private final Artist artist = new AristImpl();
      public void ride() {
        cowboy.ride();
      public void sculpt() {
        artist.sculpt();
      public void draw() { // uh-oh, what do we do here?
        artist.draw();
        cowboy.draw();
    }The draw method is not relevant to this particular question. It's an example of one of the problems with MI, and I just included it since it usually comes up int these discussions anyway. Ride and sculpt demonstrate the point about delegation.

  • Report to list the Single Roles contained in each Composite Role...

    Hi, 
    Can someone tell me how I can produce a report in a 4.6C system that shows the Single rolse contained in all Composite roles?
    Thanks
    Sharon

    Hi Jurjen,
    Thankyou for that.
    Can you also tell me what the difference is between a "Composite role, Indirect (HR)" and a "composite Role"?  (I see these two Activity Group Types when running a report in SUIM to list users and their activity groups).
    Thanks
    S

  • AE Compositions Not Showing in AME

    So I've recently tried to render with ame.
    This never happened before.
    All the folder showed. All compositions shows but about 3 or 4.
    The problem kept getting worst. Now I'm down to no compositions showing, only foldiers. Someone help?
    After Effects CC 2014
    Adobe Media Encoder CC 2014
    This has happened to mac user, but os is windows 64 bit.
    Only folders show up, nothing else.

    FAQ: What information should I provide?
    We don't know what version of Windows you're working with. If it's Windows 7, have you installed the service pack 1 update? If it's Windows 8, what version is it? 8.2?
    We don't know what version of CC 2014 you're running for AE or the AME. Is your After Effects version 13.2.0.49?
    Screenshots would be helpful to demonstrate what you're seeing.
    A more detailed description of the steps you're taking wouldn't hurt either.

Maybe you are looking for