Oops programming

hi,friends
does anybody working on ABAP OBJECTS?
so what r the diffrent programs ur writing using oops approach in ABAP? i mean reports......like that....
plz explain something ur working on ABAP OBJECTS..in real time....

Hi Prashanth
You use OOPS for the following advantages.
Complex software systems become easier to understand, since object-oriented structuring provides a closer representation of reality than other programming techniques.
In a well-designed object-oriented system, it should be possible to implement changes at class level, without having to make alterations at other points in the system. This reduces the overall amount of maintenance required.
Through polymorphism and inheritance, object-oriented programming allows you to reuse individual components.
In an object-oriented system, the amount of work involved in revising and maintaining the system is reduced, since many problems can be detected and corrected in the design phase.
You will releaze OOPS advantage only if you involve in complex projects.
For reading in ABAP OOPS concepts, refer the below links.
BC404 is SAPs reference material on OO programming in ABAP.
Object Service
http://help.sap.com/saphelp_nw04s/helpdata/en/ab/9d0a3ad259cd58e10000000a11402f/frameset.htm
ABAP - Shared Objects
http://help.sap.com/saphelp_nw04s/helpdata/en/14/dafc3e9d3b6927e10000000a114084/frameset.htm
OO interfaces
http://help.sap.com/saphelp_nw04s/helpdata/en/c3/225b5354f411d194a60000e8353423/frameset.htm
ABAP Objects
http://help.sap.com/saphelp_nw04s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
ABAP OO Books
ABAP Objects
by Horst Keller, Sascha Kruger
ABAP Objects - Reference book
by Horst Keller, Joachim Jacobitz
Dont forget to reward, if it helps ;>)
Regards,
Rakesh.

