Class Definition & Implementation

Hi,
  In JAVA or Other OOP languages the class definition & implementation are doing within the same task i.e with in the class only they are defining & implementing.But when it comes to ABAP the definition part & implementation part of a class are divided into 2 tasks. Why they are designed like that?

Hi Suresh Reddy,
The main intention behind this design is
" to differentiate the class definition and implementation clearly ."
Even if you have a chance to including both  class definition and implementation in same structure, it is difficult to differentiate  these things in lengthy implementation classes.
Thank you,
Prasad GVK.

Similar Messages

  • Is the "Device Class Definition for Physical Interface Devices" specification implemented in Windows?

    Can I assume that Windows will be able to handle my physical interface device if I follow the "Device Class Definition for Physical Interface Devices" specification while writing the firmware?
    I'm trying to develop a device which handles rumble output from applications such as games. Applications would include e.g. racing games or simulators. I'm hesitant to just clone Xbox 360 Gamepad or Sidewinder USB reports. I'd like to correctly declare my
    device as something on its own while still making use of already implemented OS-specific drivers. The purpose of the mentioned specification is exactly that as far as I can tell. I wasn't able to find concrete information about its level of support though.
    The "USB device class drivers included in Windows" page (sorry I'm not allowed to post links yet..) seems to link to WinUSB which I'm not sure what to do with.

    Thanks for your response. Well if everything was implemented at that time and it's still available it should be fine since the specification document's last version is dated 1999. I was just hoping there would be any form of documentation whether it's
    supported and by which degree so I don't go through the trouble of figuring out how the firmware should be written according to the specification just to find out there is no OS driver implementation for it which would render my work more or less useless.
    So I suppose I'm forced to go the trial and error path?

  • Serializing a class that implements the Singleton pattern

    Hello,
    I am relatively new to Java and especially to serialization so the answer to this question might be obvious, but I could not make it work event though I have read the documentation and the article "Using XML Encoder" that was linked from the documentation.
    I have a class that implements the singleton pattern. It's definition is as follows:
    public class JCOption implements Serializable {
      private int x = 1;
      private static JCOption option = new JCOption();
      private JCOption() {}
      public static JCOption getOption() { return option; }
      public int getX() { return x; }
      public void setX(int x) { this.x = x; }
      public static void main(String args[]) throws IOException {
        JCOption opt = JCOption.getOption();
        opt.setX(10);
        XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream("Test.xml")));
        encoder.setPersistenceDelegate(opt.getClass(),  new JCOptionPersistenceDelegate());
        encoder.writeObject(opt);
        encoder.close();
    }Since this class does not fully comply to the JavaBeans conventions by not having a public no-argument constructor, I have create a class JCOptionPersistenceDelegate that extends the PersistenceDelegate. The implementation of the instantiate method is as follows:
      protected Expression instantiate(Object oldInstance, Encoder out) {
           Expression expression = new Expression(oldInstance, oldInstance.getClass(), "getOption", new Object[]{});
            return expression;
      }The problem is that the resulting XML file only contains the following lines:
        <java version="1.5.0_06" class="java.beans.XMLDecoder">
            <object class="JCOption" property="option"/>
        </java> so there is no trace of the property x.
    Thank you in advance for your answers.

    How about this:
    import java.beans.DefaultPersistenceDelegate;
    import java.beans.Encoder;
    import java.beans.Expression;
    import java.beans.Statement;
    import java.beans.XMLEncoder;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    public class JCOption {
        private int x = 1;
        private static JCOption option = new JCOption();
        private JCOption() {}
        public static JCOption getOption() { return option; }
        public int getX() { return x; }
        public void setX(int x) { this.x = x; }
        public static void main(String args[]) throws IOException {
          JCOption opt = JCOption.getOption();
          opt.setX(10);
          ByteArrayOutputStream os = new ByteArrayOutputStream();
          XMLEncoder encoder = new XMLEncoder( os );
          encoder.setPersistenceDelegate( opt.getClass(), new JCOptionPersistenceDelegate() );
          encoder.writeObject(opt);
          encoder.close();
          System.out.println( os.toString() );
    class JCOptionPersistenceDelegate extends DefaultPersistenceDelegate {
        protected Expression instantiate(Object oldInstance, Encoder out) {
            return new Expression(
                    oldInstance,
                    oldInstance.getClass(),
                    "getOption",
                    new Object[]{} );
        protected void initialize( Class<?> type, Object oldInstance, Object newInstance, Encoder out ) {
            super.initialize( type, oldInstance, newInstance, out );
            JCOption q = (JCOption)oldInstance;
            out.writeStatement( new Statement( oldInstance, "setX", new Object[] { q.getX() } ) );
    }   Output:
    <?xml version="1.0" encoding="UTF-8"?>
    <java version="1.5.0_06" class="java.beans.XMLDecoder">
    <object class="JCOption" property="option">
      <void property="x">
       <int>10</int>
      </void>
    </object>
    </java>

  • Web server to download class definitions?

    Hello,
    There's still one thing that i do not understand about RMI.
    I find on the website below the following quote "Classes definitions are typically made network accessible through a web server".
    http://java.sun.com/docs/books/tutorial/rmi/overview.html
    However, I have created and tested a small RMI example, and there was no need for a webserver (although, i tested my small rmi testapp both client and server on the same machine).
    By the way, my small testapp was:
    - an interface that extends java.rmi.remote and defines one method that returns just a string "ok".
    - the implementation of that interface
    - a client that calls the that remote object, and it prints "ok", without problems.
    Thus, what is this kind of "webserver" then???
    Why does everything works in my small testapp, without a webserver??
    Or is there a webserver that i can not see??
    Am I missing some information, or do i see something wrong???
    Thank you.

    is that maybe necessary when we have the rmi server, the rmi client and the rmi registry on three different machines?

  • Concrete classes implement abstract class and implements the interface

    I have one query..
    In java collection framework, concrete classes extend the abstract classes and implement the interface. What is the reason behind extending the class and implementing the interface when the abstract class actually claims to implement that interface?
    For example :
    Class Vector extends AbstractList and implements List ,....
    But the abstract class AbstractList implements List.. So the class Vector need not explicitly implement interface List.
    So, what is the reason behind this explicit definition...?
    If anybody knows please let me know..
    Thanx
    Rajendra.

    Why do you post this question again? You already asked this once in another thread and it has been extensively debated in that thread: http://forum.java.sun.com/thread.jsp?forum=31&thread=347682

  • Create Global Class Definition using Local Class Source Code

    I would like to be able to automate the creation of global class definitions using source code that is defined in a text file (one example: convert a local class def to a global class def).
    Does SAP deliver this functionality?  (I'm already aware of the various classes that can be used to create global classes and how those classes can be implemented in a program to generate new classes.  I'm hoping to avoid having to create a custom solution.)
    Thanks in advance!

    We have a winner!
    Thanks Rich!
    It's not a 100% solution - I was hoping to be able to generate global classes/interfaces using source code alone, without requiring user intervention.
    It <i>is</i> however, a 90-95% solution because debugging SE24 reveals that by using a combination of the FM's SCAN_ABAP_OBJECTS_CLASSES & SEO_CLIF_MULTI_IMPORT, I should be able to <u>quickly</u> put together that custom application that I was trying to avoid.
    I knew about the existance of SEO_CLIF_MULTI_IMPORT but I did not know about SCAN_ABAP_OBJECTS_CLASSES.  I'm very happy to learn that I'm not going to have to write a parser!

  • What is class definition in RMI

    Hi,
    What exactly is the class definition (mentioned in http://java.sun.com/j2se/1.4.2/docs/guide/rmi/codebase.html: "If the class definition for the stub instance can be found....."
    Is it the interface class or the implementation of the interface class?
    Thanks for answering my (maybe stupid) question.

    Is it the interface classNo
    or the implementation of the interface class?It is the xxx_Stub.class file generated by rmic if and when you run it on a class named xxx.

  • JAXB not generating correct class definition

    Hi,
    I am using JAXB 2.0 and the JAXB plugin for Eclipse 3.x.
    The problem I have is that when I run XJC on my XSD file the class definition for
    a particular class is not what I am expecting. The class only defines 1 get method instead of three. While I am expecting to see getX getY and getZ I am seeing only 1 method getXAndgetYAndgetZ. Here is a snippet of the XSD file:
         <xs:element name="Sql">
              <xs:complexType>
                   <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="Query"/>
                        <xs:element ref="Table" maxOccurs="unbounded"/>
                        <xs:element name="Database" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>I have defined the Table element in the XSD.
    In this case my generated Sql class has the following method:
    public List<JAXBElement<String>> getQueryAndTableAndDatabase() {
            if (queryAndTableAndDatabase == null) {
                queryAndTableAndDatabase = new ArrayList<JAXBElement<String>>();
            return this.queryAndTableAndDatabase;
        }Is there a problem with my XSD file or am I omitting a parameter when running XJC? Any help greatly appreciated

    LDAPLoginModule uses the jackrabbit UserManagerImpl to create user's in CRX (CQ), not the CQ5 implementation which is disappointing. Have to manually add the sling:resourceType.

  • Create Java class out of ABAP class definition

    Hi all,
    is there a way to create a Java class definition based on a given ABAP class? Of course I have to implement the functionality again in Java, but it would be great if I could get a java class definition with all the methods, attributes etc.
    Best regards,
    Nils

    I don't know that something like that exists.  I think you will have to look at the class in SE24 and manually do the java code.
    Regards,
    Rich Heilman

  • Why does interfaces allow class definitions within them

    Can anybody explain why interfaces can contain class definitions.

    Saish wrote:
    It does somewhat adulterate the idea that interfaces and implementations should be separate. I would find it more useful if the class that you declare could be something other than public. That way, you could expose an interface, a factory (which would be public) and then have all the implementations private in the same file. A client would only see the factory and the interface (granted, one could achieve the same effect with non public classes in their own source files all in the same package). But to require that member types within the interface be public, that really makes little sense to me.agreed - this limitation is quite annoying. Forces me to use extra level of nesting to work around it:
    // see also: http://forums.sun.com/thread.jspa?messageID=10938789#10938789
    public interface MyInfo {
      public MyStatus getMyStatus();
      public static interface MyStatus { } // MyStatus
      public static class Factory {
        public static MyStatus newMyInfo() {
          return new MyInfo() {
            public MyStatus getMyStatus() {
              return new Innards.MyStatusImpl();
      } // Factory
      // IMPL NOTE purpose of this class is to keep implementation details inside
      public final /* IMPL NOTE subclassing prohibited */ static class Innards {
        private Innards() {}  /* IMPL NOTE instantiation prohibited */
        private static class MyStatusImpl implements MyStatus { } // MyStatusImpl
      } // Innards
    } // MyInfo

  • CLASS lcl_application IMPLEMENTATION

    I have a lcl_application class with its implementation. The only method defined is 'handle_node_double_click'. I want to display some fields in a dynpro when double click on one button and I want also to disable these fields when some others are pushed.
    In fact, into the CLASS lcl_application IMPLEMENTATION I can not use 'loop at screen. if screen-name='ZT'. screen-input = '0'. endif. modify screen. endloop'. It does not work.
    How can I do it ??
    Thanks.

    For example, your program structure could be like so... 
    REPORT  rich_0001.
    DATA: ok_code        TYPE sy-ucomm.
    DATA: save_ok        TYPE sy-ucomm.  
    *       CLASS lcl_application DEFINITION
    CLASS lcl_application DEFINITION FINAL.
      PUBLIC SECTION.
        CLASS-METHODS: pbo,
                       pai.
    ENDCLASS.                    "lcl_application DEFINITION
    START-OF-SELECTION.
      CALL SCREEN 100.
    *      Module  STATUS_0100  OUTPUT
    MODULE status_0100 OUTPUT.
      lcl_application=>pbo( ).
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *      Module  USER_COMMAND_0100  INPUT
    MODULE user_command_0100 INPUT.
      lcl_application=>pai( ).
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *       CLASS lcl_application IMPLEMENTATION
    CLASS lcl_application IMPLEMENTATION.
    *  Method PBO
      METHOD pbo.
        CASE sy-dynnr.
          WHEN '0100'.
            SET PF-STATUS '0100'.
            SET TITLEBAR  '0100'.
    * Here you can LOOP at SCREEN
        ENDCASE.
      ENDMETHOD.                    "pbo
    *  Method PAI
      METHOD pai.
        save_ok = ok_code.
        CASE sy-dynnr.
          WHEN '0100'.
            CASE ok_code.
              WHEN 'BACK' OR 'EXIT'.
                LEAVE PROGRAM.
              WHEN 'EXECUTE'.
                CLEAR ok_code.
            ENDCASE.
        ENDCASE.
      ENDMETHOD.                    "pai
    ENDCLASS.                    "lcl_application IMPLEMENTATION
    Regards,
    Rich Heilman

  • Duplicate class definition error while invoking EJB from ADF project

    Hi,
    I am using Jdeveloper TP3 and facing the following problem.
    I have built an EJB project and am ran them successfully in the embedded OC4J via a standalone java program.
    Now I created another project with ADF capabilities and when I tried to ping the EJB i get the following exception
    The application named, current-workspace-app, could not start due to an error.
    duplicate class definition: javax/faces/context/FacesContextFactory Invalid class: javax.faces.context.FacesContextFactory Loader
    This is happenning due to class conflicts between javaee.jar and trinidad-impl.jar/adf-richclient-impl.jar.
    Is there any way of bypassing this class loader issue?

    Hi,
    actually I didn' try the JNDI lookup but used resource injection instead
    In a JSF managed bean I use
    @EJB Ejb30SessionFacadeLocal myLocalInterface;
    public SortableModel getTableModel() {
    List rows = new ArrayList<Employees>();
    rows = myLocalInterface.queryEmployeesFindAll();
    this.tableModel = new SortableModel(rows);
    return tableModel;
    Its a EJB 3.0 session bean that accesses a Local interface. However, if the remote is on the same server then I would think that using @EJB Ejb30SessionFacadeRemote myRemoteInterface; does similar
    Frank

  • Reading the Interfaces name which the class is implementing in a COM dll is implementing.

    Hi All,
    I'm using .NET Reflection to read a COM dll. I'm able to fetch the classes that are present in the dll. But I would like to know interface name which this class is implementing.
    For a .NET dll we can know the name of class's implementing interface name using the <classname>.BaseType.Name property.
    How can I know the interface name which this class is implementing (if any).
    Please let me know how to do this for a COM dll.
    Thanks in advance,Satish
    Thanks, Satish Bommideni "Success usually comes to those who are too busy to be looking for it."

    Hi,
    Thanks for the reply.
    I'm reading the COM assembly using the methods available in oleaut32.dll.
    Also I've imported the namespaces
    System.Runtime.InteropServices.ComTypes;
    System.Runtime.InteropServices;
    to use its respective methods and thus I'm able to read it's classes.But donot know what property to check for this class's interface.
    Kindly let me know if you need any further information.
    Thanks, Satish Bommideni "Success usually comes to those who are too busy to be looking for it."

  • Java.lang.LinkageError: duplicate class definition

    Dear Experts,
    We are in the process of Migrating current Mi2.5 application to NWM7.1.
    We have that 2.5 application properly running in production system but in 7.1 while opening some JSP page of application
    it sometimes opens properly & sometimes gives this error..
    java.lang.LinkageError: duplicate class definition
    The detailed error description is as given below..
    Pls advice..

    Error: 500
    Location: /ZEFL_BP_MI/jsp/stock/bp_technicians_issue_sparesforms.jsp
    Internal Servlet Error:
    java.lang.LinkageError: duplicate class definition: com/sap/BP/bean/TableViewBean
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at org.apache.tomcat.loader.AdaptiveClassLoader.doDefineClass(AdaptiveClassLoader.java:575)
    at org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.java:542)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.beans.Beans.instantiate(Unknown Source)
    at java.beans.Beans.instantiate(Unknown Source)
    at jsp.stock.bp_0005ftechnicians_0005fissue_0005fsparesforms._jspService(bp_0005ftechnicians_0005fissue_0005fsparesforms.java:101)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    at org.apache.tomcat.core.Handler.service(Handler.java:287)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(RequestDispatcherImpl.java:222)
    at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:162)
    at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.dispatchRequest(AbstractMEHttpServlet.java:780)
    at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGetThreadSafe(AbstractMEHttpServlet.java:281)
    at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGet(AbstractMEHttpServlet.java:552)
    at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.service(AbstractMEHttpServlet.java:190)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    at org.apache.tomcat.core.Handler.service(Handler.java:287)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
    at java.lang.Thread.run(Unknown Source)
    Regards,
    Saptak

  • Class definition

    hello, i need a class definition for a digital watch in Java.

    1. you'll pass 3 parameters into the constructor (1 for time, 1 for alarm, 1 for ...).
    2. your setTime and setAlarm methods will look something like this:
    void setTime(param)
    timeVariable = param;
    void setAlarm(param)
    alarmVariable = param;
    Simple as that. Hope this helps!!

Maybe you are looking for