Interface/class hierarchy and serialization?

Hi,
I have an interface, base class that implements this interface and subclasses derived from base class that also implement this interface.
I also have a method with this interface as an argument. My question is: how to do serialization of this argument in this method without using instanceof operator? Should interface extend Serializable and/or each class/subclass implement Serializable? Is it sufficient to just have common interface extend Serializable without classes/subclasses implementing it?
thanks,
sale

How should I serialize for example if the argument in the method is subclass XYZ? Do I need to use instanceof operator?

Similar Messages

  • Can Forte C++ build the class hierarchy and generate documents?

    Can Forte C++ build the class hierarchy and generate documents?

    Can Forte C++ build the class hierarchy and generate documents?

  • Interface based design and serialization

    Hi,
    I have an interface, base class that implements this interface and subclasses derived from base class that also implement this interface.
    I also have a method with this interface as an argument. My question is: how to do serialization of this argument in this method without using instanceof operator? Should interface extend Serializable and/or each class/subclass implement Serializable? Is it sufficient to just have common interface extend Serializable without classes/subclasses implementing it?
    Thanks,
    sale

    Hi,
    I have an interface, base class that implements this
    interface and subclasses derived from base class that
    also implement this interface.Not required. The subclass by default implements all interfaces implemented by the super class.
    ***every object of type base is also an object of type subclass but not ***vice versa, i.e. if we need an object of subclass then object of base ***will not do: every subclass object is a base object, but not vice versa
    I also have a method with this interface as an
    argument. My question is: how to do serialization of
    this argument in this method without using instanceof
    operator? Should interface extend Serializable and/or
    each class/subclass implement Serializable? Is it
    sufficient to just have common interface extend
    Serializable without classes/subclasses implementing
    it?Yes, making your interface extend Serializable would do, if you are sure
    that all implementations of the interface
    should be serializable. The implementation classes should, ofcourse have all data members serializable (primitive data types and/or serializable objects)
    It would also be a good idea to have the method throw NotSerializableException.
    *** So if I receive as an argument object of type subclass XYZ and ***assuming all implementations ARE serializable, then can I serialize ***this hierarchy by using reference of the interface received as ***parameter in this method?

  • Introspection in Class hierarchy

    Is it possible to have something like this in TOOL/Forte ? I am trying to introspect an Object vertically on its class hierarchy and horizontally on its data members.
    public static String toDesc(Object obj, Class cls)
    Class super_cls = cls.getSuperclass();
    if(super_cls != null)
    spr += toDesc(obj, cls.getSuperclass());
    Field[] fld = cls.getDeclaredFields();
    for(int i=0; i < fld.length; i++)
    try
    spr += "\n<" + fld.getName() + ">" + fld[i].get(obj) + "</" + fld[i].getName() + ">";
    catch(Exception e)
    e.printStackTrace();
    return spr;

    What version of UDS are you using? There are some capabilities for querying classes and set/get values. Check the UDS Programming Guidelines.
    The UDS help states the following that might be helpful for you:
    "...Before you can use the AttributeDesc Get and Set methods for primitive types, you must determine whether or not the type is primitive. The following code fragment accepts an object and determines if the attribute type is or is not primitive. The example also deals with subclasses of DataValue because those classes have some generic methods. The example does not actually retrieve any specific values, but the comments suggest what could be done.
    method Browser.InspectAttribute(
    obj : Object, attName : String)
    begin
    cls : ClassType = obj.GetClassType();
    att : AttributeDesc = cls.GetAttribute(attName);
    typ : ClassType = att.GetType();
    if (typ.IsPrimitive()) then
    // This type is primitive. It can be retrieved
    // (and set) by using one of the Get/Set methods.
    pd : PrimitiveDesc = PrimitiveDesc(typ);
    elseif (typ.IsArray()) then
    // This type is an array type. Determine the element
    // type (if it is set) to make it possible
    // to further inspect the array's elements.
    ad : ArrayDesc = ArrayDesc(typ);
    eType : ClassType = ad.GetElementType(); // Can be NIL
    elseif (typ.IsInterface()) then
    // This type is an interface type. The inspector might
    // further interrogate the real object implementing
    // the interface, like any other object, or
    // do something special when inspecting interfaces.
    else
    // This type is an object type. If the type
    // is a subclass of DataValue you might want to deal
    // with it separately. Otherwise, if it's a simple object
    dvType : ClassType = DataValue;
    if (dvType.IsSuperOf(typ)) then
    // The type is a subclass of DataValue.
    // Once the attribute value is retrieved,
    // its value can be gotten by using the
    // DataValue.TextValue attribute.
    else
    // This is a simple object that, if not
    // NIL, requires further reflection.
    end if;
    end if ;
    end method; ..."
    The key I guess is here"
    "...Getting and setting the value of an attribute that is not a primitive type requires that the application know more about the current object than is necessary if its type is primitive. For example, an attribute of type Boolean might be assumed to have a default value of FALSE. But an attribute of type Array of IntegerData might have as its default value a NIL value or an empty array, or an array with a single IntegerData element initialized to 0.
    To get or set the value of the current attribute when the data type is a class or interface, use the GetValue and SetValue methods. If the data type is a class, specify an object whose class is a subtype of the class. If the data type is an interface, specify an object whose class implements the interface. ..."
    Remember that UDS reflection has been modeled following the Java Reflection Framework but it is not a full implementation of it.
    Let me know if I can be of any further help

  • Traversing and printing class hierarchy

    I'm writing a class exercise that requires taking a class as input and prints our class hierarchy for that class, includeing all the interfaces implemented by it or its superclasses. It should also print out the interfaces that those interfaces extend.
    My thinking here (it's been almost a year since my last Java courses) is calling getInterfaces and getClass, and then using recursion to continually call these and print them out until gatClass returns Object.
    Anybody got some input for me? Am I on the right track?

    I strongly recamend you to read about java.lang.Class in the documentation and you'll find all that you need to do this.

  • Example class that implements Serializable interface

    Dear,
    I have a class myData that I want to implement Serializable interface. class myData has only two fields: Integer iData1, String sData2.
    Could anybody shown me how my myData class should be?
    Thanks a lot!

    Hey, if you have yet to obtain a remote reference from the app server ...then we are into pandora's box. I lost three whole heads of hair getting up on JBoss when I first started. You want to check out the JBoss forums on the JBoss website, and the enterprise javabeans forum here. Search some posts and read the free JBoss manual.
    Unfortunately, there isn't a 'here, do this' solution to getting connected with JBoss. There are quite a few gotcha's. There are descriptors, descriptor syntax ...and this changes between releases so there seems to be alot of people saying 'here, do this' ...but you try and it doesn't work (wrong release). Here are some descriptors that I threw up recently for someone ...a place to start.
    http://forum.java.sun.com/thread.jsp?forum=13&thread=414432
    This drove me nuts until it all worked right. I was stuck for three weeks at one point ...ready to give up, but then I got it. Perservere ...its a nice container for learning in (its free!).
    I will try and watch for you.
    Oh, and put something in your head ...at least then you will keep your hair !
    :)

  • Comparable and Serializable interfaces

    Hi All,
    I have developed a program in java which implements Comparable and Serializable Interfaces. After, I decided to run the program in J2ME. But later on, I found that MIDP doesn't implement these interfaces.
    Some one can help me how to implement my own interfaces.
    Thank you

    Hi Supareno
    I need urgently your help.
    I developed Java program which works as predicitive text system for my mother tongue.I would like to move from Java to J2ME. But until now I have problems. please can u help me. the following code run in command line.
    I tried to develop my own interfaces as you told me but it doesn't work.
    Help me also for reading and writing text files.
    Thank you
    import java.util.*;
    import java.io.*;
    import java.util.Vector;
    import java.util.Enumeration;
    public class PredText {
    private Vector dict;
    public static final String dictionaryFile = "C:/java/words.txt";
    // convert a string to the corresponding signature
    public static String toNumeric (String word) {
    String lowerWord = word.toLowerCase();
    StringBuffer result = new StringBuffer("");
    for (int i = 0; i < lowerWord.length(); i++) {
    char c = lowerWord.charAt(i);
    if ("abc".indexOf(c) > -1) result.append("2");
    else if ("def".indexOf(c) > -1) result.append("3");
    else if ("ghi".indexOf(c) > -1) result.append("4");
    else if ("jkl".indexOf(c) > -1) result.append("5");
    else if ("mno".indexOf(c) > -1) result.append("6");
    else if ("pqrs".indexOf(c) > -1) result.append("7");
    else if ("tuv".indexOf(c) > -1) result.append("8");
    else if ("wxyz".indexOf(c) > -1) result.append("9");
    else if (" ".indexOf(c) > -1) result.append("9");
    else result.append("?");
    return result.toString();
    // find all the words corresponding to a signature
    public Vector findMatches(String sig) {
    WordSig ws = new WordSig(sig, "");
    WordSig newws;
    Vector results = new Vector();
    int index;
    index = Collections.binarySearch(dict, ws);
    if (index < 0){
    // no matches! :(
    // try to get the string that starts with a substring like ours.
    index=-1-index;
    if (((WordSig)dict.get(index)).getSig().startsWith(sig)) {
    // no word found. we return those starting with the
    // same signature
    newws = (WordSig) dict.get(index);
    results.addElement(newws.getWord().substring(0,sig.length()));
    return results;
    } else{
    //no match
    return results;
    } else {
    // go back to the first match
    while(((WordSig)dict.get(index)).getSig().equals(sig) && index>0)
    index--;
    if (index != 0)
    index++;
    while ((newws = (WordSig) dict.get(index)).equals(ws)){
    results.addElement( newws.getWord() );
    index++;
    return results;
    // intialises the dictionary
    public PredText () {
         String word;
    String sig;
    Vector dict = null;
    // first try to load dict.dat
    try {
    System.out.print("Trying to load dict.dat...");
    FileInputStream fileStream = new FileInputStream("C:/java/dict.dat");
    ObjectInputStream objectStream = new ObjectInputStream(fileStream);
    dict = (Vector) objectStream.readObject();
    fileStream.close();
    System.out.println(" done.");
    }catch (ClassNotFoundException classNotFoundException) {
         System.out.println("Unable to create an object");     
    catch (IOException e) {
    // exception: create the dictionary
    System.out.println("Error. I'm going to recreate the dictionary file");
    try {
    dict = createDict();
    catch (IOException ioe) {
    System.err.println("Error while creating dictionary file. Exiting." + e);
    System.exit(1);
    this.dict = dict;
    // create the dictionary serialised file
    public Vector createDict () throws IOException {
    String word;
    Vector dict = new Vector();
    //open the dictionary file
    System.out.print("Reading the dictionary... ");
    BufferedReader dictFile = new BufferedReader(
    new FileReader(dictionaryFile));
    //insert each word into the data structure
    while ((word = dictFile.readLine()) != null) {
    word = word.toLowerCase();
    dict.addElement(new WordSig(toNumeric(word), word));
    // List list = dict.subList(0, dict.size());
    List list = dict.subList(0, dict.size());
    Collections.sort(list);
    System.out.println("done.");
    System.out.print("Writing the dictionary... ");
    FileOutputStream fileStream = new FileOutputStream("C:/java/dict.dat");
    ObjectOutputStream objectStream = new ObjectOutputStream(fileStream);
    objectStream.writeObject(dict);
    objectStream.flush();
    fileStream.close();
    System.out.println("done.");
    return dict;
    public static void main (String args[]) {
         PredText pt = new PredText();
    if (args.length == 0) {
    // no arguments, find the largest clash
         Vector result;
         Enumeration e = pt.dict.elements();
    String currentSig = "";
    String prevSig = "";
    int clash = 0;
    int maxClash = 0;
    String clashSig = "";
    while (e.hasMoreElements()) {
    WordSig ws = (WordSig) e.nextElement();
    currentSig = ws.getSig();
    if (currentSig.equals(prevSig)) {
    // another word with the same signature
    clash ++;
    } else {
    // new signature: check if the previous one led
    // to a maximal clash
    if (clash > maxClash) {
    clashSig = prevSig;
    maxClash = clash;
    clash = 1;
    prevSig = currentSig;
    result = pt.findMatches(clashSig);
    System.out.println("The signature leading to most clashes is "
    + clashSig + " with " + result.size() +
    " number of clashes");
    for (int j = 0; j < result.size(); j++) {
    System.out.println((String)result.get(j));
    } else if ("0123456789".indexOf(args[0].charAt(0)) > -1){
    // numeric input: find the matches for the argument
    Vector result;
    result = pt.findMatches(args[0]);
    for (int j = 0; j < result.size(); j++) {
    System.out.println((String)result.get(j));
    } else {
    // convert each word to the corresponding signature
    for (int i = 0; i < args.length; i++) {
    System.out.print(toNumeric(args) + " ");
    class WordSig implements Comparable, Serializable {
    String word;
    String sig;
    public WordSig (String sig, String word) {
    this.sig = sig;
    this.word = word;
    public String getSig () {
    return this.sig;
    public String getWord() {
    return this.word;
    public int compareTo (Object ws) {
    return sig.compareTo(((WordSig) ws).getSig());
    public boolean equals (Object ws) {
    return sig.equals(((WordSig) ws).getSig());
    public String toString () {
    return sig + ", " + word;

  • [svn] 4885: Flex SDK Framework - Update mx.filters API and class hierarchy

    Revision: 4885
    Author: [email protected]
    Date: 2009-02-06 16:12:32 -0800 (Fri, 06 Feb 2009)
    Log Message:
    Flex SDK Framework - Update mx.filters API and class hierarchy
    - Removed BaseFilter.as, BaseDimensionFilter.as, and GradientFilter.as
    - Renamed IBitmapFilter.as to IFlexBitmapFilter.as
    - Changed IBitmapFilter.clone to createBitmapFilter
    - Moved properties and functions from base classes up to filter subclasses
    - Changed ColorMatrixFilter constructor parameter from Array to Object
    - Added Change metadata to all filter classes
    - Changed notifyFilterChanged from public to private
    - Added ASDoc comments
    - Added copyright info
    - Added a number of formatting and style fixes
    QE Notes: Need to update tests based on API changes. Missing tests for DisplacementMapFilter.as.
    Doc Notes: Need extensive ASDoc review. Consider using @copy for properties that match the flash.filters properties
    Bugs: n/a
    Reviewer: Gordon
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimateFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateFilterInst ance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/BevelFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/BlurFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/ColorMatrixFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/ConvolutionFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/DisplacementMapFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/DropShadowFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/GlowFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/GradientBevelFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/GradientGlowFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/ShaderFilter.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Parser.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/StrokedElement.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.a s
    flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as
    Added Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/IFlexBitmapFilter.as
    Removed Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/GradientFilter.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseDimensionFilter.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseFilter.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/IBitmapFilter.as

    Yup. The source files are simply missing from the 4.5 source releases....I'm hitting the same issue when trying to rebuild the SDK with flexcover changes applied.

  • Error list and class hierarchy unexpected refresh

    I'm running LabVIEW 2013 Service Pack 1
    There is an irritating issue that I am sure I have never come across before, in that the Error list, class hierarchy window, VI hierarchy window, and I am sure other UI elements are refreshing themselves every few seconds.
    For example:
    Open the class/VI hierarchy window and browse around. In a couple of seconds the pane will refresh its position to hte top left corner.
    Ensure that the error window has enough errors and warnings (show warnings is reccommended!) that it shows a scrollbar. Scroll down and sellect/highlight an item (this happens naturally if you ctrl-L from a VI). Scroll up/down the list and in a couple of seconds the list focus will move back to the highlighted item.
    This is really, REALLY irritating me with refactoring a large project. Has anyone else seen this, and is it fixable?
    - Cheers, Ed

    That's some pretty strange behaviour, just tried to test it on a machine with 2013 SP1 and another with just 2013; but this behaviour wasn't observed?
    Aside from the standard steps like restarting LabVIEW, or turning your machine on/off; you could try do a repair operation on LabVIEW to correct this?
    Hopefully someoneone else can pitch in who has experienced similar behaviour recently...

  • Comparable and Serializable Interfaces in MIDP

    Hi All,
    I have developed a program in java which implements Comparable and Serializable Interfaces. After, I decided to run the program in J2ME. But later on, I found that MIDP doesn't implement these interfaces.
    Some one can help me how to implement my own interfaces.
    Thank you

    Thank you for replying to me.
    My problem is to compare to objects in MIDP.
    You know that in java is possible to implements directly the Comparable interface but in MIDP is not the same. So I think it requires to create your own. Is that my question.
    I need some to help me. just to avoid the implentation of comparable interface from the java lang package.
    Thank u.

  • Nested Subpanels for LVOOP Class Hierarchy

    Hi,
    I am trying to figure out a way to create a configuration window for a class object using a subpanel. The problem is that I have LVOOP class hierarchy of 3 levels, and thus I want to use nested subpanels, one subpanel for each inheritance.
    For example, 
    A.lvclass (abstract class)
    Private Data Members
     String A
    Configuration Window VI ( Within a FP there is a String A control and a subpanel for its child class)
    B.lvclass (abstract class) (child of A.lvclass)
    Private Data Members
    Boolean A
    Boolean B
    Configuration Window VI (Within the FP there is a Boolean A control and a Boolean B control, plus a subpanel for its child class)
    C1.lvclass (concrete class) (child of B.lvclass)
    Private Data Members
    File Path A
    Configuration Window VI (Within the FP there is a File Path A control)
    C2.lvclass (concrete class) (child of B.lvclass)
    Private Data Members
    Boolean C
    Configuration Window VI (Within the FP there is a Boolean C control)
    What I am trying to accomplish is to create configuration windows for C1 and C2. For each configration window, there are sections for class A and class B, and for the class itself. However, I do not want to recreate the same section (for A and B) over and over again each time new children (siblings of C1) are introduced. To avoid this duplicate task, I think using nested supanes makes sense. But I don't know the best way to do it. Any advice is appreciated
    Thank you
    TailOfGon
    Certified LabVIEW Architect 2013

    See these two threads and be sure to read them thoroughly and follow the links:
    http://forums.ni.com/t5/LabVIEW/An-experiment-in-c​reating-compositable-user-interfaces-for/m-p/12623​...
    http://forums.ni.com/t5/LabVIEW/A-more-successful-​experiment-in-creating-compositable-user/m-p/12768​...
    Try to take over the world!

  • Interface classes

    can somebody tell me why interface classes are useful.. right now i'm just not convinced, because, like an abstract class, interfaces only contain method headers that are to be used in derived classes. Why write another class to store the method headers when you still need to code the header again except this time there's code? Instead, can't u just write that same method in another class without implementing an interface in the first place, isn't that less coding?
    I'm just confused about abstract and interface classes, and don't know when to use them.
    Can someone explain the concepts...

    Firstly interfaces. Look at the Java event model. If a programmer wants to register interest in someone pressing a JButton, he registers his interest with the button through the method JButton.addActionListener(ActionListener l). The parameter here is of type ActionListener which is an interface. This achieves two things. Firstly the programmer can make his whole class implement ActionListener and fill in the method. Alternatively he could make it using an anonymous inner class. Secondly, it is an issue of security - within the JButton whatever object is sent to the addActionListener method, the JButton can only "see" the ActionListener part of it - ie. the JButton can only call the actionPerformed() method.
    Let us look at another use of Interfaces - the java Collection API. Apache have various implementations of such interfaces as Map, Set, List that differ in some way from HashMap, HashSet, Hashtable, ArrayList that Java provides. Usually the difference is performance-related, such as a Map that is used for fast-lookups in a multi-threaded environment but assumes that writes are done seldomly (org.apache.commons.collections.FastHashMap being a case in point). Suppose you have written your code everywhere thus.
    public void someMethod() {
      HashMap m = new HashMap();
      callMethod( m );
    private void callMethod(HashMap m) {
      //do something here
    }And then when you come to profile your application, you find that it is too slow and would be benefitted by using FastHashMap - you will have to go through every single place you have written HashMap in your code and change it. However, if you had originally done...
    public void someMethod() {
      Map m = new HashMap();
      callMethod( m );
    private void callMethod(Map m) {
      //do something here
    }You won't - you will only need to change where the HashMap was Constructed. Going a bit further, had you used a Factory object to return you the new Map implementation, then wouldn't have to look through the code at all - you could merely go straight to the factory Object where all Construction is done and change it there.
    A further use of interfaces is to define an API for vendors to implement. One example of this is JDBC. The interfaces (as with the Collections API) provide a contract of behaviour.
    Abstract class are slightly different - suppose you were coding an application for a Company - you might have classes representing Employee, Manager, Customer etc etc. These will have some properties that are shared (ie. all will have contact telephone numbers, not all will have salary, or bonus etc. So you might have the hierarchy
    Person (abstract : attributes address, telephone, email)
       |
       |--> Employee (attributes salary, employeeNumber)
       |          |
       |          |--> Manager (attributes bonusPayment, staff[])
       |
       |--> Customer (attributes accountNumber)You would make the Person class abstract as it makes no sense to be able to instantiate a Person, only concrete sub-classes. Its subclasses can inherit its attributes (if you so wish) and also functionality (you could define a public void sendEmail(String message) on Person to be inherited by its subclasses), again if you so wish.
    I hope this helps.

  • Version ID and Serializable problem...

    Ok the problem is this. I have a class for some items that will be saved to disk using the Serializable interface. Now to be able to load old files after I have edited the class I need to include the version id in the class like:
    static final long serialVersionUID = 1407381982932730981L;The thing is, to get that version ID you need to compile the class and go into a commandline and run the serialver tool on the class.
    Now, i will have a lot of new files that will extend the main class. And these will also be saved down to files (and it is critical that old files can be deserialized when the program starts again). So for each new class, i will have to go and get the version id.
    Is there some easier way for this?

    It's not entirely clear to me what your problem is. You talk about new classes that extend the main class. Serialization version issues cannot be a problem there.
    However, it is possible to run the serialver program directly from another class by invoking its main method. It's the class sun.tools.serialver.SerialVer. You'll need to include the tools. jar file in your class path. By capturing its output (using System.setOut()) you can automate this process to whatever degree you feel is worthwhile.
    Sylvia.

  • Proper class hierarchy

    Hi all
    I've a class hierarchy problem. I'm trying, to create classes that will parse XML files for different sports, and display them in the table. I've no influence on XML files which I read, and they are different for each sport. To avoid code repeating I've created such a structure:
    public interface Sport {         
        public List getMatchlist(Integer leagueId);
        public void addMatchlist(Integer localCategoryId);
        public void addMatch(Integer categoryId, Map data);  
    public abstract class TeamSport implements Sport {
         public List getMatchlist(Integer remoteLeagueId, int NOT_STARTED_STATUS) throws Exception {
          // here between other lines I need to invoke function from class that extends this class...
    public class Soccer extends TeamSport{
        private static String SPORT_ID = "s";
        public Soccer(Map params) {
            super(params, SPORT_ID);
        public String getRemoteStatusName(int statusCode) {
            return SoccerStatusCodes.getStatusName(statusCode);
        public int getRemoteNotStartedStatus() {
            return SoccerStatusCodes.NOT_STARTED;
    } What my problem is, that for team sports xml are very similar, but xml node attribute status has different values for each sport. And I need to use it in TeamSport.getMatchlist class. I'd need to invoke Soccer.getRemoteNotStartedStatus() function to get correct value for given value. Obviously it's not possible, because TeamSport is superclass of Soccer. The simplest solution is to copy getMatchlist method from TeamSport to Soccer class and every other sport, but it's resulting in duplicating the code, what I want to avoid.
    Can anybody help?
    Michal

    hmmm. interesting model. feasible, indeed. I cansee
    maintenance increasing exponentially, though: alot
    of "if sportName.equals("football")" and so onand
    so forth, more code to be added to controllers for
    each new sport. still, the notion of a "teamsport"
    as a concrete entity does seem attractiveWhat does 'maintenance' have to do with the
    conditional test of the value of sportName variable?a lot. as new sports are added, that test can have new results. unless these sport classes exist purely for their own sake, something else is using them. and that something else needs to be maintained
    What makes you think that the if statement would be
    required anywhere? And, what makes you think that
    there will be controllers for each sport? see above for the "if" statement. controllers was just an example of a class that would use these "sport" classes, something has to use them, and the OP hasn't specified what, so a little guesswork was involved
    The problem the OP stated was there was no access to
    the method in TeamSport. Whether he/she was correct
    or not is another story. it's a public method. how would it not be accessible? you don't think that, as an analyst, it's your job to identify incorrect assumptions?
    Regardless, the better design is to make TeamSport
    concrete and not code a separate class for each
    sport, in my opinion.I'm undecided. I think your concrete TeamSport idea is interesting, but I'm unsure. having a general-purpose sport, that is configurable, could be open to having nonsensical configurations made, such as soccer on ice
    Aside, software maintenance and software design are
    two different concepts.are they? I strongly disagree. what is a "good" design? IMO, a good design must, by necessity, facilitate the adding of new features, the extending of the application. that is maintenance is it not?

  • Class Hierarchy in SAP

    Hi all, I want to know if there is a class hierarchy of ABAP class? just like MSDN, I can find what the class or interface use for.
    for example, I found cl_xml_document is not inherited from if_ixml_document. That's a little confused.

    Hi,
    A long time ago, there was an IBM Rational Rose connector which offered access to all classes, inheritance, and so on... but the logic in the RFC modules that were used are no that simple.
    I think it is this one : RPY_CLIF_MULTI_READ
    Maybe someone could write a connector to some open source UML project that would allow old versions of SAP to also benefit from UMLvisualization.
    --> hint for a Code Exchange project  
    Also check this other tool : http://www.ceon.nl/abapeclipse/features.php
    Best regards,
    Guillaume
    [http://guillaumegarcia13.blogspot.com/2009/08/conception-uml-avec-nw-ehp-2.html|http://guillaumegarcia13.blogspot.com/2009/08/conception-uml-avec-nw-ehp-2.html]

Maybe you are looking for