Similar Messages

  • Error in simple oops program

    Hi experts,
    When executing a simple oops program ..i got the following error. Please correct the code.
    "VAR" is not type-compatible with formal parameter "I_DATA".          
          CLASS main DEFINITION
    CLASS main DEFINITION.
      PUBLIC SECTION.
        "// Instance Methods ( Note we use the statement 'METHODS'
        "// to define an instance method )
        METHODS set_data IMPORTING i_data TYPE string.
        METHODS get_data RETURNING value(r_data) TYPE string.
        METHODS print_attribute IMPORTING i_data TYPE string.
        "// Instance Methods ( Note we use the statement 'CLASS-METHODS'
        "// to define a static method )
        CLASS-METHODS set_classdata IMPORTING i_data TYPE string.
        CLASS-METHODS get_classdata RETURNING value(r_data) TYPE string.
        CLASS-METHODS print_classattribute IMPORTING i_data TYPE string.
      PROTECTED SECTION.
        "// Instance Attribute ( Note we use the statement 'DATA'
        "// to define an instance attribute )
        DATA attribute TYPE string.
        "// Static Attribute ( Note we use the statement 'CLASS-DATA'
        "// to define a static attribute )
        CLASS-DATA classattribute TYPE string.
      PRIVATE SECTION.
        "// Instace event ( Note we use the statement 'EVENTS'
        "// to define aN instance event )
        EVENTS event EXPORTING value(e_data) TYPE string.
        "// Instace event ( Note we use the statement 'CLASS-EVENTS'
        "// to define a static event )
        CLASS-EVENTS classevent EXPORTING value(e_data) TYPE string.
        "// For more informations about events see the following example:
        "// ABAP Objects - Creating your First Local Class - Using Events
    ENDCLASS.                    "main DEFINITION
          CLASS main IMPLEMENTATION
    CLASS main IMPLEMENTATION.
      METHOD set_data.
        CONCATENATE 'Instance Attribute value' i_data
                                   INTO attribute SEPARATED BY space.
      ENDMETHOD.                    "set_data
      METHOD get_data.
        MOVE attribute TO r_data.
      ENDMETHOD.                    "get_data
      METHOD set_classdata.
        CONCATENATE 'Static Attribute value' i_data
                                   INTO classattribute SEPARATED BY space.
      ENDMETHOD.                    "set_classdata
      METHOD get_classdata.
        MOVE main=>classattribute TO r_data.
      ENDMETHOD.                    "get_classdata
      METHOD print_attribute.
        WRITE: i_data, /.
      ENDMETHOD.                    "print_attribute
      METHOD print_classattribute.
        WRITE: i_data, /.
      ENDMETHOD.                    "print_classattribute
    ENDCLASS.                    "main IMPLEMENTATION
    DATA: var type char20.
    START-OF-SELECTION.
      "// Calling a Static method (note we don't have a object )
      "// instead we use the <class name>=><method name>.
      main=>set_classdata( 'SDN' ).
      var = main=>get_classdata( ).
      "// Print the var value
      main=>print_classattribute( var ).
      DATA: object_reference TYPE REF TO main.
      CREATE OBJECT object_reference.
      "// - Calling a Instance Method( Note we have to use a object to
      "// access the insntace components of class main )
      "// - Note we're using the statment "CALL METHOD", see looking for
      "// functional & General methods for more informations
      CALL METHOD object_reference->set_data( 'BPX' ).
      var = object_reference->get_data(  ).
      object_reference->print_attribute( var ).
    Thanks in Advance.
    Regards
    Nani

    Hi Nani,
    try changing your data definition for var from CHAR20 to STRING.
    regards,
    Peter

  • Oops programming in abap

    hi,
       i need oops programming in abap where in i need only programmin and coding tecnique strictly(dont want theory)means where oops programming needs in reporting,alv and bdc ,i need only programming related material,so if any body having the connecting links or material or objects regarding the above said things kindly reply me here or by sending mail to [email protected]

    Hi ...
    Here i am sending you one Link.....Follow this link and there you can find
    theory as well as the sample code examples for every technology in ABAP.
    Go for:-  http://abapprogramming.blogspot.com/2007/10/oops-abap-2.html.
    Regards,
    Mandeep.
    Note: Plz do not forget to award points if reply is useful.

  • Using field symbols in OOPs programming...have ur points.

    Hi all,
    I want to use field symbols in OOPS programming like this...
    But the system is giving me dump....help me.
    START-OF-SELECTION.
    CREATE OBJECT OBJ.
    FIELD-SYMBOLS : <AB> TYPE ANY.
    ASSIGN OBJ TO <AB>.
    CALL METHOD <AB>->add
      EXPORTING
        a      = 4
        b      = 6
      changing
        c      = Z
    WRITE : / Z.

    check the code below
    TYPES: BEGIN OF t_struct,
             col1 TYPE i,
             col2 TYPE i,
           END OF t_struct.
    DATA: dref1 TYPE REF TO data,
          dref2 TYPE REF TO data.
    FIELD-SYMBOLS: <fs1> TYPE t_struct,
                   <fs2> TYPE i.
    CREATE DATA dref1 TYPE t_struct.
    ASSIGN dref1->* TO <fs1>.
    <fs1>-col1 = 1.
    <fs1>-col2 = 2.
    dref2 = dref1.
    ASSIGN dref2->* TO <fs2> CASTING.
    WRITE / <fs2>.
    GET REFERENCE OF <fs1>-col2 INTO dref2.
    ASSIGN dref2->* TO <fs2>.
    WRITE / <fs2>.
    reward points if helpful.........

  • Events in OOPS Programming

    Dear all,
    Can anybody tell me please which events are being used in ABAP OOPS Programming ? Please , needful reply for same....

    check these links
    http://erpgenie.com/abaptips/content/view/394/61/
    http://erpgenie.com/abaptips/content/view/395/61/
    Thanks
    Bala Duvvuri

  • Hi all problem in demo OOPS program

    I have written small abap-oops program but it is giving error that
    The line type of "OBJ" must be compatible with one of the types
    "<b>OBJ_RECORD</b>".     
    Plz help me out.     
    REPORT zkclass1.
          CLASS number1 DEFINITION
    CLASS number1 DEFINITION.
      PUBLIC SECTION.
        METHODS : constructor IMPORTING x1 TYPE i
                                        y1 TYPE i.
        METHODS : findsum EXPORTING z TYPE i.
      PRIVATE SECTION.
        DATA : x TYPE i,
               y TYPE i.
    ENDCLASS.
          CLASS number IMPLEMENTATION
    CLASS number1 IMPLEMENTATION.
      METHOD constructor.
        x = x1.
        y = y1.
      ENDMETHOD.
      METHOD findsum.
        z = x + y.
        WRITE : / z.
      ENDMETHOD.
    ENDCLASS.
    DATA : obj TYPE REF TO number1.
    DATA : z1 TYPE i.
    PARAMETERS : s_x1 type i obligatory.
    PARAMETERS : s_y1 type i obligatory.
    START-OF-SELECTION.
      CREATE OBJECT obj EXPORTING x1 = s_x1
                                  y1 = s_y1.
      CALL METHOD OF OBJ -> FINDSUM EXPORTING x1 = s_x1
                                              y1 = s_y1.

    Hi,
    Try this way.
    * CLASS number1 DEFINITION
    CLASS number1 DEFINITION.
      PUBLIC SECTION.
        METHODS : constructor IMPORTING x1 TYPE i
                                        y1 TYPE i.
        METHODS : findsum EXPORTING z TYPE i
                                    y1 type i. "Changed
      PRIVATE SECTION.
        DATA : x TYPE i,
        y TYPE i.
    ENDCLASS.
    * CLASS number IMPLEMENTATION
    CLASS number1 IMPLEMENTATION.
      METHOD constructor.
        x = x1.
        y = y1.
      ENDMETHOD.
      METHOD findsum.
        z = x + y.
        y1 = me->y. "Changed
        WRITE : / z.
      ENDMETHOD.
    ENDCLASS.
    DATA : obj TYPE REF TO number1.
    DATA : z1 TYPE i.
    PARAMETERS : s_x1 TYPE i OBLIGATORY.
    PARAMETERS : s_y1 TYPE i OBLIGATORY.
    START-OF-SELECTION.
      CREATE OBJECT obj EXPORTING x1 = s_x1
                                  y1 = s_y1.
    "Use This way here.
      CALL METHOD obj->findsum IMPORTING z = s_x1
                                         y1 = s_y1.
    " Don't use this here.                       
    *CALL METHOD OF OBJ -> FINDSUM EXPORTING x1 = s_x1
    *y1 = s_y1.                          " 'OF' is used for OLE Objects
    Regards.
    Marcelo Ramos

  • OOP Programming Question

    Hi,
    Im new to oop in as3.0, just finished my first oop application but there is one thing that i don't understand.
    If i have movieclips on the stage and i want for ex. the display class to control there position and size then
    i need to send it from the document class to the display class using a public method on the display class.
    but after developing my first application i got to a point that all of my methods on the display class were public
    and i used a lot of repatitive code.... ive been told that i need to avoid public methods and try and keep most of the methods in
    the different classes private but the only way to do it is to find a way to pass the movie clip instance to the actual class and control it
    and this way most of the methods in the class will be private and the code on the document class will be a lot more cleaner, but i dont really
    know how to pass a display object to a different class and use it without passing it to a public method through the document class.

    I'm relatively new to OOP programming, so please
    excuse this newbish question :).
    I've been assigned to take over for a co-worker that
    has left for vacation. A class that he wrote is
    partially implemented, so I'm supposed to finish it
    up.
    One class in particular, his constructor is empty.That's fine, if that's what makes sense. I'd have one constructor that set all the private data members. Other constructors would call it using sensible defaults where needed.
    If the ctor is empty and data members are null, that's very bad. An object should be 100 percent ready to go when you create it.
    And to set the instance variables, the user class is
    setting them directly, not through accessor methods.So the data members are public? Oh, my. Where's the encapsulation?
    This seems like a bad idea, and defeats the whole
    purpose of encapsulation. Indeed. Sounds like you know more than your co-worker.
    I wanted to re-do some of the code, but are there any
    good reasons as to why he might be doing this?If it's a DTO C-struct with no other purpose than ferrying data it might be acceptable. I would say it's not acceptable, but that's my opinion.
    Saving some overhead maybe?No, the "overhead" is probably not measurable. I wouldn't optimize such a thing without data that told me it was the bottleneck, and I'd make sure that this "fix" did address the problem before I cast it in stone.
    %

  • HOW TO PREPARE TECH SPEC FOR OOPS PROGRAM

    Hi..
    This is Sri .I Created a Report program in oops. can any one help how to prepare tech spec for this oops report,,can i need to mention Classes ,Methods, ref-classes,screens in preparation of Spec..
    Thanks in advance..I surly reward with points if my prob is solved,,,,,,
    SRI

    Hi Sri,
    Tech Spec is nothing but a document containing some technical information about
    the object you have developed/coded. Normally this should be prepared before you code and not the other way round.
    You should mention relevant classes created / used. If you have created / added some class components like attributes/methods/events/interfaces mention that too.
    You can also mention functionality to be coded in methods of the class. Please understand it is not a replica of your program but some useful technical info that the coder will use to code and later people will use for maintainance purpose.
    It is better if you have some defined template for the tech spec, else just put the info in a structured and readable manner.
    Regards
    Indrajit.

  • Oops program

    Hi,
    While develping oops ALV report  developing screen and placing custom container why is  it  and without creating screen can we develop  oops alv report?
    Thanks,
    Asha

    While develping oops ALV report developing screen and placing custom container it is compulsary and without creating screen can we not develop oops alv report
    This is because of concept of oops
    Here we are creting one grid object and one container.
    We will place all our final output data in Grid object and to assign that object in screen we need one empty container. So both Grid and container is necessary
    All standard features of OOPs ALV provided automatically.
    Whenever user will change output for Ex sort of any field Grid will handle that functionality
    So it is necessary to crete the Grid and Container in every program
    oops_beginers
    http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    good book on ABAP objects(OOPS)
    http://www.esnips.com/doc/bc475662-82d6-4412-9083-28a7e7f1ce09/Abap-Objects---An-Introduction-To-Programming-Sap-Applications
    Rewards if useful...
    Minal Nampalliwar
    null

  • OOPS  Program for rectification.

    Hi Experts!!
    This program is syntatically correct. But output not Coming.
    Prerequisite : Screen no 100
    Container Name: Container.
    *& Report  ZSAP_OBJECT                                                 *
    REPORT  zsap_object                             .
          CLASS select_display_sflight DEFINITION
    CLASS select_display_sflight DEFINITION.
      PUBLIC SECTION.
        TYPES: BEGIN OF s_sflight_tab,
               connid TYPE sflight-connid,
               carrid TYPE sflight-carrid,
               END OF s_sflight_tab.
        CLASS-METHODS class_constructor.
        METHODS: constructor IMPORTING i_carrid TYPE sflight-carrid
                                       i_connid TYPE sflight-connid
                             EXCEPTIONS nothing_found,
                                        display_flights.
      PRIVATE SECTION.
        CLASS-DATA list TYPE REF TO cl_gui_alv_grid.
        DATA: sflight_tab1 TYPE standard TABLE OF s_sflight_tab,
       with unique key carrid,
        sflight_Tab type sflight_tab1,
              wa_tab TYPE s_sflight_tab.
    ENDCLASS.                    "select_display_sflight DEFINITION
          CLASS select_display_sflight IMPLEMENTATION
    CLASS select_display_sflight IMPLEMENTATION.
      METHOD: class_constructor.
        CREATE OBJECT list
        EXPORTING i_parent = cl_gui_container=>screen0.
      ENDMETHOD.                    "class_constructor
      METHOD constructor.
    *select carrid connid into corresponding fields of table sflight_tab1
    *from sflight
               where carrid = i_carrid and
                     connid = i_connid.
        SELECT carrid connid FROM sflight
       INTO CORRESPONDING FIELDS OF wa_tab WHERE carrid = i_carrid AND
                                     connid = i_connid.
    comments<b>
    <u>I want to move data from wa_tab to sflight_tab1**</b></u>
    *move-corresponding wa_tab to sflight_Tab1.
        ENDSELECT.
    if sy-subrc = 0.
    *sflight_tab = wa_tab.
    *sflight_tab-connid = wa_tab-connid.
        else.
          RAISE nothing_found.
        ENDIF.
      ENDMETHOD.                    "constructor
      "constructor
      METHOD display_flights.
        CALL METHOD list->set_table_for_first_display
          EXPORTING
            i_structure_name = 'SFLIGHT'
          CHANGING
            it_outtab        = sflight_tab1.
            it_outtab        = wa_tab.
        CALL SCREEN 100.
      ENDMETHOD.                    "display_flights
    ENDCLASS.                    "select_display_sflight IMPLEMENTATION
    SELECTION-SCREEN BEGIN OF SCREEN 500.
    PARAMETERS: p_carrid TYPE sflight-carrid,
                p_connid TYPE sflight-connid.
    SELECTION-SCREEN END OF SCREEN 500.
    DATA: BEGIN OF ref_tab_line,
          carrid TYPE sflight-carrid,
          connid TYPE sflight-connid,
          oref TYPE REF TO select_display_sflight,
          END OF ref_tab_line,
    ref_tab LIKE SORTED TABLE OF ref_tab_line WITH UNIQUE KEY carrid connid.
    START-OF-SELECTION.
      DO.
        CALL SELECTION-SCREEN 500 STARTING AT 10 10.
        IF sy-subrc <> 0.
          LEAVE PROGRAM.
        ENDIF.
        ref_tab_line-carrid = p_carrid.
        ref_tab_line-connid = p_connid.
        READ TABLE ref_tab INTO ref_tab_line FROM ref_tab_line.
        IF sy-subrc <> 0.
          CREATE OBJECT ref_tab_line-oref
                   EXPORTING i_carrid = p_carrid
                             i_connid = p_connid
                             EXCEPTIONS nothing_found = 4.
          IF sy-subrc = 4.
            MESSAGE i888(sabapdocu) WITH 'no data'.
          ENDIF.
        ENDIF.
        CALL METHOD ref_tab_line-oref->display_flights.
      ENDDO.<u></u>
    Thanks in Advance.

    Hello Anil
    The error is located in the CLASS_CONSTRUCTOR method.
    CLASS select_display_sflight IMPLEMENTATION.
    METHOD: class_constructor.
      CREATE OBJECT list    " TYPE REF TO cl_gui_alv_grid
        EXPORTING i_parent = cl_gui_container=>screen0.
    ENDMETHOD. "class_constructor
    The parent of an grid instance always must be a container (e.g. docking container). Thus, simply change your method as following:
    METHOD class_constructor.
      CREATE go_docking
        EXPORTING
         parent = cl_gui_container=>screen0
         ratio    = 90.
      CREATE go_grid
         EXPORTING
           parent = go_docking.
    " Link the docking container to the screen -> NOTE: In this case no
    " custom container is required as screen element.
      CALL METHOD go_docking->link
        EXPORTING
          repid = syst-repid
          dynnr = '0100'
    "      container = ' '     " optional
    ENDMETHOD.
    For a sample report (<b>ZUS_SDN_TWO_ALV_GRIDS</b>) have a look at thread
    sample alv program using classes & methods ..but not using container
    Regards
      Uwe

  • Issue on OOPS programing

    Hi,
      I need Class name for pop up menu, input as internal table.
    Thanks&
    Regards
    MAdhu

    Hi check the following link,
    http://help.sap.com/saphelp_47x200/helpdata/en/52/5f05fce02d11d2b47d006094192fe3/frameset.htm
    please reward for the same.

  • Timing in OOP programming

    Hi,
    I need to get the order in which stuff happens in my first game right. Here is what I want to do.
    Player clicks play button, button goes away and timer starts. //This is all working fine
    Next I want a text box to animate for 60frames. //This works fine
    ONLY then I want my next movie clips to start playing
    How do I make step 3 wait for that 60 frames? I have no idea of how to code this.
    Please help
    Charine

    Hi kglad,
    I built a new timer with an event listener to trigger the appearance of my text box after the play button has been pushed.
    Once the first event has played I will make the next one follow. But I have a problem with the first even.
    My swf runs, but without the text box. It gives me the following error message the second time round:
              Word Timer Started
              TypeError: Error #1009: Cannot access a property or method of a null object reference.
                  at BugGoopFSGame/placeMyWordBox()
                  at flash.utils::Timer/_timerDispatch()
                  at flash.utils::Timer/tick()
              Word Timer Finished
    My main .as file has the timers. The one not working call a function for wordArray.placeMyWordBox();
    My WordArray .as file is for the word array in which the loop and all the logics will work. In it it has this function
    public function placeMyWordBox():void
                addChild(wordBox);
      3.My WordBox .as class file is the one in which the text box with TLF text lives within a movie clip (embedded text)
    I checked for spelling mistakes and syntex errors - can't find anything. How do I fix this?
    Thanks
    Charine
    Here are my files:
    1. Main .as file with three timers. Two work (game and tile timers) and the word timer give above error
    package
        import flash.display.*;
        import flash.utils.Timer;
        import flash.events.*;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.text.*;
        import flash.//others not relevant to this
        public class BugGoopFSGame extends MovieClip
            public var *//lots not relevant,
            public var gameTimer:Timer;
            public var wordTimer:Timer;
            public var tileTimer:Timer;
            public var myplaybtn:Play;
            public var wordBox:WordBox;
            public var wordArray:WordArray;
            public function BugGoopFSGame()
                 // lots of children not relevant
                myplaybtn = new Play();
                addChild(myplaybtn);
                gameTimer = new Timer(31,5120);
                wordTimer = new Timer(1000,1); //Just once for 60 flames, because I want game timer to follow this later.
                tileTimer = new Timer(500,384);
                //Add event listener for start button
                myplaybtn.addEventListener(MouseEvent.CLICK, startTimer);
                //Add event listener for Game timer WORKS FINE;
                gameTimer.addEventListener(TimerEvent.TIMER, tickTock);
                gameTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerFinished);
                gameTimer.addEventListener(TimerEvent.TIMER, scaleLifeBar);
                // Add event listener for tileTimer functions WORKS FINE
                tileTimer.addEventListener(TimerEvent.TIMER, runTile);
                tileTimer.addEventListener(TimerEvent.TIMER_COMPLETE, tileTimerFinished);
                tileTimer.addEventListener(TimerEvent.TIMER, gameLoop);
                //Add event listener for word Timer functions - problem here
                wordTimer.addEventListener(TimerEvent.TIMER, wordTimerStarted);
                wordTimer.addEventListener(TimerEvent.TIMER_COMPLETE, wordTimerFinished);
                wordTimer.addEventListener(TimerEvent.TIMER, placeMyWordBox);// This does not run in swf
            //Start timer function
            public function startTimer(timerEvent:MouseEvent):void
               gameTimer.start();
                trace("Timer started");
                myplaybtn.visible = false;
                tileTimer.start();
                trace("TileTimer started");
                wordTimer.start();
                trace("Word Timer Started");
           public function tickTock(timerEvent:TimerEvent):void
                trace("Tick");
            public function timerFinished(timerEvent:TimerEvent):void
                trace("Timer is finished");
            public function runTile(timerEvent:TimerEvent):void
                trace("Run Tile, RUN!")
                public function tileTimerFinished(timerEvent:TimerEvent):void
                trace("Tile Timer is finished");
            //start wordArray
            public function wordTimerStarted(timerEvent:TimerEvent):void
                trace("Word Timer Started");
            public function wordTimerFinished(timerEvent:TimerEvent):void
                trace("Word Timer Finished");
            public function placeMyWordBox(timerEvent:TimerEvent):void //box never appears in swf
                wordArray.placeMyWordBox();
                trace("WordArray added");
            //Start gameLoop
            public function gameLoop(timerEvent:TimerEvent):void
                        letterArray.gameLoop();
    2.  .as file in which the loop and all the logics will work
    package
        import flash.display.MovieClip;
        public class WordArray extends MovieClip
            public var wordBox:WordBox = new WordBox();
            //private var  wordsL1:Array = ("a","has","of","off","on","not","got","in","is","it");
            // ***constructor code
            public function WordArray()
                trace("Word Array is working");
            public function placeMyWordBox():void
                addChild(wordBox);
    3..as class file in which the text box with TLF text lives within a movie clip (embedded text)
    package 
        import flash.display.MovieClip;
        import flash.text.*;
        public class WordBox extends MovieClip
            public var wordBox = new WordBox();
            // constructor code
            public function WordBox()
                x = 305;
                y = 326;

  • How to desing a program

    I'm trying to do a invoicing program. I think I know enough of java to do it, but the problem is that it is too big for me, because I can't, for example, see were should I start, or how to interconnect the various modules of the program.
    So, do you know any tutorial / howto / eBook about how to desing a program in OOP?
    Thank you.

    I'm trying to do a invoicing program. I think Iknow
    enough of java to do it, but the problem is thatit
    is
    too big for me, because I can't, for example, seewere
    should I start, or how to interconnect the various
    modules of the program.
    So, do you know any tutorial / howto / eBook abouthow
    to desing a program in OOP?
    Thank you.<sarcasm>Of course not. Nobody has ever
    written
    a book/tutorial on OOP programming, let alonehundreds
    of them</sarcasm>
    http://www.google.com/search?hl=en&lr=&q=design+program
    OOPsorry, maybe I puted my question in a wrong way (or
    maybe it is stupid), but I was not looking for a
    tutorial of what is polymorphism or Inheritance, but a
    tutorial of were you should start to do your program
    (if it was some size), or how will the diferent parts
    interact, or things like those. Is my question more
    acceptable now?So if I don't misunderstand your question, what you are actually asking is how do you decide the cohesiveness of rules, data, and etc to build the objects around? And when should you start planning such?
    If this is what you are asking then the second part should be answered first: Don't actually start any design process until your business rules are certain--processes well defined--and you have taken a very good look at the work-place/environment you want to target.
    Once you have the business rules and understand the process flow for your task, then get out a object oriented design book (not a java book) and brush up on OOP. Once you have the OO Design, then start looking for implementation.

  • No CALL METHOD syntax used in Dynpro programming

    Hi Gurus,
    I have just starded with Web Dynpro ABAP. I found that while writing code we don't use CALL METHOD .
    i.eTABLE_NODE = WD_CONTEXT->GET_CHILD_NODE('MY_TABLE_NODE').
    How can we directly call a method using interface variable e.g WD_CONTEXT without syntax CALL METHOD?
    Can anyone explain?
    I am not much familiar with OOPs.
    Thanks in advance.

    Hi Anzy,
    Can u correct this program to let me understand this concept. ( An example ABAP OOPs program)
    REPORT  zjt_test_interface.
    INCLUDE  zjt_test_interfac_class.
    DATA : dd TYPE REF TO demo ,
           inter TYPE REF TO sample,
           inter1 TYPE REF TO sample.
    START-OF-SELECTION.
      CREATE OBJECT dd .
      inter = dd.
      call method inter->test. ******No error with this statement
    inter1 = inter->test.  *********** This statement gives error "Field 'Test' unknown
    The below code is a separate include program.
    *&  Include           ZJT_TEST_INTERFAC_CLASS
    INTERFACE sample  .
      METHODS  test .
    ENDINTERFACE.                    "sample
          CLASS demo DEFINITION
    CLASS demo DEFINITION.
      PUBLIC SECTION.
        INTERFACES sample .
        METHODS : constructor.
    ENDCLASS.                    "demo DEFINITION
          CLASS demo IMPLEMENTATION
    CLASS demo IMPLEMENTATION.
      METHOD constructor.
      ENDMETHOD.                    "constructor
      METHOD  sample~test.
        WRITE : 'Method test of Interface sample executed'.
      ENDMETHOD.                    "sample~test

  • How to handle modules in OOP

    Hi,
    I am writing a simple Rock-Paper-Scissors program and I read a lot of basic stuff so far, also read some parts of Code Complete, but I still have some basic questions about the structure of an OOP program:
    - If I have "module" of the program (for example that calculates the computer's choice in my Rock-Paper program based on my previous choices) that is too big to put it into a method, do I have to create a class for it? For what I read so far, classes are not to pack some part of the code together, but I don't how else could I handle a module of a program. In my Rock-.. program I would call it Calculator, I think it's ok, for example I've seen java.util.Scanner, which is some kind of "doer" packed in a class, too.
    - But if I create this class, it would not be a blueprint for objects. I only need one object, so should I use that so called singleton pattern?
    - Or should I make every field in this object static instead of the singleton pattern?
    (I also don't know what the Main class and main() method should usually contain, I don't know if this connects to this in any way, so this might be another topic..)
    Thanks in advance for any help.

    lemonboston wrote:
    Hi,
    I am writing a simple Rock-Paper-Scissors program and I read a lot of basic stuff so far, also read some parts of Code Complete, but I still have some basic questions about the structure of an OOP program:
    - If I have "module" of the program (for example that calculates the computer's choice in my Rock-Paper program based on my previous choices) that is too big to put it into a method, do I have to create a class for it? For what I read so far, classes are not to pack some part of the code together, but I don't how else could I handle a module of a program. In my Rock-.. program I would call it Calculator, I think it's ok, for example I've seen java.util.Scanner, which is some kind of "doer" packed in a class, too.
    I'm not 100% sure if you are using the right terminology. I normally think of a module as a grouping of functionality, in Java normally a series of classes (more likely a group of packages).
    Generally, if logic is too complex, you need to break it into smaller, discrete pieces. Ideally, each method does one thing and only one thing well. This has nothing per se to do with OOP. You could do the same procedurally with namespaces (or packages or whatever they offer) and organizing your source files.
    Within Java, you would have the option of breaking your larger method into smaller (likely private) methods. Then once you see that different methods have different responsibilities, you may refactor your design into separate classes.
    - But if I create this class, it would not be a blueprint for objects. I only need one object, so should I use that so called singleton pattern?Are you talking classes or objects? Your design may need one or more classes. A singleton is a pattern that when implemented ensures at runtime that only one instance (object) of a class exists in a given JVM.
    - Or should I make every field in this object static instead of the singleton pattern?
    I think you are conflating things here. What is motivating you to make something static?
    (I also don't know what the Main class and main() method should usually contain, I don't know if this connects to this in any way, so this might be another topic..)
    Yes, another topic. The class can be named anything. It simply needs a main() method with a valid signature to act as an application entry point.
    Thanks in advance for any help.You are welcome.
    - Saish

Maybe you are looking for

  • How to set a field that automatically generates a unique 'code'/'ID'  for fillable PDF form?

    Hi, I'm trying to create a PDF fillable form with Acrobat X Pro. Can Acrobat allow a function, so that it can automatically generate a 'number'/'code' which I could use as an 'identifier'? eg.  A hidden field named:  'DOC ID' and provide 100001 when

  • New laptop workstation for time lapse editing

    Hello all, I'm in the process of buying a new custom laptop, and I seek your inputs regarding the specs, The laptop will be based on the Clevo P370EM chassis, a pretty robust machine. 17.3" Full HD (1920x1080) Glossy 90% NTSC Color Gamut LED Backlit

  • I have problems uploading movies onto Facebook. What do I do?

    Hi all I have the app iMovie for MacBooks but when I try to upload a video onto Facebook sometime during the upload. The app quits unexpectedly. I need help what am I supposed to do?

  • Release Stratergy in PR

    hi, Even though the PR is not approved the user want to create RFQ for that PR.But SAP wouldn't allow to do it. an error message was displayed. Is there any user exit to process the RFQ with out the approval of PR. Thanks!

  • Trouble pasting PICT graphic into Illustrator

    I used to be able to copy and paste a PICT graphic from Data Desk into Illustrator (version 10) and edit it.  However, in version 14 (CS4) it appears as a bitmap image that I cannot edit. I am not sure whether this is related to my recent upgrade to