Helper Class Hierarchy for WDA

Hi
I am working on a project that requires several WDA apps and therefore wish to house all common methods in one class. Each WDA has it's own assistance class and methods particular to that WDA but I wish to access common methods from a 'superclass' of these assistance classes.
My question is how to call the common methods.
Since my assistance class already has a superclass - cl_wd_assistance - I am currently creating an instance of my common methods class in the constructor of the assistance class.  I am thinking I should be using an interface somehow but am unclear on the reason behind it.
Has anyone setup a hierarchy of classes to support a multi WDA project?
Cheers
Ian

Haven't had this need myself but did you try to make the superclass (which has the common functionality) inherit from CL_WD_COMPONENT_ASSISTANCE, and then defining each subclass in the corresponding WDA? I don't know if WDA does some validation which forces any class defined as Assistance class to inherit directly from CL_WD_COMPONENT_ASSISTANCE (I'm not at the system now), but such a validation would make no sense...
What I mean is to:
1 - Create the superclass e.g. ZCL_SUPER from SE24 (if you didn't yet) and manually define CL_WD_COMPONENT_ASSISTANCE as its superclass.
2 - Create each subclass e.g. ZCL_SUBxx from SE24 (if you didn't yet) and manually define ZCL_SUPER as their superclass (instead of CL_WD_COMPONENT_ASSISTANCE).
3 - Manually define each ZCL_SUBxx class as the assistance class of each component (instead of creating the class while defining as SE80 allows).
So this would leave you with this hierarchy:
CL_WD_COMPONENT_ASSISTANCE
     ZCL_SUPER
         ZCL_SUB01
         ZCL_SUB02
         ZCL_SUBxx
Since all the ZCL_SUBxx classes would be still inheriting (indirectly) from CL_WD_COMPONENT_ASSISTANCE, they should be allowed to be defined as Assistance classes...let me know if this works.
Regards
Edited by: Alejandro Bindi on Jan 28, 2009 11:39 PM
I may add however, you should use inheritance when you can define (conceptually) that any subclass is a special type of the superclass...exceptions are less common.

Similar Messages

  • Create a class hierarchy

    How do i create a Java class hierarchy for my program. What are common classes that programs use that would be included in the hierarchy? Help would really be appreciated.

    ^^ that pretty much sums up how to do it
    but inheritance is basically the guts of java, super duper important concept to understand. So i suggest sitting down with a good java book for a couple hours, and completely grasp the ideas of inheretance, polymorphism, encapsulation .. all that good stuff.
    personally i like The Complete Reference books. i studied with them and they really do help alot

  • Add helper class public parts as used DC in EJB DC

    Hi Experts,
    I have created a JAVA DC project containing the helper classes.
    For this helper classes i have created a Jar file.
    I have also created two public parts
    1) with an option Can be packaged into other build results (e.g. SDAs)
    2) with an option Provides an API for developing/compiling other DCs
    Now i want to use these public parts in my EJB DC.
    I have added the API public part in my EJB DC as build time design time and run time.
    Now when i am getting java.lang.NoClassDefFoundError: for the class defined in JAVA DC helper class.
    Can you help me in resolving this?
    Regards,
    Ashish Shah

    Hi
    I have done following things:
    1) I have a java DC containing helper classes and an EJB DC referring to it.
    2) Now to access this EJB DC, I have created a java command bean DC.
    3) And I am using this command bean Java dc in my WebDynpro application.
    4)  Now for deploying the helper class, I have created a library project.
    5)  To this library project I have added the SDA and API public part of helper class as used dc.
    6)  I have added this java library file as used DC in WebDynpro DC and in EJB DC.
    7)  I have added the library reference to the WebDynpro DC for J2ee server component library DC  As pg.comaptsc~dc_aptjl
    8)  When i checked in Visual admin i could see the Assembly (SDA) helper class jar file.
    In my helper class files, I am getting this warning.
    Checking package reservation
    Warning: Package pg.com.apt.help.cls is not reserved for DC : apt/sc/dc_apthc.
    Now in my webdynpro DC when I refer to the helper class through the EJB, I get this error.
    java.lang.NoClassDefFoundError: pg/com/apt/help/cls/TargetMarket at pg.com.atos.WebModuleProject.FetchSDCDataBean.SearchGTINTMDataEJB(FetchSDCDataBean.java:133) at pg.com.atos.WebModuleProject.FetchSDCDataObjectImpl0.SearchGTINTMDataEJB(FetchSDCDataObjectImpl0.java:119) ... 35 more ; nested exception is: java.lang.NoClassDefFoundError: pg/com/apt/help/cls/TargetMarket
    Can you please guide on what I am missing.
    Thanks in advance.
    Regards,
    Ashish Shah
    Edited by: ashish shah on Dec 18, 2007 3:23 PM

  • Compiling servlet with helper class

    Hello,
    I have to write a very large number of database queries and huge amount of code so I decided to make each helper *.class file for each table.
    Now I have a main servlet that should instantiate each of these helper classes and conduct DB operations:
    //Servlet code
    RescardreservationTable rv = new RescardreservationTable();
    rv.insertInfo();
    RescardPassengerTable rp = new RescardPassengerTable();
    rp.insertInfo();RescardreservationTable.class
    //does DB opsMy problem is that when I try to compile servlet, I get
    insert_data.java:172: cannot find symbol
    symbol : class RescardreservationTable
    location: class insert_data
    RescardreservationTable rv = new RescardreservationTable();
    Could somebody please tell me how I can make servlet locate my java classes that it has to use?
    Thanks,
    Victor.
    Edited by: vic_sk on Dec 9, 2008 9:29 AM

    Ok, looks like it's solved. Just forcing the compiler with -classpath to look for the required class file.

  • 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.

  • Swing class hierarchy

    Hi Guys,
    I am looking for an application which can give me the class hierarchy for a running Swing application.
    I am just a beginner and sorry if this is very dump to ask for :-)
    Thanks
    Raman

    Hi Guys,
    I am looking for an application which can give me the class hierarchy for a running Swing application.
    I am just a beginner and sorry if this is very dump to ask for :-)
    Thanks
    Raman

  • Help - Class name and descriptions for a function location.

    Hi Guys
    i have to write a report that displays the class and class descriptions for a function location. the user passes in either the function location(TPLNR) or the class name and  the report should display the the class characteristics and resp. values. Is there a FM that i coud use?
    please help.
    many thanks.
    seelan.

    sadiepu1 wrote:
    When I set up Words with Friends on my Fire it asked for my username and password which from a previous reply to my inquiry above stated that the S 3 doesn't store due to privacy issues. I have tried all my usual combinations of usernames and passwords and my Fire won't let me access the game as it keeps telling me that one or the other is not correct. I have deleted the app from my Fire and re-downloaded it but have the same error comes up. I have accessed the Words with Friends support both on my phone and their website but there is no live chat. I might have to take both to a Verizon store. Also, my Fire won't let me access the game without a correct username and password. To say that I am frustrated would be an understatement as well I have tried everything I can think of with no luck! Thanks for any help you can give!
    Did you use facebook to log in? 
    Verizon will not be able to help you retrieve any of the information you need.  You will have to contact Zynga.

  • I need a clarification : Can I use EJBs instead of helper classes for better performance and less network traffic?

    My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
    I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
    Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
    Please suggest me which method (is Helper classes or Using EJBs) is perferable
    1) to get better performance and.
    2) for less network traffic
    3) for better container resource utilization
    I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
    Please give detailed explanation.
    thank you,
    sudheer

    <i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
    1) to get better performance</i>
    EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
    <i>2) for less network traffic</i>
    There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
    <i>3) for better container resource utilization</i>
    Again, the EJB version will consume a lot more container resources.

  • How to construct table in jsp for the resultset from helper class

    Hi Dudes!!!
    Want to construct table in jsp for the resultset, but the resultset are retrieved at the helper class.I constructed Table in Helper class Using StringBuffer and return it as string from the helper class.Is their any other feasible and efficient way to construct table in Jsp for the resultset from Helper class.Solution will be highly appreciated.Thanx in Advance.

    no, we can't.
    Certainly noone can with such vague specifications even if they had the intent to do so.
    "the computer", which computer?
    "attach to our current page", what is meant by that?
    And noone should ever help you if you're planning to breach security anywhere.

  • 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!

  • Search for Objects via Class Hierarchy

    Dear colleagues,
    For searching of an Object via a Class Hierarchy, Program SAPLCLSD screen 1000 release 4.7, a double click is required on the Class (left side of the screen) from which you want to see the Objects. If you do not click double, the view of the related Objects will not be recreated.
    Is it possible to avoid the double clicking?

    Hello Alpesh,
    Thank you for your response. The user asked whether the double click, needed for the show of the objects, related to a Class, can be done with a single click.
    They use transaction CL20N, input Class type, search for material with F4 search by Class input of a Class, then a tree of Classes will be shown. Select a Class, use button 'Include subordinate classes' and, if available, the related object(s) are shown.
    The issue is that when you select another Class, you have to double click on the selected Class to make the screen with Objects empty.
    Can we change the double click easy to a single click?
    Kind regards, Jan van der Veen.  06-22973646 Netherlands.

  • Need a link for ADF class hierarchy diagrams

    Hi,
    For some reasons i m not able to find via google or in documentation I need class hierarchy diagrams of the following
    - ADF Binding e.g Faces* to AttributeBinding etc etc.
    - ADF Model e.g ApplicationModule > Entity > View to Rowset etc etc
    these diagrams frequently used by Frank Nimphius in his presentations.
    Best Regards,
    Zeeshan Baig

    Hi,
    I created the binding diagram using Oracle JDeveloper class diagrammer. You don't need the source code for this. Create a new class diagram in JDeveloper, use right mouse context menu and choose "Add to diagram". Browse the class path to the classes you want to see (e.g. adf | model | binding) and select them. It takes a few seconds for the diagrammer to layout the classes, but then you have the diagram you are looking for.
    Frank

  • What's the naming convention for Helper Class?

    Hi Experts,
    What's the naming convention for helper class?
    cl_util? or cl_heper?
    Thanks in advance!

    Hi.,
    Normally in JAVA the naming convention for Helper Class is <EventID>Util.java. The Naming convention for helper class must start with EventID.
    here Event ID is  the event Name , Util.java is the helper class for java.
    I believe the same will be followed in ABAP OO too..
    here the helper class is cl_uitl.,
    so <EventID><ABAP hepler class> is the naming convention.
    wait for experts reply..,
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • Class hierarchy in BW

    Hi,
    has anyone used R/3 class hierarchy in BW reports? I would like to use classification system in R/3 to build up class hierarchies both for material and customers and use those in BW reports. At this point of time I would only be using classes without any characteristics.
    Any help highly appreciated.
    BR. Antti

    Hi rakesh,
    i am also working on the retail, also working on the same hierarchy 0material the data source is 0material-lkls_hier, the calss type is 026,
    but its not updating into the infoobject currectly
    in the monitoring i am gettinh like this
    Transfer rules ( 911 Records ) : No errors
    Hierarchies for master data received. Processing being started.
    Transfer 911 data records in communication structure
    Update ( 0 new / 0 changed ) : No errors
    Data saved successfully
    Data successfully transferred to the update
    -> Start update of master data hierarchy
    <- End update of master data hierarchy
    Hierarchy successfully activated
    but in the bex its displaying like not assigned material
    how u did this... plzzz guide me
    Anil

  • 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

Maybe you are looking for

  • Itunes wont install on visa

    ive tried to update my itunes and it wont install i get an error message saying Service apple mobile device failed to start. verify that you have sufficent privilages to start system services help please

  • ALV to excel sheet

    Hello Gurus, After ALV output I have to click on the button local file and select spredsheet and transfer the whole data to Excel sheet. I am able to do that, but the problem is for an tracking number in the excel sheet is getting displayed as 2.0995

  • How to run [strike]line thru work[/strike] while leaving it visible

    in body of text sometimes useful to 'strike' one term out, leaving it visible to recipient, while adding an alternate term after '/strike' Have been unable to figure out how to do this, or read any prior tip. Please advise.

  • Access over dblink

    Hi, I have 2 databases DB1 and DB1. There is one user U1,U2 in DB1 and DB2 databases respectively. U2 owns a table T1 in DB2. U1 want to have select privliege on U2's T1 table. How should one go about it ? Thanks

  • JButton state does not changes at first click

    requirement of flow is that when jButton1 is pressed if it has text "Check" then execute second if statement and is it has text "Refresh" then have to execute first if statement. The problem is that when jButton1 has text "Refresh" it executes first