Why do we use ejbCreate() method? what does it returns?

why do we use ejbCreate() method? what does it returns?

People think its easier to get answers handed tothem
instead of looking...I do my best to disabuse them of that notion.I've given up on that idea, too much hard work.
Instead I've just written off the entire current generation of schoolkids as useless, good only for (at most) menial labour.

Similar Messages

  • Why not to use static methods - with example

    Hi Everyone,
    I'd like to continue the below thread about "why not to use static methods"
    Why not to use static methods
    with a concrete example.
    In my small application I need to be able to send keystrokes. (java.awt.Robot class is used for this)
    I created the following class for these "operations" with static methods:
    public class KeyboardInput {
         private static Robot r;
         static {
              try {
                   r = new Robot();
              } catch (AWTException e) {
                   throw new RuntimeException(e + "Robot couldn't be initialized.");
         public static void wait(int millis){
              r.delay(millis);
         public static void copy() {
              r.keyPress(KeyEvent.VK_CONTROL);
              r.keyPress(KeyEvent.VK_C);
              r.keyRelease(KeyEvent.VK_C);
              r.keyRelease(KeyEvent.VK_CONTROL);
         public static void altTab() {
              r.keyPress(KeyEvent.VK_ALT);
              r.keyPress(KeyEvent.VK_TAB);
              r.keyRelease(KeyEvent.VK_TAB);
              r.keyRelease(KeyEvent.VK_ALT);
                   // more methods like  paste(), tab(), shiftTab(), rightArrow()
    }Do you thinks it is a good solution? How could it be improved? I've seen something about Singleton vs. static methods somewhere. Would it be better to use Singleton?
    Thanks for any comments in advance,
    lemonboston

    maheshguruswamy wrote:
    lemonboston wrote:
    maheshguruswamy wrote:
    I think a singleton might be a better approach for you. Just kill the public constructor and provide a getInstance method to provide lazy initialization.Thanks maheshguruswamy for advising on the steps to create a singleton from this class.
    Could you maybe advise also about why do you say that it would be better to use singleton? What's behind it? Thanks!In short, it seems to me that a single instance of your class will be able to coordinate actions across your entire application. So a singleton should be enough.But that doesn't answer why he should prefer a singleton instead over a bunch of static methods. Functionally the two are almost identical. In both cases there's only one "thing" on which to call methods--either a single instance of the class, or the class itself.
    To answer the question, the main reason to use a Singleton over a classful of static methods is the same reason the drives a lot of non-static vs. static decisions: Polymorphism.
    If you use a Singleton (and and interface), you can do something like this:
    KeyboardInput kbi = get_some_instance_of_some_class_that_implements_KeyboardInput_somehow_maybe_from_a_factory();And then whatever is calling KBI's public methods only has to know that it has an implementor of that interface, without caring which concrete class it is, and you can substitute whatever implementation is appropriate in a given context. If you don't need to do that, then the static method approach is probably sufficient.
    There are other reasons that may suggest a Singleton--serialization, persistence, use as a JavaBean pop to mind--but they're less common and less compelling in my experience.
    And finally, if this thing maintains any state between method calls, although you can handle that with static member variables, it's more in keeping with the OO paradigm to make them non-static fields of an instance of that class.

  • When I see the usage on my iPod touch 4 they have categories for how much space is being used where. What does the "other" category contain? Like what could I delete on my iPod to get rid of the "other" category?

    when I see the usage on my iPod touch 4 they have categories for how much space is being used where. What does the "other" category contain? Like what could I delete on my iPod to get rid of the "other" category?

    What is the Other on my iPhone and How to Remove It
    An "other" larger than about 1 1/2 GB usually indicates that the "other" includes corrupted files.
    First try:
    "First you go settings/general/usage/music/then left swipe over music and press delete and you would think it deletes your music but it doesn't instead it deletes your other but make sure your ipod is connected to a computer while doing this"
    as recommended by:
    How do I get rid of "other" storage: Apple Support Communities
    Next, usually restoring from backup eliminated the corrupted files. However, sometimes restoring to factory settings/new iPod is required.
    To restore from backup see:
    iOS: How to back up
    To restore to factory settings/new iPod see:
    iTunes: Restoring iOS software

  • Function module: why do we use FM and what is the purpose of using FM

    hi,
       Can any please explain. Why do we use FM?
                                           What is the purpose of using FM ?
                                           Where we are using FM and for what tables in R/3 ?
    I could be thankful to you if any one answer above questions.
    Arun

    Hi,
      We go for creating FM when there is a chance of using the same code in different reports in R/3.
    Suppose I have a requirement say, to display the Payer Name for every sale order.
    This is most common requirement in any project.
    You can create a FM say READ_CUSTOMER_NAME in SE37.
    Write a select statement from the table VBAP to fetch the Payer Name based on the Sales Order.
    Now you can activate the FM and it is ready to be used across all the reports in R/3.
    Need : To avoid redundant coding and to modularize the code.
    If you want to see the list of Standard FMs, got SE37 --> press F4 and you'll get all the SAP standard FMs.
    For customized FMs (User defined), type Z* or Y* and press F4.
    Hope this helps a bit !!!
    Regards,
    Balaji V

  • Why do we use init() method instead of constructor to initialize a servlet?

    Why do we use init() method instead of constructor to initialize a servlet?

    I suspect the reasons are partly historical. A servlet is loaded dynamically, by class name and, once you've loaded the Class, it's easier to to a newInstance, using the default construtor than it is to search for a particular matching constructor and invoke it.

  • What does the return code 20 stands for in the Transport request log

    Hi,
    When we have retreived the Transport request log by using the Unix command, we have got return code 20.
    Please let us know what does the return code 20 stands for and under what scenerios I will get the return code 20.
    Thanks & Regards,
    Madhuri.

    chk the last return code in this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/57/38e26c4eb711d182bf0000e829fbfe/content.htm

  • What does the return activity do in BTF executed within a region?

    All of us know that the return activity in the bounded task flow used to return from a called bounded task flow to the caller (i.e. to exit the task flow), this concept is clear when the bounded task is called from task flow call activity. But can we use the return activity in a bounded task flow that is intended to be executed in a region, but the question is how to use it, and what does it exactly mean to have a return activity in a bounded task flow that is executed within a region? Is there any use case for this scenario?

    Hi,
    regions don't handle task flow returns and the taskflow would just exit leaving the region area blank, One option to use returnvactivuties in egions is to configure a region navigation listener and - if the current view id value returns null - to refresh the region so the task flow starts all over again. To pass values back in such a use case you would use a managed bean instance you pass as an argument to the taskflow in a region.
    Frank

  • What does 'Actuality' return when checked in the Text Element of WAD.

    Hi All,
    What does 'Actuality' return when checked in the Text Element of WAD?
    Thanks In Advance

    I take back my qs as the qs is not valid anymore

  • How do I find out how to use cloud and what does it exactly do?

    I Am new to Apple and just not sure how this iCloud works and what does it do.

    Read here:
    http://www.apple.com/icloud/
    Basically it is a storage area on apple's servers that lets you keep a backup of your device to restore from in case you need to.
    It also has additional features for your media content and other services.

  • What does the return code mean in Socket Exception?

    I got SocketException from my program and the whole content of the exception.toString() is:
    java.net.SocketException: socket write error (code =10004).
    Can anybody tell me what does "code=10004" mean?
    Thanks.
    Rachel

    Try to use
    exception.PrintStackTrace()instead of
    exception.toString()It should me more helpful..
    bye
    Michele

  • Why is renaming apps bad? What does it do?

    Hi all. I've been searching the web and forums all over, but i haven't found a satisfactory answer to this question yet. The best i've found is that the app may not function properly if renamed. Mainly I'm trying to find out if it's ok to rename apps and their folders from say "quicktime player" to "quicktime player 7.6.4" without any detrimental effects. I would like to do this with all my apps ideally - firefox, safari, itunes, divx, etc. It makes it much faster and easier to see what version i'm running.
    does anyone know if this is ok to do. What problem, if any, might it cause and why?
    thanks in advance

    Hi all. I've been searching the web and forums all over, but i haven't found a satisfactory answer to this question yet. The best i've found is that the app may not function properly if renamed. Mainly I'm trying to find out if it's ok to rename apps and their folders from say "quicktime player" to "quicktime player 7.6.4" without any detrimental effects. I would like to do this with all my apps ideally - firefox, safari, itunes, divx, etc. It makes it much faster and easier to see what version i'm running.
    does anyone know if this is ok to do. What problem, if any, might it cause and why?
    Some apps are launched by other apps. For example Quicktime Player is often started by other apps when you ask the other app to play a video clip. Preview is another such app for pictures. Disk Utility when an uninitialized disk is attached to the Mac. Network Utility if there is a network connection problem. Software Update can be invoked via the Apple menu. Terminal when double clicking on a .command file. That is just scratching the surface.
    And of course all those Open With settings may stop finding the apps associated with file type.
    As mentioned software updates may not find the original app if it has been renamed, its parent directory renamed, or the app has been moved. In one case, the app may not be updated at all, and in another case the new version will be installed in the old location, but you will continue using the old version, then one day you read about a new feature in the app, only the old version does not have the feature, you come back to these forums and complain, contributes to the forum try to help, but you never mention you have renamed/moved things, you get frustrated with the people trying to help you, you accuse them of being Fanboys, you dump Mac OS X and install Windows. All because you renamed/moved installed applications
    My general rule is, if the application has an installer, I leave the application where it was installed and do not rename nor move the app. If the application was downloaded via a .dmg file and the installation is just drag and drop from the .dmg, then I store those apps my own /Local/Applications or /Local/Utilities.
    If I want to access an app from anywhere else (or use a different name), I create an alias, change the alias name to whatever I want, and put the alias anywhere I want (or use multiple aliases).

  • Why do i need bonjour and what does it acctually do

    This may sound like a stupid question but why do I need bonjour. It seems to sit there eating up processing power and not doing much. If I want to update I will get a message from my mate saying there is an update for ... you may want to update.
    This leads me onto what bonjour actually does (apart from eat my process power and spare ram) and do I need it to be running at any time?

    Click here for information.
    (44385)

  • Why not to use static methods in interfaces?

    why?

    Because static methods are always attached to a particular class -- not an object. So object polymorphism (which is what interfaces are good for) won't help. Now, what you can do is say that subclasses must implement a method that looks an awful lot like a static method, in that it doesn't depend on object state.
    This bugged me, and it still bugs me a little bit in that I have to instantiate an object of a type in order to call these pseudo-static methods. When the pseudo-static methods tell the user how to initialize the object, you get a bit of a chicken-and-egg problem.

  • HT4623 I want to use a program that needs Adobe Flash and I'M then told this device, iPad, can't use Adobe.  What does it use instead?

    I want to use a program that needs Adobe Flash and I'm then told Adobe Flash cannot be used with my iPad.
    What do,I use instead go Adobe Flash?

    Adobe has not made a version of Flash for the iPad.
    Kappy explains why. https://discussions.apple.com/message/19446567#19446567
    5 Flash Player Alternatives http://www.techshout.com/features/2011/01/flash-player-for-ipad-apps/
    Top 4 browsers supports flash player on iPad and iPhone
    http://mashtips.com/flash-player-ios/
     Cheers, Tom

  • HT201303 Why when I use my iPad apple does not link to my iPhone account

    Why account does not link to both apple devices

    Take a look at this link, http://support.apple.com/kb/TS1591

Maybe you are looking for