About creating class

I plan to create an addon "Purchase Requisition" under AP, the following are the summary.
1. menu "Purchase Requisition
2. Screen Painter for the PR form
However, I am now sticking in the class creation, I don't know what classes I should create. For example, for the Event handling, is it correct to separate it as a class, or include menu, item events in all class, i.e. menu, form?
Ken

Hi,
a possible way of classes can be
SubMain -> SBO -> Handling
the SBO Class connects to the Business One, Create the Menu Entries, set the Filters
and send the Events to the Handling class.
than you have the Events separated in a own class.
for the different events in Handling class you can use #region to get a better overview
lg David

Similar Messages

  • Creating classes and coding style

    Friends I am little confused in how to go about creating classes.I have ideas but not sure which will be better.
    I have say 3 oracle tables and I am developing three classes for each table.All the classes will be doing is do the SELECT,DELETE,INSERT,UPDATE operation with the oracle tables.Say for example I have two tables.
    DEPT_TABLE
    dept_key
    dept_desc
    tot_emp
    EMPLOYEE_TABLE
    emp_key
    emp_name
    dept_key
    emp_sal
    So I will be developing 2 classes for the 2 table
    public class Dept {
    private int deptKey = -1;
    private int totEmp = -1;
    private String deptDesc = "";
    public void select(){
    //select dept records
    public void insert(){
    //insert dept records
    public void update(){
    //update records
    public void delete(){
    //delete records
    similarly a Employee class will be developed.
    Now my confusion is does it make sense.
    Also is it a nice idea to have dept object as one of field in the employee class instead of the depKey ,because dept key is one of the field in employee table.I mean
    public class Employee {
    private int empKey = -1;
    private int empSal = -1;
    private String empName = "";
    private Dept dept = null;
    public void select(){
    //select emp records
    public void insert(){
    //insert emp records
    public void update(){
    //update emp records
    public void delete(){
    //delete records

    well, I wouldn't bother if you're on a small project, but, if you find yourself needing to do some thing like this a lot, there are programs that can generate a java class where each property corresponds to a column on some DB table, e.g.:
    public class Employee {
      Integer id;
      String name;
    }corresponds to table 'Employee' with int column 'id' and varchar column 'name'. They can be handy because you don't have to do pure SQL any more and nearly all of the JDBC logic is handled by the framework (e.g. I would find an employee with a given ID by creating an instance of the Employee class and invoking setId(4)). But, I wouldn't bother with the over-head involved with setting it up for a small project. However, if you find yourself doing this often, it might be some thing worth considering... take care.

  • I dont understand creating classes they seem a waste of time and efficiency

    I dont understand why we would want to create classes with constructors and get and set statements... I know that VB and Java did not create these just to have us writing extra code so I am missing something in my thinking.
    I read about data hiding and that I understand I guess...but everytime my professors want me to create a class then create an object from that class to access it I dont really get it. I know how to do the basics of it but I can do all of it in my main or the primary class whats the benefit of creating a whole entire class such as the following?
    Everytime I get an assignment and they are like create a class and I try to rack my head for a good idea but the nearest analogy I can come up with is this... creating your own class seems like one of those old straws you drink out of with all the loops, yes you can make it go around in a big loop but why waste time? you want to get to point A to point B so create the most efficient way to get there if possible.
    I am sure the problem is I am not seeing something and there is some logic missing but I just am getting irritated as I am not seeing it and I am finding it, its like I add an extra obstacle course to my code for no other reason than to run through a bunch of extra tasks that I could perform in my main class or main.
    input is welcome to help me arrive at some type of enlightenment thanks
    Class may not be the correct wording for this as I know we have to have a class but what I mean is a non application class. The class I have below goes with another class that actually does a lot of stuff but I am forced to push data through this class that basically does nothing but run water through some different pipes if you will. To me thats a waste when I can do everything in my original class which was called menu that I am messing with and that creates an array for a user who wants to keep a list of his items and prices of those items in inventory.
    public class Item
    private String itemName;
    private double itemPrice;
              public Item()
    public Item (String item, double price)
    setName(item);
    setPrice(price);
    public String getName()
         return itemName;
    public void setName(String item)
         itemName = item;
    public double getPrice()
         return itemPrice;
    public void setPrice(double price)
         itemPrice= price;
    Edited by: Bricatw on Oct 30, 2009 10:33 PM

    What I was plugging into it and please forgive the code as its not finished... (I am still messing with it) its just for learning and I am required to have certain parts in the Item Class and Certain parts in the Menu class..... But you it pushes through the input to the java bean.... in a case like this I just dont see the need for doing it not that I can think of anyway.
    import java.util.Scanner;//my imports for scanner so can read from the screen
    import java.util.*;//imports for my array I used astrix to just import it all as the book said it does not have any negative affects.
    public class Menu //My application class Menu that contains my main
         public static void main(String[] args)//Main method
              final int NUMBER_Of_Elements = 30; //created a symbolic constant so that I only have to change the constant
              //to edit the size of the array if I should want to change it.
              Item[]inventory = new Item[NUMBER_Of_Elements];//I create a new array object with the constant as the number of elements.
              Scanner sc = new Scanner (System.in);//created object from the scanner class used to get input from the console screen.
              System.out.println("Please enter Item on first line and price on second line.");//outputted text to prompt user and give instructions.
              System.out.println("Enter STOP to exit");//instructions on how to exit the program. I would have rather used a different
              //word than stop here. If my choice I would have used "exit" as its more widely used and to promote uniformity.
              int count;//count variable used to count my loops very important as we use it to control our arrays and loops here.
              double price;//our variable that we plug in values from the user via the console.
              String item;//same as previously mentioned for the "price"
                        System.out.println("Wings Coffee Shop Menu");
              System.out.println("");
              System.out.println("Menu Item Price");
              for (count=0; count<inventory.length; ++count)//This is our for loop it uses the length method to control how many times
              //it runs. In this case inventory.length = 30 elements so would run 30 times unless it stopped early.
                   item = sc.nextLine();//reads the input from console into the item variable.
                   if(item.equalsIgnoreCase("STOP"))//if statement that states if = stop (ignores case sensitivity) then it will break out of the loop.
                   break;//the break command which is executed if the if statement is true.
                   price = Double.parseDouble(sc.nextLine());//
                   inventory[count]= new Item(item, price);
                   Item Call = new Item(item, price);
                   System.out.printf("%-13s %.2f\n", Call.getName(), Call.getPrice());
              System.out.println("Wings Coffee Shop Menu");
              System.out.println("");
              System.out.println("Menu Item Price");
    //           for(int x = 0; x < count; ++x)
    //           System.out.printf("%15s\n",inventory[x].toString());
    //                System.out.printf("%-13s %.2f\n", Call.getName(), Call.getPrice());
    //           String[] namesOfItems = {"Coffee", "Milk", "Soda", "Bagel", "Croissant", "Donut"};
    //           double[] prices = {3.99, 2.99, 2.49, 2.99, 2.49, 1.99};
    //           for(int x = 0; x < prices.length; ++x)
    //           System.out.printf("%-13s %.2f\n", namesOfItems[x], prices[x]);
    //           Item arrayPrice = new Item(); HOW COME I CANNOT CREATE THIS OBJECT?
    //           Item call = new Item ();
    //           Item Call = new Item("item", 4.9);
    Edited by: Bricatw on Oct 30, 2009 11:22 PM

  • To ragnic and other about Singleton class

    Hi ragnic. Thanks for your reply. I posted the code wrong. Heres' my correct one.
    I have a GUI first loaded information and the information is stored in a databse, I have some EJB classes..and my singleton class ABC has some method to access to the EJB..
    so my first GUI will gather info using singleton class and later if I click on
    a button in my first GUI class, will pop up another frame of another class , this class also need to class setPassword in my Singleton..
    are my followign codes correctly??
    iS my Class ABC a SINgleton class? thanks
    Is my class ABC use as single correctly. And It is called from other classes is also correct?
    I'm new to java and like to learn about Singleton class.
    But I really dont' understand it clearly after reading many examples of it.
    I have a project to convert my class abc to a singleton.
    But I dont know how to do it.
    In my class(soon will become a singleton) will have few methods that later I need to use it from another class A and class B.
    I have a GUI application that first load my class A..and my class will call
    class abc(singleton) to get some information from it.
    and then in class A has a button, if I click on that button I will call SIngleton class again to update my password, in the singleton class has method calls updatePassword. But I dont know how to call a singleton from other class.
    I have my code for them below:
    1)public class ABC //attempt using a singleton
    private static ABC theABC = null;
    private ABC(){}
    public synchronized static ABC getABC()
    if(theABC == null)
    theABC= new ABC();
    return the ABC;
    public void updateUserInfo(SimpleUser user)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    uc.updateUserInfo(user, userHome);
    } catch(HomeFactoryException hfe) {
    hfe.printStackTrace();
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    re.printStackTrace();
    throw new DelegateException(re);
    } catch(CreateException ce) {
    ce.printStackTrace();
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    fe.printStackTrace();
    throw new UserNotFoundException();
    public SimpleUser getID(String id)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    SimpleUser su = uc.getID(id, userHome);
    return su;
    } catch(HomeFactoryException hfe) {
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    throw new DelegateException(re);
    } catch(CreateException ce) {
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    throw new UserNotFoundException();
    public void setPassword(String lname,String pw)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    uc.setPassword(lname,pw, userHome);//assume that all lname are differents.
    } catch(HomeFactoryException hfe) {
    hfe.printStackTrace();
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    re.printStackTrace();
    throw new DelegateException(re);
    } catch(CreateException ce) {
    ce.printStackTrace();
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    fe.printStackTrace();
    throw new UserNotFoundException();
    }//Do I have my class as a Singleton correctly???
    2)//Here is my First Frame that will call a Singleton to gather user information
    public A(Frame owner)
    super(owner, "User Personal Information",true);
    initScreen();
    loadPersonalInfo();
    * This method instantiates all the GUI widgets and places them into panels and
    * onto the frame.
    private void initScreen()
    txtFname = new JTextField(20);
    txtLname=new JTextField(20);
    btnsave =new JButton("Save");
    btnChange= new JButton("Click here to change PW");//when you click this button there will be a frame pop up for you to enter informaton..this iwll call class B
    JPanel pnlMain=new JPanel();
    JPanel pnlFname= new JPanel();
    pnlFname.setLayout(new BoxLayout(pnlFname, BoxLayout.X_AXIS));
    pnlFname.setBorder(BorderFactory.createEmptyBorder(0,87,0,90));
    pnlFname.add(new JLabel("First Name:"));
    pnlFname.add(Box.createRigidArea(new Dimension(5,0)));
    pnlFname.add(txtFname);
    JPanel pnlLname= new JPanel();
    pnlLname.setLayout(new BoxLayout(pnlLname, BoxLayout.X_AXIS));
    pnlLname.setBorder(BorderFactory.createEmptyBorder(0,87,0,90));
    pnlLname.add(new JLabel("Last Name:"));
    pnlLname.add(Box.createRigidArea(new Dimension(5,0)));
    pnlLname.add(txtLname);
    pnlMain.add(pnlFname);
    pnlMain.add(pnlLname);
    pnlMain.add(btnsave);
    pnlMain.add(btnChange");
    btnSave = new JButton("Save");
    btnSave.setActionCommand("SAVE");
    btnSave.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.setActionCommand("CANCEL");
    btnCancel.addActionListener(this);
    JPanel pnlBottom = new JPanel();
    pnlBottom.setLayout(new BoxLayout(pnlBottom, BoxLayout.X_AXIS));
    pnlBottom.setBorder(BorderFactory.createEmptyBorder(25,55,0,0));
    pnlBottom.add(btnSave);
    pnlBottom.add(Box.createRigidArea(new Dimension(25,0)));
    pnlBottom.add(btnCancel);
    pnlMain.add(pnlBottom);
    this.setContentPane( pnlMain);
    setSize(500,500);
    GraphicUtilities.center(this);
    theABC=ABC.getABC();
    //Do I call my ABC singleton class correctly??
    private void loadPersonalInfo()
    String ID= System.getProperty("user.name");
    SimpleUser user = null;
    try {
    user = ABC.getID(ID);
    //I tried to use method in ABC singleton class. IS this correctly call?
    } catch(UserNotFoundException nfe)
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered.",
    "User Not Found",JOptionPane.WARNING_MESSAGE);
    System.exit(0);
    } catch(DelegateException de) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    currentUser = user;
    txtFname.setText(currentUser.getFirstName());
    txtLname.setText(currentUser.getLastName());
    //This information will be display in my textfields Fname and Lname
    //I can change my first and last name and hit button SAVE to save
    public void actionPerformed(ActionEvent e)
    if(e.getActionCommand().equals("SAVE")) submitChanges();
    if(e.getActionCommand().equals("CHANGE_PASSWORD")) {
    changepassword=new ChangePassword(new Frame(),name,badgeid);
    public void submitChanges(){
    String currentNTUsername = System.getProperty("user.name");
    SimpleUser user =null;
    try {
    user = theABC.getID(ID);
    user.setFirstName(txtFname.getText().trim());
    user.setLastName(txtLname.getText().trim());
    currentUser = user;
    theABC.updateUserInfo(currentUser);
    //IS this correctly if I want to use this method in singleton class ABC??
    } catch(UserNotFoundException nfe)
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",
    "User Not Found",JOptionPane.WARNING_MESSAGE);
    } catch(DelegateException de) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    this.setVisible(false);
    3) click on ChangePassword in my above GUI class A..will call this class B..and in this class B
    I need to access method in a Singleton class- ABC class,,DO i need to inititates it agian, if not what should I do? thanks
    package com.lockheed.vista.userinfo;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import javax.swing.tree.*;
    import java.util.StringTokenizer;
    import java.util.Vector;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.colorchooser.*;
    import javax.swing.filechooser.*;
    import javax.accessibility.*;
    import java.beans.*;
    import java.applet.*;
    import java.net.*;
    import org.apache.log4j.*;
    import com.lockheed.common.gui.GraphicUtilities;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import vista.user.UserServicesDelegate;
    import vista.user.SimpleUser;
    import vista.user.UserNotFoundException;
    import vista.user.*;
    import com.lockheed.common.ejb.*;
    import com.lockheed.common.gui.*;
    import com.lockheed.vista.publish.*;
    * This program allow users to change their Vista Web Center's password
    public class ChangePassword extends JDialog
    implements ActionListener{
    protected final Logger log = Logger.getLogger(getClass().getName());
    private UserServicesDelegate userServicesDelegate;
    private User currentUser = null;
    private JPasswordField txtPasswd, txtVerifyPW;
    private JButton btnSubmit,btnCancel;
    private JLabel lblName,lblBadgeID;
    private String strBadgeID="";
    * This is the constructor. It creates an instance of the ChangePassword
    * and calls the method to create and build the GUI.
    public ChangePassword(Frame owner,String name,String badgeid)
    super(owner, "Change Password",true);
    initScreen(name,badgeid);//build the GUI
    * This method instantiates all the GUI widgets and places them into panels and
    * onto the frame.
    private void initScreen(String strname,String strBadgeid)
    txtPasswd = new JPasswordField(20);
    txtVerifyPW=new JPasswordField(20);
    txtPasswd.setEchoChar('*');
    txtVerifyPW.setEchoChar('*');
    JPanel pnlMain=new JPanel();
    pnlMain.setLayout(new BoxLayout(pnlMain, BoxLayout.Y_AXIS));
    pnlMain.setBorder(BorderFactory.createEmptyBorder(20,0,20,0));
    JPanel pnlPW=new JPanel();
    pnlPW.setLayout(new BoxLayout(pnlPW, BoxLayout.X_AXIS));
    pnlPW.setBorder(BorderFactory.createEmptyBorder(0,96,0,30));
    pnlPW.add(new JLabel("Password:"));
    pnlPW.add(Box.createRigidArea(new Dimension(5,0)));
    pnlPW.add(txtPasswd);
    JPanel pnlVerifyPW=new JPanel();
    pnlVerifyPW.setLayout(new BoxLayout(pnlVerifyPW, BoxLayout.X_AXIS));
    pnlVerifyPW.setBorder(BorderFactory.createEmptyBorder(0,63,0,30));
    pnlVerifyPW.add(new JLabel("Verify Password:"));
    pnlVerifyPW.add(Box.createRigidArea(new Dimension(5,0)));
    pnlVerifyPW.add(txtVerifyPW);
    JPanel pnlTop= new JPanel();
    pnlTop.add(pnlPW);
    pnlTop.add(Box.createRigidArea(new Dimension(0,10)));
    pnlTop.add(pnlVerifyPW);
    pnlMain.add(pnlTop);
    btnSubmit = new JButton("Submit");
    btnSubmit.setActionCommand("SUBMIT");
    btnSubmit.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.setActionCommand("CANCEL");
    btnCancel.addActionListener(this);
    JPanel pnlBottom = new JPanel();
    pnlBottom.setLayout(new BoxLayout(pnlBottom, BoxLayout.X_AXIS));
    pnlBottom.setBorder(BorderFactory.createEmptyBorder(25,55,20,30));
    pnlBottom.add(btnSubmit);
    pnlBottom.add(Box.createRigidArea(new Dimension(25,0)));
    pnlBottom.add(btnCancel);
    pnlMain.add(pnlBottom);
    this.setContentPane( pnlMain);
    setSize(350,230);
    setVisible(true);
    public void actionPerformed(ActionEvent e)
    if(e.getActionCommand().equals("CANCEL")) this.setVisible(false);
    if(e.getActionCommand().equals("SUBMIT")) submitPW();
    * This method is called when the submit button is clicked. It allows user to change
    * their password.
    public void submitPW(){
    myABC= ABC.getABC();//Is this correct?
    char[] pw =txtPasswd.getPassword();
    String strPasswd="";
    for(int i=0;i<pw.length;i++){
    strPasswd=strPasswd+pw;
    char[] vpw =txtVerifyPW.getPassword();
    String strVerifyPW="";
    for(int i=0;i<vpw.length;i++){
    strVerifyPW=strVerifyPW+pw;
    if((strPasswd==null)||(strPasswd.length()==0)) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not enter a password. Please try again.",
    "Invalid Password",JOptionPane.ERROR_MESSAGE);
    if((!strPasswd.equals(strVerifyPW)))
    //password and verify password do not match.
    JOptionPane.showMessageDialog(new JDialog(),"Your passwords do not match. Reenter and try again.",
    "Invalid Password",JOptionPane.ERROR_MESSAGE);
    try
    myABC.setUserPassword(strPasswd);//try to use a method in Singleton class
    txtPasswd.setText("");
    txtVerifyPW.setText("");
    this.setVisible(false);
    } catch(DelegateException e) {
    JOptionPane.showMessageDialog(new Frame(),
    "Error.",
    "Unable to change password information.",JOptionPane.WARNING_MESSAGE);
    } catch(UserNotFoundException e) {
    JOptionPane.showMessageDialog(new Frame(),
    "Error.",
    "Unable to change password information.",JOptionPane.WARNING_MESSAGE);
    And ofcourse I have other EJB classes to work with these classes.
    ***It compiles okey but when I ran, it say "NullPointerException"
    I think I call my Singleton wrong.
    Please help me.thanks

    1. When replying, use <reply>, don't post a new topic.
    2. Implementing a singleton is a frequently asked question. Search before you post.
    3. This is not a question about Swing. A more appropriate forum would be "New To Java Technology" or perhaps "Java Programming", but see point 1.
    4. When posting code, keep it short. It increases the chance of readers looking at it. And in composing your shorter version for the forum, you just may solve your problem.

  • Firefox is refusing to start. It says that my profile is missing, which it appears to be. Yet the way in which one goes about creating a new profile wont' work either. Anybody have a bloody clue what's going on and how to fix it?

    Firefox is refusing to start. It says that my profile is missing, which it appears to be. Yet the way in which one goes about creating a new profile wont' work either. Anybody have a bloody clue what's going on and how to fix it?

    AIR give you classes to detect an on-line or off-line status, it's in 
    this way for the sake of flexibility for instance what happens if you 
    only what to sync  data only on Saturdays at 2 am? If it were done 
    automatically that'll be a problem. And it isn't so complicated.
    You can download the SalesBuilder from AIR examples at www.adobe.com/devnet/air
      it's an application that does everything you have in mind.
    I don't understand your question abou file types.
    An AIR app can communicate with almost every backend served tech 
    CF, .Net, PHP, RoR.
    Sincerely,
    Michael
    El 14/05/2009, a las 8:48, IrishAIRMax <[email protected]> escribió:
    >
    I have to say that I'm loving the picture! well cool!
    >
    Sorry but I don't quiet understand. I thought AIR did the updating 
    automatically? I didn't realise the developer had to program the 
    logic of how the updates take place?  Is it a case in most AIR apps 
    that when online the app updates the server and once every intervel 
    (of however long) the local SQLite DB is synced to the more updated 
    server DB. Then when offline the developer has to sense that the app 
    is offline and store a log manually of the updates without any help 
    from AIR itself, and then update once it comes online again?
    >
    Can AIR link to anything more than a database on the server side 
    apart from webservices, for example .as files or any other file types?
    >
    What type of server is a Flex app stored on, is it a specific Adobe 
    server rather than a Java or .NET server?
    >
    Thank you so much for your last comment!
    IrishAIRMax
    >

  • Question about abstract classes and instances

    I have just read about abstract classes and have learned that they cannot be instantiated.
    I am doing some exercises and have done a class named "Person" and an abstract class named "Animal".
    I want to create a method in "Person" that makes it possible to set more animals to Person objects.
    So I wrote this method in class Person and compiled it and did not get any errors, but will this work later when I run the main-method?
    public void addAnimal(Animal newAnimal)
         animal.add(newAnimal);
    }Is newAnimal not an instance?

    Roxxor wrote:
    Ok, but why is it necessary with constructors in abstract classes if we don�t use them (because what I have understand, constructors are used to create objects)?Constructors don't create objects. The new operator creates objects. An object's c'tor is invoked after the object has already been created. The c'tors job is to initialize the newly-created object to a valid state. Whenever a child object is created, the parent's c'tor is run before the child's c'tor, so that by the time we're inside the child's c'tor, setting up the child's state, we know that the parent (or rather the "parent part" of the object we're initializing) is in a valid state.
    Constructor rules:
    1) Every class has at least one ctor.
    1.1) If you do not define an explicit constructor for your class, the compiler provides a implicit constructor that takes no args and simply calls super().
    1.2) If you do define one or more explicit constructors, regardless of whether they take args, then the compiler no longer provides the implicit no-arg ctor. In this case, you must explicitly define a public MyClass() {...} if you want one.
    1.3) Constructors are not inherited.
    2) The first statement in the body of any ctor is either a call to a superclass ctor super(...) or a call to another ctor of this class this(...) 2.1) If you do not explicitly put a call to super(...) or this(...) as the first statement in a ctor that you define, then the compiler implicitly inserts a call to super's no-arg ctor super() as the first call. The implicitly called ctor is always super's no-arg ctor, regardless of whether the currently running ctor takes args.
    2.2) There is always exactly one call to either super(...) or this(...) in each constructor, and it is always the first call. You can't put in more than one, and if you put one in, the compiler's implicitly provided one is removed.

  • Problems about creating an application client using Netbeans 5.0

    Dear all,
    I have created an "enterprise application" project in Netbeans 5.0 and I want to create an AppClient to access the EJBs in the project. Since Netbeans 5.0 did not contain automatic support for AppClients. I need to do some configurations to make it act like an AppClient. (I am forced to use version 5.0 but not 5.5)
    After searching in google, I found the following article about creating an AppClient in Netbeans:
    http://www.netbeans.org/kb/41/app-clients.html
    I read through the steps in this web page and carefully apply it to my own enterprise application. Everything was fine but when I cleaned and built it, Netbeans told me there's something wrong in the build.xml of my AppClient project:
    init:
    deps-jar:
    init:
    deps-jar:
    compile:
    library-inclusion-in-archive:
    dist:
    compile:
    C:\MyAppClient\build.xml:108: C:\MyAppClient\${file.reference.build-jar} not found.
    BUILD FAILED (total time: 1 second)
    This is the build.xml file of MyAppClient project:
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="MyAppClient" default="default" basedir=".">
        <description>Builds, tests, and runs the project MyAppClient.</description>
        <import file="nbproject/build-impl.xml"/>
       <!--
          Makes sure the IDE can find the Application Server install directory
          and sets the appclient executable name depending on platform
        -->
        <target name="-pre-init">
          <fail unless="com.sun.aas.installRoot">
            J2EE home property - neither j2ee.home nor com.sun.aas.installRoot(NetBeans) is set.
          </fail>
          <property name="j2ee.home" value="${com.sun.aas.installRoot}" />
          <condition property="appclient.name" value="appclient">
            <and>
              <os family="unix"/>
              <os family="Linux"/>
            </and>
          </condition>
          <condition property="appclient.name" value="appclient.bat">
             <and>
               <os family="Windows"/>
             </and>
          </condition>
          <condition property="package-appclient.name" value="package-appclient">
            <and>
              <os family="unix"/>
              <os family="Linux"/>
            </and>
          </condition>
          <condition property="package-appclient.name" value="package-appclient.bat">
            <and>
              <os family="Windows"/>
            </and>
          </condition>
        </target>
        <!--
          Target that copies J2EE app client deployment descriptors to jar
        -->
        <target name="-pre-jar">
          <!-- copy EJB interfaces -->
           <copy  todir="${build.classes.dir}">
             <fileset dir="${file.reference.build-jar}">
               <include name="**/*.class"/>
             </fileset>
           </copy>
           <!-- copy configuration files -->
           <mkdir dir="${build.classes.dir}/META-INF" />
           <copy  todir="${build.classes.dir}/META-INF">
             <fileset dir="${src.dir}/conf">
               <include name="*.xml"/>
             </fileset>
           </copy>
        </target>
        <target name="run" depends="init,compile">
           <exec executable="${j2ee.home}/bin/${appclient.name}">
             <arg line="-client ${dist.jar}"/>
           </exec>
        </target>
        <target name="package-appclient" depends="init">
            <exec executable="${j2ee.home}/bin/${package-appclient.name}" dir="${dist.dir}"/>
        </target>
        </project>It seems like the $file.reference.build-jar couldn't be resolved to a correct path portion string. After referring back to the web page, I still could not understand what is causing this error.
    So I started googling again using the keyword: file.reference.build-jar. I still could not come up with any relevant results.
    Could somebody tell me how this error can be fixed or at least give me some clues what is the possible cause of this error?
    Thanks in advance.

    I have forwarded this to another team member. Stay tuned for the response.

  • A question about Object Class

    I got a question about Object class in AS3 recently.
    I typed some testing codes as following:
    var cls:Class = Object;
    var cst:* = Object.prototype.constructor;
    trace( cls === cst); // true
    so cls & cst are the same thing ( the Object ).
    var obj:Object = new Object();
    var cst2:* = obj.constructor.constructor;
    var cst3:* = obj.constructor.constructor.c.constructor;
    var cst5:* = Object.prototype.constructoronstructor;
    var cst4:* = Object.prototype.constructor.constructor.constructor;
    var cst6:* = cls.constructor;
    trace(cst2 === cst3 && cst3 === cst4 && cst4 === cst5 && cst5 === cst6); //true
    trace( cst == cst2) // false
    I debugged into these codes and found that cst & cst2 had the same content but not the same object,
    so why cst & cst2 don't point to the same object?
    Also, I can create an object by
    " var obj:Object = new cst();"
    but
    " var obj:Object = new cst2();"
    throws an exception said that cst2 is not a constructor.
    Anyone can help? many thanks!

    I used "describeType" and found that "cst2" is actually "Class" class.
    So,
    trace(cst2 === Class); // true
    That's what I want to know, Thank you.

  • Error while creating class

    Error while creating class java/util/LinkedHashMap$EntryIterator
    ORA-29545: badly formed class: User has attempted to load a class (java.util
    .LinkedHashMap$EntryIterator) into a restricted package. Permission can be grant
    ed using dbms_java.grant_permission(<user>, LoadClassInPackage...
    -----Any Suggestion?
    regards,
    Anjan

    Anjan,
    Pardon me for stating the obvious, but did you do what the error message suggested? In other words, did you grant the required permission?
    Good Luck,
    Avi.

  • A question about creating packages as local objects in ABAP

    Hi,
    I have a question about creating packages with SE80. Whenever I create a new package it is assigned a new transport request. After that, I can create new programs inside this package, and each time I can choose whether to assign the new program to a transport request or just save it as a local object (I often do this for test programs that I don't transport and I remove them once my tests have been done).
    What I would like to ask is that, is it possible to create a package (and not just programs inside a given package) as a local object? so that every new object created in this package will be considered as a local object?
    Thanks in advane,
    Kind Regards,
    Dariyoosh

    Thomas Zloch wrote:
    Please also check the F1 help for the package field e.g. in SE80, SAP standard is in range A-S and U-X, namespaces start with "/", so you should be save. I am using the T namespace for temporary stuff since a long time and did not have a problem so far.
    > Thomas
    >
    > P.S. this applies to the package name only, of course
    Thank you very much for this remark, I checked F1 help for the package field and in fact as you mentioned these ranges are for local objects.
    Once again, thank you very much for your help.
    Kind Regards,
    Dariyoosh

  • Problem on the configuration about creating an SPN for your CMS on a Window

    I have some problem on the configuration about creating an SPN for your CMS on a Windows 2003 domain
    My Environment:
    Domain Controller and AD Server :SV01
    Crystal Report Server: SV07
    Domain Name: SVG.NTT.LOCAL
    I created a domain user "BOUSER" in SV01
    When type the following command in the SV01, it have not any response.
    "SETSPN.exe u2013A BOBJCentralMS/SV07.SVG.NTT.LOCAL BOUSER"
    And i cannot find the "Delagation" tab in the domain user property window.
    Have any wrong in the command ?

    Hi Tim,
    Thank you for your reply.
    We used Tomcat and MySQL database.
    I have only integrating with AD and requiring manual logon.
    I had created a bscLogin.conf file and krb5.ini file
    krb5.ini file:
    [libdefaults]
        default_realm = DNS.COM
        dns_lookup_kdc = true
        dns_lookup_realm = true
    [realms]
    DNS.COM = {
        kdc = SV01.SVG.NTT.LOCAL
        default_domain = SVG.NTT.LOCAL
    bscLogin.conf file
    com.businessobjects.security.jgss.initiate {
      com.sun.security.auth.module.Krb5LoginModule required;
    And insert the following two lines in Tomcat's Java Tab
    -Djava.security.auth.login.config=C:\WINDOWS\bscLogin.conf
    -Djava.security.krb5.conf=C:\WINDOWS\krb5.ini
    I also set Serivice Principal Name "bouser FQDN" in Crystal Report Server.
    We can login in Central Management Console with our domain user.
    But When we logon in InfoView with our domain user account.
    It display the following error:
    "Account Information Not Recognized: Active Directory Authentication failed to log you on. Please contact your system administrator to make sure you are a member of a valid mapped group and try again."
    Any step i missed ?

  • How should we be going about creating and saving and/ or exporting our ODC files using Excel 2013 for use in Project Server 2013 Online?

    Hi I need your guidance on how I should go about setting up my Excel 2013 reports so that others in our Project Online 2013 environment can access and updates these reports of mine.
    My questions are as follows:
    I presume I need to create and save my ODC files in a PWA > Data Connections folder.  I have English and French users in our environment.  Do I need save them twice?  Once in the French and again in the English Data Connections folder?
     Likewise for the Excel file? 
    How should I go about creating my ODC files within Excel?  By default, the ODC files are being created on my PC's > My Documents > My Data Sources folder.  I presume I need to get them saved or exported to the PWA > Data Connections
    folder. So, How should I be going about creating and saving and/ or exporting the ODC files???
    FYI...My oData Feeds that I wish to use and join in this particular Excel file are as follows:
    https://cascades.sharepoint.com/sites/pwa/_api/projectdata/AssignmentTimephasedData01T00:00:00'
    https://cascades.sharepoint.com/sites/pwa/_api/projectdata/Projects()?$select=ProjectId,ProjectName,CAS_Classification,CAS_PCO,CAS_IT_Department,CAS_Program,CAS_SubProgram
    https://cascades.sharepoint.com/sites/pwa/_api/projectdata/TimeSet()?select=TimeByDay,TimeDayOfTheWeek$filter=TimeByDay ge datetime'2014-10-19T00:00:00'
    https://cascades.sharepoint.com/sites/pwa/_api/projectdata/Resources()?$select=ResourceId,ResourceName,Programs,Supplier,Source,Role,CostType
    Thanks in advance,
    \Spiro Theopoulos PMP, MCITP. Montreal, QC (Canada)

    Thank you Guilaume.  May I ask you to help clarify a bit more for me?  If I have to do it for both languages (the reports and ODC files), do I simply copy the same ODC files from e.g., the English to French folder in PWA (Odc files)?  Or does
    that defeat the purpose?  Or, do I need to create a new set of oData Feed Connection files with a French version of Excel 2013 and save them to the French Data Connections folder in PWA?  Do I need to have a French version of Excel 2013 to create
    French ODC files and ultimately French based reports and/ or vice versa?
    I did notice that the following oData metadata command from within a browser produces different results (ie., English versus French metadata returned) depending on who runs it (i.e., French or English user, etc).  As you can see I am a bit confused.
     Any help you can provide would be greatly appreciated.
    https://XXXXX.sharepoint.com/sites/pwa/_api/projectdata/$metadata
    \Spiro Theopoulos PMP, MCITP. Montreal, QC (Canada)

  • About creating an AJAX page with DML procedures  using dynamic actions

    About creating an AJAX page with DML procedures in APEX using dynamic actions. Help with limitations.
    I want to share my experience, creating AJAX procedures in APEX 4.0.
    LIMITATIONS
    •     How Can I Hide UPDATE button while I press NEW button. ??
    •     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
    •     How can I avoid multiple Inserts or Updates. ??
    Here are the steps to create an AJAX Updatable Form using the sample table DEPTS. You can see the demo here: [http://apex.oracle.com/pls/apex/f?p=15488:1]
    1)     Create a blank page
    2)     Add a Report Region for departments (It shows the columns deptno, dname and loc).
    3)     Add an HTML Region and create the elements to edit a Department.
    a.     P1_DEPTNO (Hidden to store PK)
    b.     P1_DNAME (Text Field)
    c.     P1_LOC (Text Field)
    4)     You also have to create a hidden element called P1_ACTION. This will help to trigger dynamic actions to perform DMLs.
    5)     Open Page Attributes and in the HTML Header Section include the following code.
    <script>
         function doSelect(pId){
              $x_Value(‘P1_DEPTNO’,pId);
              $x_Value(‘P1_ACTION’,’SELECT’);
    </script>
    6)     Modify the column DEPTNO in the report, to add column link. In the link text you can use #DEPTNO# , in target you must select ‘URL ‘ and in the URL field write javascript:doSelect(#DEPTNO#);
    7)     Create the following Buttons in the Form Region.
    CANCEL     Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CANCEL’);
    NEW          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’NEW’);
    SAVE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’UPDATE’);
    CREATE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CREATE’);
    8)     Create the following Dynamic Action to Select a Department
    Name:     Select Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     SELECT
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    SELECT dname, loc
    INTO :P1_DNAME, :P1_LOC
    FROM dept
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    The first limitation, the value of page elements don’t do refresh so I added the following true actions to the dynamic action AFTER Execute PL/SQL Code.
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     (none) (leave it blank)
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     (none) (leave it blank)
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    9)     Create the following Dynamic Action to Update a Department
    Name:     Update Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     CREATE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    UPDATE dept SET
    dname = :P1_DNAME,
    loc = :P1_LOC
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
    Action:     Set Value
    Unmark ‘Fire on page load’ and ‘Stop execution on error’
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     P1_DNAME
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     P1_LOC
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    Finally to refresh the Departments report, add the following true action at the end
    Action:     Refresh
    Affected Elements: Region Departments
    10)     Create the following Dynamic Action to Create a Department
    Name:     Create Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     CREATE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    INSERT INTO dept(deptno,dname,loc)
    VALUES (:P1_DEPTNO,:P1_DNAME,:P1_LOC);
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Function Body
    PL/SQL Function Body:     
    DECLARE
    v_pk NUMBER;
    BEGIN
    SELECT DEPT_SEQ.nextval INTO v_pk FROM DUAL;; -- or any other existing sequence
    RETURN v_pk;
    END;
    Page Items to submit:     P1_DEPTNO
    Affected Elements: Item P1_DEPTNO
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     P1_DNAME
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark ‘Fire on page load’ and ‘Stop execution on error’
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     P1_LOC
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    Finally to refresh the Departments report, add the following true action at the end
    Action:     Refresh
    Affected Elements: Region Departments
    11)     Create the following Dynamic Action to delete a department
    Name:     Delete Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     DELETE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    DELETE dept
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions AFTER the Execute PL/SQL Code true Action.
    Action:     Refresh
    Affected Elements: Region Departments
    Action:     Clear
    Unmark ‘Fire on page load’
    Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC
    12)     Finally Create the following Dynamic Action for the NEW event
    Name:     New Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     NEW
    Action:     Clear
    Unmark *‘Fire on page load’*
    Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC

    I need some help to solve this issues
    •     How Can I Hide UPDATE button while I press NEW button. ??
    •     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
    •     How can I avoid multiple Inserts or Updates. ??

  • Advices about creating a datasource from an infoset query

    Hi all,
    i have to create a datasource with extraction from an infoset query in R3, i have many questions:
    1- i have heard about the bad performance using a Datasource from an Infoset query, how can i improve this?
    2- The infoset query doesnt exist in R3 Develop, but this exist in R3 Prod, what do i must to do? create a false infosetquery in R3 D, with just the same name of the info set query in R3 Prod? or what else?,
    3- some material to improve this development about create datasources from an infoset query.
    thanks guys!

    Hi,
    You can verywell use infoset query if you are doing following things
    Join using Keyfields to retreive data from tables
    If not using keyfields create index for those table fields  in those fields which will improve in accessing database
    Try to use minimum of tables of small size dont try to join big tables like GLPCA and all.
    Try to load small set of data like a period or month. Dont try for a year or so.
    if your performance is good for aperiod you can go for a year.
    If you are good in function module you can try function module in which you will have the option of specifying no of records to be selected usign package size.
    Hope this helps for you.
    Thanks,
    Arun

  • How to create class interface

    Hi all,
    How shud i create class interface.
    Does this have an impact with the activation of program in sicf txn.
    basically my problem is i did not create a class interface or implement it.
    when i go into sicf txn i cant my program.
    please help me out.
    Regards,
    varun

    Vadnala,
    Go to SE24 to create your class interface and take a look at the tutorials we have spread in the SAP help and SDN. Take a quick look at BSP aplications SBSPEXT_*.
    Regards,
    Alexandre

