Program of type Class Pool

When we create a class in the Class Builder i.e. SE24, a program of type Class Pool is generated automatically. Where will we find the name of that program?
Thanks,
Ibrahim

Hello Ibrahim
In the TADIR table you will find only the object entry for your class (e.g. R3TR CLAS ZCL_MY_CLASS).
However, table PROGDIR contains all the sub-objects of your class (Macros section not available).
In addition, you may find class CL_OO_CLASSNAME_SERVICE useful.
Regards
  Uwe

Similar Messages

  • Difference between Class Pool program and Interface Pool program

    Both Class Pool program and an Interface Pool program indicate that the program contains interfaces that other programs can use globally. What exactly is the difference between them?

    Transparent Table :
    Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.
    " Pooled Table :
    Pooled tables are logical tables that must be assigned to a table pool when they are defined. Pooled tables are used to store control data. Several pooled tables can be cominied in a table pool. The data of these pooled tables are then sorted in a common table in the database.
    " Cluster Table :
    Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to strore control data. They can also be used to store temporary data or texts, such as documentation.
    " what is the major difference between Standard tables, Pooled tables and
    " Clusterd Tables?
    A transparent table is a table that stores data directly. You can read these tables directly on the database from outside SAP with for instance an SQL statement.
    Transparent table is a one to one relation table i.e. when you create one transparent table then exactly same table will create in data base and if is basically used to store transaction data.
    A clustered and a pooled table cannot be read from outside SAP because certain data are clustered and pooled in one field.
    One of the possible reasons is for instance that their content can be variable in length and build up. Database manipulations in Abap are limited as well.
    But pool and cluster table is a many to one relationship table. This means many pool table store in a database table which is know as table pool.
    All the pool table stored table in table pool does not need to have any foreign key relationship but in the case of cluster table it is must. And pool and cluster table is basically use to store application data.
    Table pool can contain 10 to 1000 small pool table which has 10 to 100 records. But cluster table can contain very big but few (1 to 10) cluster table.
    For pool and cluster table you can create secondary index and you can use select distinct, group for pool and cluster table. You can use native SQL statement for pool and cluster table.
    A structure is a table without data. It is only filled by program logic at the moment it is needed starting from tables.
    A view is a way of looking at the contents of tables. It only contains the combination of the tables at the basis and the way the data needs to be represented. You actually call directly upon the underlying tables.
    . Transparent tables (BKPF, VBAK, VBAP, KNA1, COEP)
    Allows secondary indexes (SE11->Display Table->Indexes)
    Can be buffered (SE11->Display Table->technical settings) Heavily updated tables should not be buffered.
    II. Pool Tables (match codes, look up tables)
    Should be accessed via primary key or
    Should be buffered (SE11->Display Table->technical settings)
    No secondary indexes
    Select * is Ok because all columns retrieved anyway
    III. Cluster Tables (BSEG,BSEC)
    Should be accessed via primary key - very fast retrieval otherwise very slow
    No secondary indexes
    Select * is Ok because all columns retrieved anyway.
    Performing an operation on multiple rows is more efficient than single row operations.
    Therefore you still want to select into an internal table.
    If many rows are being selected into the internal table,
    you might still like to retrieve specific columns to cut down on the memory required.
    Statistical SQL functions (SUM, AVG, MIN, MAX, etc) not supported
    Can not be buffered
    IV. Buffered Tables (includes both Transparent & Pool Tables)
    While buffering database tables in program memory (SELECT into internal table) is generally a good idea for performance,
    it is not always necessary.
    Some tables are already buffered in memory.
    These are mostly configuration tables.
    If a table is already buffered, then a select statement against it is very fast.
    To determine if a table is buffered, choose the 'technical settings' soft button from the data dictionary
    display of a table (SE12). Pool tables should all be buffered.
    More at this link.
    http://help.sap.com/saphelp_erp2004/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
    Transparent Table:
    Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.
    Pooled Table:
    Pooled tables are logical tables that must be assigned to a table pool when they are defined. Pooled tables are used to store control data. Several pooled tables can be cominied in a table pool. The data of these pooled tables are then sorted in a common table in the database.
    Cluster Table:
    Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to strore control data. They can also be used to store temporary data or texts, such as documentation.
    A transparent table is a table that stores data directly. You can read these tables directly on the database from outside SAP with for instance an SQL statement.
    Transparent table is a one to one relation table i.e. when you create one transparent table then exactly same table will create in data base and if is basically used to store transaction data.
    A clustered and a pooled table cannot be read from outside SAP because certain data are clustered and pooled in one field.
    One of the possible reasons is for instance that their content can be variable in length and build up. Database manipulations in Abap are limited as well.
    But pool and cluster table is a many to one relationship table. This means many pool table store in a database table which is know as table pool.
    All the pool table stored table in table pool does not need to have any foreign key relationship but in the case of cluster table it is must. And pool and cluster table is basically use to store application data.
    Table pool can contain 10 to 1000 small pool table which has 10 to 100 records. But cluster table can contain very big but few (1 to 10) cluster table.
    For pool and cluster table you can create secondary index and you can use select distinct, group for pool and cluster table. You can use native SQL statement for pool and cluster table.
    A structure is a table without data. It is only filled by program logic at the moment it is needed starting from tables.
    A view is a way of looking at the contents of tables. It only contains the combination of the tables at the basis and the way the data needs to be represented. You actually call directly upon the underlying tables.
    http://www.datamanagementgroup.com/Resources/Articles/Article_0106_2.asp
    more info
    http://help.sap.com/saphelp_erp2004/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
    http://cma.zdnet.com/book/abap/ch03/ch03.htm
    Check this links.
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    http://www.techinterviews.com/?p=198

  • How to create a class pool

    Hi how to create a class pool when i tried to create it has shown the following error
    <b>Unable to change program from or to type K
    Message no. DS165
    Diagnosis
    You tried to assign a type to a program that cannot be assigned in the program attributes, but can only be set internally by one of the tools in the ABAP Workbench.
    The following program types are reserved:
    F Reserved for Function Groups
    Function groups are adminstered by the Function Builder, and you can only create or delete them using the Function Builder or the Object Navigator (Transaction SE80).
    K Reserved for Class Defintions
    Class definitions are administered in the Class Builder. You can only create or delete them using the Clas Builder or the Object Navigator.
    J Reserved for Interface Definitions
    Interface definitions are administered in the Clas Builder. You can only create or delete them using the class Builder or the Object Navigator.</b>

    Hi,
    Though you get a popup for different options for different program types like Class pools, function groups etc in SE 38 Program attributes, you can't create them from Se38 transaction.
    They have to be created from different places.
    Class Pools are nothing but creating CLASSes and INTERFACEs using the T Code SE24.
    This needs little Java/OOPs concepts to create and use them.
    Hope this helps.
    Regards,
    Anji

  • Difference between interface pool and class pool

    Hi,
    Can any body tell me the difference between Interface pool and Class pool.
    thank you in advance.
    regards

    Hi,
    Class and Interface Pools
    This section discusses the structure and special features of class and interface pools for global classes.
    Global Classes and Interfaces
    Classes and interfaces are object types. You can define them either globally in the Repository or locally in an ABAP program. If you define classes and interfaces globally, special ABAP programs called class pools or interface pools of type K or J serve as containers for the respective classes and interfaces. Each class or interface pool contains the definition of a single class or interface. The programs are automatically generated by the Class Builder when you create a class or interface.
    A class pool is comparable to a module pool or function group. It contains both declarative and executable ABAP statements, but cannot be started on its own. The runtime system can create runtime instances (objects) through a request using the CREATE OBJECT statement. These objects execute the statements of the class pool.
    Interface pools do not contain any executable statements. Instead, they are used as containers for interface definitions. When you implement an interface in a class, the interface definition is implicitly included in the class definition.
    Structure of a Class Pool
    Class pools are structured as follows:
    Class pools contain a definition part for type declarations, and the declaration and implementation parts of the class.
    Differences From Other ABAP Programs
    Class pools are different from other ABAP programs for the following reasons:
    ·        ABAP programs such as executable programs, module pools, or function modules, usually have a declaration part in which the global data for the program is defined. This data is visible in all of the processing blocks in the program. Class pools, on the other hand, have a definition part in which you can define data and object types, but no data objects or field symbols. The types that you define in a class pool are only visible in the implementation part of the global class.
    ·        The only processing blocks that you can use are the declaration part and implementation part of the global class. The implementation part may only implement the methods declared in the global class. You cannot use any of the other ABAP processing blocks (dialog modules, event blocks, subroutines, function modules).
    ·        The processing blocks of class pools are not controlled by the ABAP runtime environment. No events occur, and you cannot call any dialog modules or procedures. Class pools serve exclusively for class programming. You can only access the data and functions of a class using its interface.
    ·        Since events and dialog modules are not permitted in classes, you cannot process screens in classes. You cannot program lists and selection screens in classes, since they cannot react to the appropriate events. It is intended to make screens available in classes. Instead of dialog modules, it will be possible to call methods of the class from the screen flow logic.
    Local Classes in Class Pools
    The classes and interfaces that you define in the definition part of a class pool are not visible externally. Within the class pool, they have a similar function to local classes and interfaces in other ABAP programs. Local classes can only be instantiated in the methods of the global class. Since subroutines are not allowed in class pools, local classes are the only possible modularization unit in global classes. Local classes have roughly the same function for global classes as subroutines in function groups, but with the significant exception that they are not visible externally
    Reward points if useful....
    Regards
    AK

  • Purpose of the declaring the below type u0096 pools ?

    Hi All,
    What is the Purpose of the declaring the below type – pools in the program. Why we need type-pools in the program.
    TYPE-POOLS: SLIS,
    GSETC.
    Akshitha.

    type pool  slis
    Type-pools is a place where u can store the type declarations globally which can be used in your ABAP program. Type-pools SLIS Stores all the ALV related Type definitions.
    example
    For example when you create an ALV program, all types you need to use are defined in types pool SLIS.
    The objects that you don't want to create in SE11 but want a single place where you can declare them together will be done in TYPE POOLs. The best example is SLIS where you have declared all the TYPES that are required to execute a ALV REPORT using the REUSE functions.
    In this way you define your types only once and then you can use them everytime you need:
    TYPE-POOLS SLIS.
    DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    The type SLIS_T_FIELDCAT_ALV is defined in type pools SLIS.
    type pool gsetc
    .GSETC type pool stores codes for differenct group classes
       i.e. gsetc_costcenter_setclass = '0101'
    example
    *& Report  ZCCGROUP_HIER                                               *
    REPORT ZCCGROUP_HIER.
    GSETC type pool stores codes for differenct group classes
       i.e. gsetc_costcenter_setclass = '0101'.
    TYPE-POOLS: gsetc. "
    TYPES: gseth_node_line    LIKE grpobjects,
           gseth_node_tab     TYPE gseth_node_line OCCURS 0.
    TYPES: gseth_val_line     LIKE grpvalues,
           gseth_val_tab      TYPE gseth_val_line OCCURS 0.
    TYPES: GSETH_MD_LINE      LIKE GRPMDLINE,
           GSETH_MD_TAB       TYPE GSETH_MD_LINE OCCURS 0.
    DATA: it_nodes            TYPE  gseth_node_tab,
          it_values           TYPE  gseth_val_tab,
          it_mdtab            type gseth_md_tab,
          wa_mdtab            type GSETH_MD_LINE.
    DATA: ld_setid            TYPE sethier-setid,
          ld_info             LIKE grphinfo,
          ld_overwrite        LIKE sy-datar.
    PARAMETERS: p_ksgru  LIKE rksb1-ksgru,
                p_burks       TYPE bseg-BUKRS.
    CONCATENATE gsetc_costcenter_setclass p_burks p_ksgru INTO ld_setid.
    CALL FUNCTION 'K_HIERARCHY_TABLES_READ'
      EXPORTING
        e_class                           = gsetc_costcenter_setclass
                                                     "from gsetc type-pool
        e_setid                           = ld_setid
        e_kokrs                           = p_burks "company code
        E_MANDT                           = sy-mandt
        E_MASTER_DATA                     = 'XXX'
    displays popup to confirm if a large amount of data is to be retrieved
        E_STRUCTURE                       = 'X  X0200'  "displays popup to confirm
        E_REPLACE_CLASS                   =
        E_REPLACE_UNIT                    =
        E_REPLACE_TABLE                   = ' '
        E_REPLACE_FIELD                   = ' '
        E_SUFFIX                          =
        E_OLD_LINE_LEVEL                  = 0
      IMPORTING
        I_DOUBLE_CHECK                    =
        I_MASTER_DATA                     =
      TABLES
        t_nodes                           = it_nodes
        t_values                          = it_values
        T_MASTER_DATA                     = it_mdtab
        T_FORMULA                         =
        T_FIELD_INFO                      =
        T_NODE_LIST_OVERWRITE             =
      CHANGING
        c_info                            = ld_info
        c_overwrite                       = ld_overwrite
    EXCEPTIONS
       no_controlling_area               = 1
       no_chart_of_account               = 2
       different_controlling_areas       = 3
       different_chart_of_accounts       = 4
       set_not_found                     = 5
       illegal_field_replacement         = 6
       illegal_table_replacement         = 7
       fm_raise                          = 8
       convert_error                     = 9
       no_overwrite_standard_hier        = 10
       no_bukrs_for_kokrs                = 11
       OTHERS                            = 12.
    BREAK-POINT.
    An alternative function module can be found below which
    is slightly easier to code but there is no direct link between
    the hier and the val tables, it is just based on there
    index possition.
    *types : begin of T_SETHIER.
      include STRUCTURE  SETHIER_CO.
    *types: end of t_sethier.
    *data: it_SETHIER type standard table of t_SETHIER.
    *types : begin of T_SETVAL.
      include STRUCTURE  SETVAL_CO.
    *types: end of t_SETVAL.
    *data: it_SETVAL type standard table of t_SETVAL.
    *CALL FUNCTION 'K_GROUP_REMOTE_READ'
    EXPORTING
       setclass         = gsetc_costcenter_setclass "from gsetc type-pool
       CO_AREA          = 'UNIV'
      CHRT_ACCTS       =
       groupname        =  p_ksgru
      LANGUAGE         =
    IMPORTING
      RETURN           =
    tables
       et_sethier       = it_SETHIER
       ET_SETVAL        = it_SETVAL.
    Do reward if  helpful

  • How to call subroutines defined in ABAP program with type S

    how to call subroutines defined in ABAP program with type S? can you give an example?

    Normal executable program,
    REPORT  ZTEST_MAIN.
    perform sub1 in program ztest_sub.
    "you can call using in program addition
    Subroutine pool program
    PROGRAM  ZTEST_SUB.
    form sub1.
    endform.

  • How to find out in program which all classes have implemented an interface

    Hello,
    I have created an interface and few classes are implementing the interface.
    I want to know in a program which all class have implemented the interface.
    Is it possible to find it out and how?
    Regards,
    Bikash.

    Hi Bikash,
    Read the Database view VSEOIMPLEM with where condition REFCLSNAME = Interface Name and version = 1.
    This would give you all the classes which have implemented the interface and are active...
    If you want to look at the values that the field version can have then see Type Group SEOC ans search for version....
    Hope this help...
    Regards,
    Sitakant

  • Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION in Report

    Hi All,
    This is the frequent problem we are facing in BW production.
    While executing the BW reports
    We are getting the below error.
    No Space left in Shared memory.
    Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION in Report.
    An exception with the type CX_SY_EXPORT_NO_SHARED_MEMORY occurred, but was neither handled locally, nor declared in a RAISING
    Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION
    System error in program SAPLRRK0 and form INITIALIZE_DATA_ACCESS-01
    The problem solved when we restarted the server.
    but this is coming very frequent.
    Is there any permanent soln for this one.
    Pls advice.
    Thanks!
    Sanjay

    Hi,
    Check the below notes,
    Note 656060 - OLAP: Cache main memory displacement not functioning
    Note 1114164 - Termination in the cache due to insufficient shared memory
    Apply note 1114164  and check if issue resolves or not.
    Regards,
    Niraj

  • Call a local program in Java class on Win

    Hi
    I'm now working on a Java project. It is needed to call a local program in Java class.
    Following is the local program's source code:
    #include <stdio.h>
    main()
        char s[100];
        printf("Please input\n");
        scanf("%s", s);
        printf("Output: %s\n", s);
    } I build this simlpe C program to a exe file named TEST.EXE
    Then, I called the exe in my java class which was like following:
    final Process p = Runtime.getRuntime().exec("test.exe > a.txt");
    writer = new PrintWriter(p.getOutputStream());
    writer.println("12345\n");
    writer.close();
    p.waitFor();But after I ran the Java, it seemed not what I hope to get in a.txt. the string "12345" had not been read by the program, and not been writen to a.txt.
    Following is what appeard in a.txt:
    Please input!
    Output: Is there any error in my Java code?
    thanks!
    Edited by: JingZ on Aug 20, 2008 9:05 AM

    All above is my testing.
    In fact, my project is to encrypt/decrypt by Gnu PG.
    I need to execute a gpg command like following
    gpg -r Luna --encrypt test.txt
    I could execute this command line in CMD normaly:
    C:\WP_ECL~1.4\TESTCE~1>gpg -r 8104EFB8 --encrypt test.txt
    gpg: 997D0744: There is no assurance this key belongs to the named user
    pub  4096g/997D0744 2002-07-31 Baker &Taylor Inc. <[email protected]>
    Primary key fingerprint: BBBC F196 C1D5 CF26 170F  D1FB 870A 3F60 8104 EFB8
          Subkey fingerprint: C161 4C33 F15C 5347 FD09  C2BE 8CC6 2302 997D 0744
    It is NOT certain that the key belongs to the person named
    in the user ID.  If you *really* know what you are doing,
    you may answer the next question with yes.
    Use this key anyway? (y/N) y
    C:\WP_ECL~1.4\TESTCE~1>Please pay attention to the line which I have to type a 'y' to confirm.
    This make me have to invoke this command in Java class like following(in my understanding):
    final Process p = Runtime.getRuntime().exec("cmd /C gpg -r Luna --encrypt test.txt");
    writer = new PrintWriter(p.getOutputStream());
    writer.println("y");
    writer.close();
    p.waitFor();But while the java code was being run, it would be blocked, waiting, waiting and waiting.
    But this method was succeed in my test which invoked test.exe above.
    I cannot understand what difference exists between my test.exe and gpg.
    thanks.

  • Class pools

    how to see the name of the class pool of my global class.
    can i use this class pool in my abap editor program. so that i can make friendship with it.

    HI john
    Yo can define your ABAP Unit test class as a friend of the global class to be tested in the local class definition include of your global class. So, you have to add a line of code like
    CLASS <name of global class to be tested> DEFINITION LOCAL FRIENDS <name of local ABAP Unit class> in the include where the definition of local ABAP Unit Class is in. Then you can call the private methods of your global class in the local abap unit class methods.
    just refer these links
    <b>http://help.sap.com/saphelp_nw2004s/helpdata/en/ec/d9ab291b0b11d295400000e8353423/content.htm</b>
    local class -> global class
    Regards Rk

  • Cannot convert ÿØÿà of type class java.lang.String to class BFileDomain.

    Hi All,
    I am using Jdeveloper 11.1.2.3.0.
    I have a scenario of making an ADF page where I have a IMAGE field to show on the page. So,I have a table called "PRODUCT" with fields called photo with BFILE type. Now when I the data i have inserted using the DML command and i can see the path at the backend.
    However,when i am runnig my ADF page in the Filed called "PHOTO" I can only see a junk character stating 'yoyo'.
    When I click on it, it says ERROR "Cannot convert ÿØÿà of type class java.lang.String to class oracle.jbo.domain.BFileDomain".
    Your help will be appreciated ASAP.
    Regards,
    Shahnawaz

    Hi,
    did you show the id-value in the user interface as a input-component, and did the input-component include a converter?
    If yes, show the id as output-text and remove any existing converter-components.
    Best Regards

  • Cannot convert type class java.lang.String to class oracle.jbo.domain.Clob

    Cannot convert type class java.lang.String to class oracle.jbo.domain.ClobDomain.
    Using ADF Business Components I have a JSFF page fragment with an ADF form based on a table with has a column of type CLOB. The data is retrieved from the database and displayed correctly but when any field is changed and submitted the above error occurs. I have just used the drag and drop technique to create the ADF form with a submit button, am I missing a step?
    I am using the production release of Jdeveloper11G

    Reproduced and filed bug# 7487124
    The workaround is to add a custom converter class to your ViewController project like this
    package oow2008.view;
    import javax.faces.application.FacesMessage;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    import javax.faces.convert.ConverterException;
    import oracle.jbo.domain.ClobDomain;
    import oracle.jbo.domain.DataCreationException;
    public class ClobConverter implements Converter {
         public Object getAsObject(FacesContext facesContext,
                                   UIComponent uIComponent,
                                   String string) {
           try {
             return string != null ? new ClobDomain(string) : null;
           } catch (DataCreationException dce) {
             dce.setAppendCodes(false);
             FacesMessage fm =
               new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                "Invalid Clob Value",
                                dce.getMessage());
             throw new ConverterException(fm);
         public String getAsString(FacesContext facesContext,
                                   UIComponent uIComponent,
                                   Object object) {
           return object != null ?
                  object.toString() :
                  null;
    }then to register the converter in faces-config.xml like this
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
      <application>
        <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
      </application>
      <converter>
        <converter-id>clobConverter</converter-id>
        <converter-class>oow2008.view.ClobConverter</converter-class>
      </converter>
    </faces-config>then reference this converter in the field for the ClobDomain value like this
              <af:inputText value="#{bindings.Description.inputValue}"
                            label="#{bindings.Description.hints.label}"
                            required="#{bindings.Description.hints.mandatory}"
                            columns="40"
                            maximumLength="#{bindings.Description.hints.precision}"
                            shortDesc="#{bindings.Description.hints.tooltip}"
                            wrap="soft" rows="10">
                <f:validator binding="#{bindings.Description.validator}"/>
                <f:converter converterId="clobConverter"/>
              </af:inputText>

  • Object Custom Program Name of class RE and language EN does not exist

    Hi All,
             We are getting this bbelow error while running a custome program ,
    Object <Custom Program Name> of class RE and language EN does not exist
    Do any one has faced this similar issue earlier.
    Regards,
    Sen

    Hi,
    How did you resolve this problem ?
    Re: Object <Custom Program Name> of class RE and language EN does not exist.
    I am also encountering the same issue when I am executing the report.
    Regards,
    SSR.

  • Access of undefined method/property through reference with a static type Class

    I get the following error: (it's not word for word but you get the idea)
    Error: Access of undefined method getStatus through reference with a static type Class.
    Here's what's happening in the code. I'm trying to create a User class that is instantiated at the start of my app. I want the User class to have properties like mainStatus, with helper methods like setStatus etc. Pretty simple.
    so on my HardDisk I have my flash_working folder with all my flash projects. I created my class file/package under the directory com.mypackage
    package com.mypackage
        import flash.display.*;
        public class User extends Sprite
            public var mainStatus:int;
            public function User()
                trace("User Created!");
                mainStatus = 0;
            public function setStatus(status:int):void
             mainStatus = status;
        public function getStatus():int
            return mainStatus;
    Ok, so far so good.
    now I created a new .fla file under the root of /flash_working/. The class file is in /com/mypackage/User.as
    in my .fla file I have:
    import com.mypackage.User;
    var myUser:User = new User();
    var i = User.getStatus();
    trace(i);
    That's all the code I have. Could someone please explain why it's giving me that error?
    If I try to access the public var mainStatus through user.mainStatus that gives a similar error saying:
    Error: Access of undefined property mainStatus through reference with a static type Class.
    Thanks for any help!
    jef3189

    the public getStatus() function that you created needs to be referred to through an instance of the class.
    So:
    import com.mypackage.User;
    var myUser:User = new User();
    var i = myUser.getStatus();
    trace(i);
    Also, an aside. You can create a getter/setter for status, to avoid having to do the function as such.
    package com.mypackage
        import flash.display.*;
        public class User extends Sprite
            public var mainStatus:int;
            public function get status():int
                return mainStatus;
            public function set status(value:int):void
                 mainStatus = value as int;
              public function User()
                trace("User Created!");
                mainStatus = 0;
    And then, you can call it as:
    import com.mypackage.User;
    var myUser:User = new User();
    trace(myUser.status);
    EDIT
    I just noticed that you made the variable public as well, which means you can access it without getter/setter or function.
    import com.mypackage.User;
    var myUser:User = new User();
    trace(myUser.mainStatus);

  • Re: How do you create and use "common" type classes?

    Hi,
    You have 2 potential solutions in your case :
    1- Sub-class TextNullable class of Framework and add your methods in the
    sub-class.
    This is the way Domain class work. Only Nullable classes are sub-classable.
    This is usefull for Data Dictionary.
    The code will be located in any partition that uses or references the supplier
    plan.
    2- Put your add on code on a specific class and instanciate it in your user
    classes (client or server).
    You could also use interface for a better conception if needed. The code will
    also be in any partition that uses or references the supplier plan where your
    add on class is located.
    If you don't want that code to be on each partition, you could use libraries :
    configure as library the utility plan where is your add-on class.
    You can find an example of the second case (using a QuickSort class,
    GenericArray add-on) with the "QuickSort & List" sample on my personal site
    http://perso.club-internet.fr/dnguyen/
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    http://perso.club-internet.fr/dnguyen/
    Robinson, Richard a &eacute;crit:
    I'm relatively new to forte and I'd like to know how can you handle utility
    type classes that you want to use through out your application? Ideally
    what I want is a static class with static methods.
    Let's say that I have a StringUtil class that has a bunch of methods for
    manipulating strings.
    My problem is that we have code that runs on the client and code that runs
    on the server. Both areas could use the StringUtil class, but from what I
    understand, I have to create StringUtil in a plan and then create a server
    object of type StringUtil. The server object will eventually get assigned
    to a partition. That's not good since I really want the server object to
    physically reside at the server end and at the client end. (Actually, I
    don't want a server object, I just want to invoke a static method of a
    static class).
    Any clues on how to solve this problem would be appreciated.
    Also, what is the url at Sage-it that has a summary of all emails that have
    been posted to [email protected]? Perhaps this question has been
    answered previously.
    Thanks in advance
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Richard,
    Your question about "utility classes" brings up a number of issues, all of
    which are important to long-term success with Forte.
    There is no such thing as a static method (method that is associated with a
    class but without an implicit object reference - this/self/me "pointer") in
    TOOL, nor is there such thing as a global method (method not associated
    with a class at all). This is in contrast to C++, which has both, and
    Java, which has static methods, but not global classes. Frequently, Forte
    developers will write code like this:
    result, num : double;
    // get initial value for num....
    tmpDoubleData : DoubleData = new;
    tmpDoubleData.DoubleValue = num;
    result = tmpDoubleData.Sqrt().DoubleValue;
    tmpDoubleData = NIL; // send a hint to the garbage collector
    in places where a C++ programmer would write:
    double result, num;
    // get initial value for num....
    result = Math::Sqrt(num);
    or a Java programmer would write:
    double result, num;
    // get initial value for num....
    result = Math.sqrt(num);
    The result of this is that you end up allocating an extra object now and
    then. In practice, this is not a big deal memory-wise. If you have a
    server that is getting a lot of hits, or if you are doing some intense
    processing, then you could pre-allocate and reuse the data object. Note
    that optimization has its own issues, so you should start by allocating
    only when you need the object.
    If you are looking for a StringUtil class, then you will want to use an
    instance of TextData or TextNullable. If you are looking to add methods,
    you could subclass from TextNullable, and add methods. Note that you will
    still have to instantiate an object and call methods on that object.
    The next issue you raise is where the object resides. As long as you do
    not have an anchored object, you will always have a copy of an object on a
    partition. If you do not pass the object in a call to another partition,
    the object never leaves. If you pass the object to another partition, then
    the other partition will have its own copy of the object. This means that
    the client and the server will have their own copies, which is the effect
    you are looking for.
    Some developers new to Forte will try to get around the lack of global
    methods in TOOL by creating a user-visible service object and then calling
    methods on it. If you have a general utility, like string handling, this
    is a bad idea, since a service object can reside only on a single
    partition.
    Summary:
    * You may find everything you want in TextData.
    * Unless you anchor the object, the instance will reside where you
    intuitively expect it.
    * To patch over the lack of static methods in TOOL, simply allocate an
    instance when required.
    Feel free to email me if you have more questions on this.
    At the bottom of each message that goes through the mailing list server,
    the address for the list archive is printed:
    http://pinehurst.sageit.com/listarchive/.
    Good Luck,
    CSB
    -----Original Message-----
    From: Robinson, Richard
    Sent: Tuesday, March 02, 1999 5:44 PM
    To: '[email protected]'
    Subject: How do you create and use "common" type classes?
    I'm relatively new to forte and I'd like to know how can you handle utility
    type classes that you want to use through out your application? Ideally
    what I want is a static class with static methods.
    Let's say that I have a StringUtil class that has a bunch of methods for
    manipulating strings.
    My problem is that we have code that runs on the client and code that runs
    on the server. Both areas could use the StringUtil class, but from what I
    understand, I have to create StringUtil in a plan and then create a server
    object of type StringUtil. The server object will eventually get assigned
    to a partition. That's not good since I really want the server object to
    physically reside at the server end and at the client end. (Actually, I
    don't want a server object, I just want to invoke a static method of a
    static class).
    Any clues on how to solve this problem would be appreciated.
    Also, what is the url at Sage-it that has a summary of all emails that have
    been posted to [email protected]? Perhaps this question has been
    answered previously.
    Thanks in advance

Maybe you are looking for