Concept of util and helper classes

whats the concept behind helper and util classes, how to divide code according to both perspective would any one state clear separation line b/w them.

They're just names, dude

Similar Messages

  • EJB and helper classes ...

    I have created an EJB component which uses
    some helper classes in JDeveloper 3.0 .
    The component deploys sucessfully to OAS 4.0.8.1 . When I try to run the component through an applet ( including the _client.jar
    in the archive tag) , the applet does not find the helper classes . How I do i include the helper classes in the _client.jar file ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    Try to put all the EJB's in a single package and import the package. I
    can think of this solution right now, will keep posting for updates.
    Regards
    Raj
    Daniel Westerdale wrote:
    Hi,
    I have a number of EJBs that each use a common set interfaces,
    exceptions and Value beans. If I deploy using the iasdeploy command
    line, then I must package up all these common classes within each of
    the EJB modules - leading to a lot of duplicate code.
    Is there a smarter a way of packaged the common classes so that I can
    include them in the .EAR file but only in one module.
    Note: I would prefer to only argument the IAS classpath with 3rd party
    classes that rarely change and not these common classes e.g. Jlog
    cheers
    Daniel
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • How to refactor ActionScript code into Utility or Helper Classes ?

    Hello
    My application is growing in size. Many of my components are now 1000+ lines of code, most of which is ActionScript functions.
    What is the best way to refactor this into classes? Are there any tutorials explaining something like this?
    I'd like to do something like "myComponent1Util" and "myComponent2Util" respectively, to handle common functions. I notice I have a lot of functions that could be refactored into smaller functional code.
    Anybody have any tips or advice before I journey down that road? It would be appreciated.
    Thanks!

    There is no general rule of thumb. Most probably your classes are overloaded
    with responsibilities. You can try to read Martin Fowler's refactoring as a
    starting point. Examples are in Java and C# but you'll get the big picture.
    C

  • Replication of utility/helper classes in JAR/WAR.

    Hello folks,
    I have recently learned the class loader hierarchy that is employed in
    the WebLogic server. Previously, I was including the local component
    interfaces of my EJBs in the EJB JAR file as well as the web
    application WAR file. However, since the EJB class loader is the
    superclass of the WAR class loaders, the WAR class loader can see all
    classes in its level as well as the level above it (the EJB class
    loader and system class loader). Therefore, I removed the Local
    component interfaces from the WAR file, and the system works fine.
    However, I have various utility/helper classes that are in the EJB JAR
    file as well as the WAR file. Is it safe to remove them from the WAR
    file? Is there any need to duplicate classes in the JAR/WAR file if
    they are packaged together as an EAR file? Any input is highly
    appreciated.
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669

    No, your helper classes will also be visible to the war class loader.
    You might also consider packaging your helper classes in a separate jar
    file. Then add a manifest class-path entry in your ejb.jar and your
    web.war that references the utility jar file(s). This should work on
    any J2EE server.
    -- Rob
    Ryan LeCompte wrote:
    Hello folks,
    I have recently learned the class loader hierarchy that is employed in
    the WebLogic server. Previously, I was including the local component
    interfaces of my EJBs in the EJB JAR file as well as the web
    application WAR file. However, since the EJB class loader is the
    superclass of the WAR class loaders, the WAR class loader can see all
    classes in its level as well as the level above it (the EJB class
    loader and system class loader). Therefore, I removed the Local
    component interfaces from the WAR file, and the system works fine.
    However, I have various utility/helper classes that are in the EJB JAR
    file as well as the WAR file. Is it safe to remove them from the WAR
    file? Is there any need to duplicate classes in the JAR/WAR file if
    they are packaged together as an EAR file? Any input is highly
    appreciated.
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669

  • Need help with my alarm clock, with Timer task and Timer classes

    k everything is almost complete to get this alarm to work. It goes off and everything. But the thing is that it has a start button and when you click it to start the alarm the text changes to "Stop". This way if the user wants he can turn it off. Yet it works fine, the only problem is when the alarm actually goes off, the button text doesnt change back to "Start". Im not sure how to control private data members in classes from other classes. This is very fustrating, help would be apprieciated. here is the code that i have so far:
    import java.awt.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Timer;
    public class Alarm extends JFrame implements ActionListener
         private AlarmSetup as;
         private DigitalClock dc = new DigitalClock();
         private JComboBox amPmBox = new JComboBox();
         private JTextField hourField = new JTextField(2),
                             minuteField = new JTextField(2);
         private JPanel panel = new JPanel();
         private JLabel colon = new JLabel(":");
         private JButton start = new JButton("Start");
         private JMenuBar jmb = new JMenuBar();
         private JMenu file = new JMenu("File"), timeSetting = new JMenu("Time Setting");
         private JMenuItem startItem = new JMenuItem("Start");
         private JRadioButtonMenuItem standard = new JRadioButtonMenuItem("Standard", true),
                                            military = new JRadioButtonMenuItem("Military");
         private boolean standardToMilitary = false;
         private int hour, minute;
         private int[] arr;
         public Alarm()
              setTitle("Alarm");
              Container c = getContentPane();
              panel.add(hourField);
              panel.add(colon);
              panel.add(minuteField);
              panel.add(amPmBox);
              amPmBox.addItem("AM");
              amPmBox.addItem("PM");
              c.setLayout(new BorderLayout());
              c.add(dc, BorderLayout.NORTH);
              c.add(panel, BorderLayout.CENTER);
              c.add(start, BorderLayout.SOUTH);
              setJMenuBar(jmb);
              jmb.add(file);
              file.add(timeSetting);
              timeSetting.add(standard);
              timeSetting.add(military);
              file.add(startItem);
              ButtonGroup bg = new ButtonGroup();
              bg.add(standard);
              bg.add(military);
              military.addActionListener(this);
              standard.addActionListener(this);
              //the start things need to be implemented still in the action
              //performed
              start.addActionListener(this);
              startItem.addActionListener(this);
         public static void main(String[] args)
              Alarm frame = new Alarm();
              frame.pack();
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e)
              String actionCommand = e.getActionCommand();
              if(e.getSource() instanceof JButton)
                   if(actionCommand.equals("Start")){
                   //long seconds;
                   arr = dc.getTimeMilitary();
                   hour = Integer.parseInt(hourField.getText().trim());
              minute = Integer.parseInt(minuteField.getText().trim());
              String comboSelection = (String)amPmBox.getSelectedItem();
              as = new AlarmSetup(this, arr, hour, minute);
              as.setupAlarm(comboSelection, standardToMilitary);
              start.setText("Stop");}
              else if(actionCommand.equals("Stop")){
                   as.stopTimer();
                   start.setText("Start");}
              else if(e.getSource() instanceof JRadioButtonMenuItem)
                   if(actionCommand.equals("Military"))
                        dc.setTimeFormat(DigitalClock.MILITARY_TIME);
                        standardToMilitary = true;
                        panel.remove(amPmBox);
                   else if(actionCommand.equals("Standard"))
                        dc.setTimeFormat(DigitalClock.STANDARD_TIME);
                        standardToMilitary = false;
                        panel.add(amPmBox);
    import javax.swing.*;
    import java.util.Timer;
    import java.util.*;
    public class AlarmSetup
         private Timer alarmTimer = new Timer(true);
         private long seconds;
         private int[] timeArray;
         private int textHour, textMinute;
         public AlarmSetup()
         public AlarmSetup( int[] aarr, int ahour, int aminute)
              timeArray = aarr;
              textHour = ahour;
              textMinute = aminute;
         public void setTimeArray(int[] array)
              timeArray = array;
         public void setHour(int xhour)
              textHour = xhour;
         public void setMinute(int xminute)
              textMinute = xminute;
         public void stopTimer()
              alarmTimer.cancel();
         public void setupAlarm(String combo, boolean tester)
              if(!tester)
                   if(combo.equals("AM"))
                        seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                   else
                        seconds = (textHour + 12 - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
              else if(tester)
                   seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                   try
                        alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                   catch(IllegalArgumentException iae)
                        seconds = (24*3600) + seconds;
                        alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
    import java.util.*;
    public class AlarmTask extends TimerTask
         public void run()
              System.out.println("Billy the goat");
              //dont know what to put to change the Alarm button text

    well im trying to get this down. So i made a private class inside the alarmsetup class. But now when i try to use the schedule method on the timer object it says that it doesnt know it? whats the deal? here is my code for that class
    import javax.swing.*;
    import java.util.Timer;
    import java.util.*;
    public class AlarmSetup
         private Alarm alarm;
         private Timer alarmTimer = new Timer();
         private long seconds;
         private int[] timeArray;
         private int textHour, textMinute;
         private class AlarmTask
              public void run()
                   alarm.changeButtonText();
                   System.out.println("Billy the Goat");
         public AlarmSetup(Alarm a)
              alarm = a;
         public AlarmSetup(Alarm al, int[] aarr, int ahour, int aminute)
              alarm = al;
              timeArray = aarr;
              textHour = ahour;
              textMinute = aminute;
         public void setTimeArray(int[] array)
              timeArray = array;
         public void setHour(int xhour)
              textHour = xhour;
         public void setMinute(int xminute)
              textMinute = xminute;
         public void stopTimer()
              alarmTimer.cancel();
         public void setupAlarm(String combo, boolean tester)
              if(!tester)
                   if(combo.equals("AM"))
                        seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                   else
                        seconds = (textHour + 12 - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
              else if(tester)
                   seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                   try
                        alarmTimer.schedule(new AlarmTask(), seconds*1000);
                   catch(IllegalArgumentException iae)
                        seconds = (24*3600) + seconds;
                        alarmTimer.schedule(new AlarmTask(), seconds*1000);

  • Help needed. I have a 3TB external hard drive partitioned into 1TB's. I used one partition as backup for the main computer hard drive. But now it is greyed out as shown in the disk utility and its name changed, i dont know how that happened, i tried verif

    Help needed. I have a 3TB external hard drive partitioned into 1TB's. I used one partition as backup for the main computer hard drive. But now it is greyed out as shown in the disk utility and its name changed, i dont know how that happened, i tried verifying and repairing it but had no luck. I also tried mounting and unmounting it but still no solution. Anyone to help please?

    Looks bad. I would strongly advise backing up the stuff on the other two partitions as soon as possible in case the rest of the drive goes wrong.
    Beyond that, Disk Utility has limited abilities to repair disks, DiskWarrior uses a different approach and might, emphasis might be more successful. It has certainly done the job for me in the past when Disk Utility could not.
    See http://www.alsoft.com/diskwarrior/

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

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

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

  • My 3 year-old macbook pro is very slow. I have run disk utility and virus scan with no improvement. The "beach ball" will spin for minutes at a time when opening, closing or changing windows. Apple Store looked at it a few months ago with no help.

    my 3 year-old macbook pro is very slow. I have run disk utility and virus scan with no improvement. The "beach ball" will spin for minutes at a time when opening, closing or changing windows. Apple Store looked at it a few months ago with no help. What can I do?

    Under CPU: 3.5% user; 5% system; 91% idle; 441 threads; 90 processes.
    Under System: out of 2GB - 54.7MB free; 530MB wired; 603MB active; 862MB inactive; 1.95GB used.
    Is too much of the system memory tied up? If so, what can I do to free some up?

  • I need help on my MacBook Pro. Recently I've deleted another partition of my disk from the disk utility and I found out that my disk capacity wasn't get into the normal one which is 750GB. Meanwhile I installed window 7 into the partition disk.

    I need help on restoring my disk capacity back to normal. I installed window 7 into the partition disk through bootcamp and I deleted it from disk utility. After I erase the partition disk,I get my capacity to 499GB but not 750GB. Do I need to reinstall my MacBook or something to do with the restoring?

    Welcome to the Apple Support Communities
    Rodney Lai wrote:
    I installed window 7 into the partition disk through bootcamp and I deleted it from disk utility
    You shouldn't do it. You have to erase the Windows volume with Boot Camp Assistant, so it will restore the space onto the OS X volume and that volume will have 750 GB.
    As you did it with Disk Utility, you have to resize your OS X partition manually:
    1. Open Disk Utility, select your hard disk at the top of the sidebar, and go to Partition tab.
    2. You will see a bar with Macintosh HD. You have to click it at the bottom right corner and drag it to the end of the bar, so Macintosh HD will use all the space of the hard drive, and press Apply.
    3. Close Disk Utility and your OS X partition will have 750 GB

  • Class/member variables usage in servlets and/or helper classes

    I just started on a new dev team and I saw in some of their code where the HttpSession is stored as a class/member variable of a servlet helper class, and I was not sure if this was ok to do or not? Will there be problems when multiple users are accessing the same code?
    To give some more detail, we are using WebLogic and using their Controller (.jpf) files as our servlet/action. Several helper files were created for the Controller file. In the Controller, the helper file (MyHelper.java) is instantiated, and then has a method invoked on it. One of the parameters to the method of the helper class is the HttpServletRequest object. In the method of the helper file, the very first line gets the session from the request object and assigns it to a class variable. Is this ok? If so, would it be better to pass in the instance of the HttpServletRequest object as a parameter to the constructor, which would set the class variable, or does it even matter? The class variable holding the session is used in several other methods, which are all invoked from the method that was invoked from the Controller.
    In the Controller file:
    MyHelper help = new MyHelper();
    help.doIt(request);MyHelper.java
    public class MyHelper {
        private HttpSession session;
        public void doIt(HttpServletRequest request) {
            session = request.getSession();
            String temp = test();
        private String test() {
            String s = session.getAttribute("test");
            return s; 
    }In the past when I have coded servlets, I just passed the request and/or session around to the other methods or classes that may have needed it. However, maybe I did not need to do that. I want to know if what is being done above will have any issues with the data getting "crossed" between users or anything of that sort.
    If anyone has any thoughts/comments/ideas about this I would greatly appreciate it.

    No thoughts from anyone?

  • I used the "erase free space " option in disk utility and now my imac says the disk is full and wont let me download songs. please help!

    i used the "erase free space " option in disk utility and now my imac says the disk is full and wont let me download songs. please help!

    You could try repairing permissions with disk utility, I don't think you will have the option to repair the drive but you could verify it.
    This may help you delete the files that DU made but did not remove when erasing the free space.
    http://macosx.com/forums/mac-os-x-system-mac-software/317204-no-disk-space-after -failed-disk-utility-erase-free-space.html
    When you get your SL disk it will not have the iLife applications, that would have been on the second install disk that should have been with the computer. I forget which version of iLife you will need for SL but I think it is this http://www.amazon.co.uk/Apple-iLife-Single-User-Mac/dp/B003XKRZES/ref=sr_1_1?ie= UTF8&qid=1409607702&sr=8-1&keywords=apple+ilife+11
    A search of the forums will confirm or deny this.
    As to whether a clean install will cure your problem, i.e. partition the HDD and install I would expect it to be yes, but there are no guarantees it is an old machine.

  • HT4839 PLEASE HELP!!!  I am simply trying to update the APN settings on my Iphone3 AT&T carried Straight Talk SIM phone.  For some reason, when I enter the Straight Talk APN info in the Config Utility and click "Install", NOTHING HAPPENS.  WHY?

    PLEASE HELP!!!  I am simply trying to update the APN settings on my Iphone3 AT&T carried Straight Talk SIM phone.  For some reason, when I enter the Straight Talk APN info in the Config Utility and click "Install", NOTHING HAPPENS.  WHY?  I have spent almost 2 full days simply trying to get the cellular data network settings to appear and I am now at the point of pulling hair and/or smashing things.  Why is it so difficult to simply update the cellular data network APN settings on a standard Iphone 3 ATT with a unlimited Straight Talk plan?  Everyone knows that Straight Talk's $45 a month unlimited data/calling plan is supposed to be 100% compatible with AT&T carried Iphones.  Will someone please tell me HOW TO UPDATE THE APN SETTINGS ON THIS IPHONE 3.  Thanks and God bless
    <Personal Information Edited by Host>

    StraightTalk is not a supported carrier.
    Contact them for support.
    FYI, unless the device is officially unlocked from AT&T, you will not be able to use it on another carrier.

  • Disk Utility and Disk Warrior error on internal hard drive....PLEASE HELP!!

    After running idefrag on my internal Western Digital 120gig hard drive. The drive did not appear after I rebooted my mac. I opened Disk Utility and the drive is there but grayed out. I used "repair disk" under First Aid and it gave me this error:
    Verify and Repair disk “HD 120”
    Checking HFS Plus volume.
    Invalid B-tree node size
    Volume check failed.
    Error: The underlying task reported failure on exit
    1 HFS volume checked
    1 volume could not be repaired because of an error
    Then I tried using Disk Warrior 3.0 to rebuild and it gave me this error:
    error ""WD 120 GB" cannot be rebuilt. The original directory is too severely damaged. The disk was not modified (2155, 2179)".
    I'm not sure if this is the right area to post this, but I need help as most of my important data is on this hard drive. What else can I do?
    I am on a g4 quicksilver with 10.4.3 installed.

    Sorry to hear about your problem but unless you are working with very large files such as with video editing, etc., using a defrag utility is not required with OS X and no defrag utility should be used on a hard drive without a backup first.
    The current Disk Warrior version for Tiger is 3.0.3 and if Disk Warrior cannot repair the drive/directory, it must be in bad shape which was caused by using idefrag.
    You can try using a data recovery utility such as Data Rescue (Prosoft Engineering) which includes a free trial version.

  • HT4061 My Ipad was part of my tuition. My school "IIN" loaded all my audio and video classes on it. I diseabled it by entering the wrong passcode it says connect to Itune. How do I make sure I do not lose my classe recording by doing so? please help. Than

    Hello, I am and IIN Intitute of Integrative Nutrition in New York student. My iPAD 2 is part of my school material and was uploaded with all Videos and Audio classes for the whole program. I recently typed in my passwork incorrectly and disabled my iPad it is giving me the message " connect to i-tunes". I am afraid to loose my lectures. Could anyone help me with some information please? Thank you very much. Wouga22

    If you do not have a backup you are going to lose everything on your iPad and even if you do have one, you may still be out of luck.
    You have to restore the device within iTunes. You want to use the same computer that you always sync with so that you can restore your app data and settings. You can restore with any other computer, but you will lose everything on the iPad.
    Read this very carefully before you proceed. Sometimes iTunes will allow you to restore the iPad without having to use recovery mode, but if you need to use recovery mode and don't have a backup, that is where you may have a problem.
    http://support.apple.com/kb/ht1212
    If you need recovery mode ....
    Recovery Mode Instructions
    Disconnect the USB cable from the iPad, but leave the other end of the cable connected to your computer's USB port.
    Turn off iPad: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for iPad to turn off.
    If you cannot turn off iPad using the slider, press and hold the Sleep/Wake and Home buttons at the same time. When the iPad turns off, release the Sleep/Wake and Home buttons.
    While pressing and holding the Home button, reconnect the USB cable to iPad. When you reconnect the USB cable, iPad should power on.
    Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears you can release the Home button.
    If necessary, open iTunes. You should see the recovery mode alert that iTunes has detected an iPad in recovery mode.
    Use iTunes to restore iPad.

  • Computer has started locking up 3-4 times a day when doing normal browsing functions. I've runb disk utility and done soft boots but it does't help.s

    Computer has started locking up on a regular basis (several times a day) when doing normal internet browsing. I've gone through disk utility and safe start sequences but I see no improvement.

    I've had this unit for a few years (can't remember how many)
    iMAC 4,1
    2 GHz Intel Core Duo
    1 GB  667 MHz DDR2 SDRAM
    When I go to the activity center, I see the RAM used as follows:
    Free  23 MB
    Wired 120 MB
    Active 597 MB
    Inactive 283 MB

Maybe you are looking for

  • External HD won't free-up space after deleting files

    Hello. My old Maxtor 500 Gb external hard-drive won't free-up any space after deleting many, many files. I'm using a late 2009 iMac i5 desktop with Snow Leopard. I had 6 Time Machine backups of my old MacBook Pro on the drive - each taking up roughly

  • Itunes/laptop wont recognise Iphone

    My itunes/laptop wont recognise my Iphone 4s since Itunes update. It would let me charge and makes a funny noise when I try to connect. I've deleted Itunes and restarted again, rebooted my phone, reset it, and checked my firewall and still nothing..

  • Columns used in packages

    Hi. Can I get the column names also that I use in packages from some metadata table?

  • Regarding customer conditions and customer access fields

    Hi there! I've created customer conditions that may apply to a particular material when creating a purchase order in conditions folder but it has as sequence fields two new fields that I've added to KOMG via one of its includes.  So, when it's time t

  • Lower jpeg compression on masters

    This might seem like an odd question but how can I resave masters with lower jpeg compression or even lower resolution to save disk space? Please dont make this a thread lecturing the downsides of actually doing this I know what Im asking of