Maybe you are looking for

  • Itunes will not open after update

    I just upated my itunes account because I was tired of the message popping up saying that I neede to download it.  After the completion of the download I am unable to open my itunes account.  I do not want to ave to pay $20 to call for help since the

  • Throw error: Out of memory exception

    Software: AIX4.3.3 Weblogic6.1 sp1 config: Memory: 1G ,VM setting:256M When application run, console report: <Feb 26, 2004 8:37:05 PM CST> <Error> <HTTP> <[WebAppServletContext(1495972456,c redit,/credit)] Servlet failed with Exception java.lang.OutO

  • SET BORDER BEVEL  at run time

    Has anyone get this built_in working correctly: set_item_instance_property('blk1.item1',i,BORDER_BEVEL,LOWERED); I also tried set_item_instance_property('blk1.item1',i,BORDER_BEVEL,'LOWERED'); I got this error for both: FRM-41384: Invalid parameter u

  • HT201210 WhatsApp hangs after upgrading to new iOS8. Whats the solution?

    Can we restore back to previous operating system? If yes how? Since WhatsApp is not opening, so how would it upgrade to compatible ios8, if it can even open? Uninstalling / Reinstalling WhatsApp, the only solution? What are the chances of that proble

  • Document Resolution Clarification

    Hi guys, I am making a document that will only be displayed digitally. When setting up a new document I chose Web as my intent and set my pixels to 1400x900 ( same as Macbook pro- non retina). When i toggle my document to inches i get 20inx12.5in. No