Why we should use Statis entities?

If we can access Static entities directly without creating instances, then why we should use None-Static entities? None Static entities are occupying resources too.
Is there any disadvantage of Static entities?

Put it this way... if you have blueprints for a car you wouldn't want to produce only one car, would you? You would want to produce as many as needed. In another example, you don't want to be able to use only 1 window in Windows. Each window has common features but have different values. That's the purpose of non-static entities
However, there are instances that you want to have only one value for something. That's when you use static entities.
Get it? =)

Similar Messages

  • Why we should use Macros if we have function Module

    Why we should use Macros if we have function Module and what is the Advantage of Macros than function Module
    Moderator Message: Interview-type questions are not allowed.
    Edited by: kishan P on Oct 7, 2010 2:22 PM

    Put it this way... if you have blueprints for a car you wouldn't want to produce only one car, would you? You would want to produce as many as needed. In another example, you don't want to be able to use only 1 window in Windows. Each window has common features but have different values. That's the purpose of non-static entities
    However, there are instances that you want to have only one value for something. That's when you use static entities.
    Get it? =)

  • Why I should use an iCloud mailbox?

    Hello there. I discovered that now I can use a @icloud.com mail address simply enabling it from my iCloud preference panel in OS X. I have created an email address, but I have some questions:
    What happens to my @icloud.com address if I don't use a Mac (or iPhone, iPad, etc.) anymore?
    Will my iCloud mail be available forever from icloud website or using IMAP configuration?
    What is the maximum space granted?
    The final question is: why I should use an iCloud mailbox instead (for example) of a Gmail one? All contributes will be greatly appreciated!

    1) Nothing
    2) Yes, as long as Apple keeps the service going
    3) 5Gb for free. More if you pay.
    4) It's up to you. iCloud email supports push notifications on iOS devices. That's about the only difference compared to any other IMAP email account. iCloud also syncs and backs up iOS devices.

  • Any reason why I should use Safari on my PC

    I use Mozilla now. I now have an Iphone. Is there any reason why I should download and use Safari on my PC? I expect the functions will be different from IE or Mozilla or maybe better, but is it a good idea to download and use since I have an Iphone?

    It's pretty irrelevant, unless you really want to sync bookmarks from your computer to your iPhone (you could do that with IE as well, but not Firefox).

  • Why we should use a NTSC or PAL Monitor?

    if we are outputting to video for broadcast on tv, so we use a monitor to monitor the colour.(Only for the colour, or some other purpose?)
    but if i just make it for web, 3G, and DVD? do i still need TV monitor?
    How about HD?
    if i use a HD monitor to edit a project, and for broadcast on HDTV, do i still need a HD monitor or sth, else?
    Thank you guys!

    By viewing the material on the final output display device, you prevent nasty surprises.
    Video is interlaced, computers are progressive.
    Video has a different gamma than computers (and macs are different than PCs).
    NLE programs show you a proxy image, not the full resolution one.
    If you work in HD (and HDV is a low end flavor of HD), you have much more expensive monitoring issues as you can't feed your NTSC/PAL monitor via firewire like you can with DV. You need a 3rd party card like the Kona LH or an external box like the Matrox MXO to convert the computer image to a HDTV image.
    Viewing the work in progress on the appropriate monitor gives you on going quality control and the greatest confidence in your output. Other than that, no reason to use an external monitor.
    x
    Message was edited by: Studio X

  • Why we should use JSP instead of Servlet ?

    I want to know what are the advantages to use JSP over Servlet.

    hi
    Servlets are server exctension ( like CGI ) separate executable
    modules to serve any request efficiently.
    Servlets are pure java classes, u can use them the write an html code to browser.
    u have to compile the servlet before u use it.
    JSP page, is a text-base document , u can type html inside it , and u can use java as scripting language, so it is more easy to use jsp rather than servlet as each jsp page is translated into a servlet by JSP engine.
    Hope this will help
    Good luck
    Mohammed

  • What is web.xml and why it is used?

    hi,
    am new to servlet technology, i tried to find a topic like this in this fourm also in google but didn't get a exact one. can anybody explain me or suggest me some resource about this.
    thanx in advance.
    Max

    hi stevejluke,
    thanx for the correct link.
    nx for the correct link. but what i in doubt with is
    why we should use web.xml? may be my question is very
    silly, may be too basic, forgive me for that...
    Thanx & Regards,
    SaikatAt the most basic level:
    There are several versions of the Servlet specification, You need the web.xml to tell the server which version of the spec your application conforms to so the server knows how to deal with different things.
    If you have a servlet, you also need the web.xml to define what URL signals a request that should be handled by your servlet.
    At this point, you need to sit down and read a book. Do what it says, blindly at first. Just do what it says (but do try to understand the 'what' of it, just don't question the 'why'). After you have a few applications running, go back and ask yourself this question again and try to see what you are using the web.xml for in those applications you have.

  • How do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full

    how do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full.. HELP!

    When Time Machine backs up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of recently deleted files. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as  Backups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself. If you followed bad advice to disable local snapshots by running a shell command, you may have ended up with a lot of data in the Other category. Ask for instructions in that case.
    See this support article for some simple ways to free up storage space.

  • Iphoto on my macbook pro has stopped working. It comes up with a message saying that the library is either being used by another user or it is unreadable. Any ideas why I should be receiving this message?

    MacBook Pro 2009
    Model Identifier: MacBookPro5,1
    Processor  2.4 GHz Intel Core 2 Duo
    Memory  4 GB 1067 MHz DDR3
    Software  OS X 10.8.5 (12F45)
    Iphoto '11
    Iphoto on my macbook pro has stopped working. It comes up with a message saying that the library is either being used by another user or it is unreadable. Any ideas why I should be receiving this message?
    "Your photo library is either in use by another application or has become unreadable"
    Offered solution doesn't work:
    Shut down and restart your computer, and then open iPhoto again. If the problem persists, try rebuilding your photo library. To do this, quit iPhoto, and then reopen it while keeping the Option and Command keys pressed. You can also try restoring your photo library from a backup.
    I have already copied my photographs to the a library manager but when I tried to reuse iphoto and import the photos back into iphoto, it would not let me.
    I can't download photographs from my iphone or my digital camera.
    Any ideas on how I can solve this problem?
    There is a possibility that when I went to update applications that I started to install Mavericks which I then interrupted and cancelled. I am not definite that this caused this problem but it was at about the same time as when this problem started.
    Many thanks,
    Ed

    I have already copied my photographs to the a library manager but when I tried to reuse iphoto and import the photos back into iphoto, it would not let me.
    You can't "copy" your photos to the "library manager", there is just no way to any such thing.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • Where should use Merge Statement in Form

    hi experts
    in Toad I am using this Merge statement , working accordingly.
    I want to use this merge statement in my form where can I use it.
    I created a Procedure in Form Named Proc_merge and call it when validate item of *:bankcode*
    PROCEDURE proc_merge IS
    BEGIN
    declare
    v_com varchar2(5000);
    BEGIN
    V_COM := ' 
    Merge into allvouchers trg
    using
    (select voucher_type,voucher_no,voucher_date,cheque_no,bank_code,narration,debit,credit from(
    select pv_voucher_type Voucher_type, pv_no Voucher_No, pv_date Voucher_date, Cheque_no, Acc_code Bank_code, Narration,Debit,Credit 
    from
                        (select a.pv_voucher_type,a.pv_no, a.pv_date, a.cheque_no, a.pv_gl_credit_code acc_code , b.ca_title,null Debit,
                                    a.pv_gl_credit_amount Credit, a.Pv_narration Narration
                                   from gl_pv a, ca_gl b where a.pv_gl_credit_Code = b.ca_code and a.pv_date > to_date (''30/06/2010'',''dd/mm/yyyy'')  
    union all 
                        select  a.pv_voucher_type,a.pv_voucher_no,a.pv_date,b.cheque_no,a.pv_acc_code,c.ca_title,a.pv_debit, Null credit,a.pv_desc
                        from payment_detail a, gl_pv b, ca_gl c
                        where a.pv_voucher_no = b.pv_no
                        and a.pv_date = b.pv_date
                        and a.pv_voucher_type = b.pv_voucher_type 
                        and pv_acc_code = c.ca_code and a.pv_debit > 0
                        and a.pv_date > to_date (''30/06/2010'',''dd/mm/yyyy'')     
    union all
                            select  a.pv_voucher_type, a.pv_voucher_no,a.pv_date, b.cheque_no, a.pv_acc_code, c.ca_title,
                        null ,a.pv_credit, a.pv_desc
                        from payment_detail a , gl_pv b , ca_gl c
                        where a.pv_voucher_no = b.pv_no
                        and a.pv_date = b.pv_date
                        and a.pv_acc_code = c.ca_code
                        and pv_credit >0 and a.pv_date > to_date (''30/06/2010'',''dd/mm/yyyy'')
    union all
                        select  a.pv_voucher_type, a.pv_no,pv_date,a.cheque_no , a.wht_debt_ac, b.ca_title , null, a.wht_amount, a.wht_narration 
                        from gl_pv a , ca_gl b where  a.wht_debt_ac = b.ca_code and  wht_amount > 0
                        and a.pv_date > to_date (''30/06/2010'',''dd/mm/yyyy'')
                        where acc_code = :bankcode
                        Union all 
    ---------------------   R.Voucher ----------------
    select a.rv_voucher_type, a.rv_no, a.rv_date, a.chequeno, b.rv_acc_code, a.rv_narration,b.rv_debit, b.rv_credit
    from gl_receipt a, receipt_detail b , ca_gl c
              where a.rv_no = b.rv_voucher_no
              and a.rv_date = b.rv_date
              and b.rv_acc_code = c.ca_code
              and b.rv_acc_code = :bankcode
              and a.rv_date > to_date (''30/06/2010'',''dd/mm/yyyy'')
    ----------------------- SRV --------------
    Union all
    select  a.vm_voucher_type ,a.vm_no ,a.vm_date,a.chequeno,b.vd_acc_code, b.vd_desc VNARRAION,
              b.vd_debit VDEBIT,b.vd_credit VCREDIT           
              from vouchermaster a, voucherdetail b , ca_gl c
              where a.vm_no= b.vd_no
              and a.vm_voucher_type = b.vm_voucher_type
              and a.vm_date = b.vm_date
              and b.vd_acc_code = c.ca_code
              and b.vd_acc_code  = :bankcode
              and a.vm_date > to_date (''30/06/2010'',''dd/mm/yyyy'')  
              and (a.show_voucher =''Y'' or Show_Voucher is Null)
              and a.vm_voucher_type =''SRV''
              )) Src
    on (trg.v_type = src.voucher_type and trg.v_no = src.voucher_no and trg.v_date = src.voucher_date)
    when matched then
    update set
    trg.v_chq = src.cheque_no, trg.v_bankcode = src.bank_code ,trg.v_debit=src.debit, trg.v_credit=src.credit, trg.v_narration=src.narration
    when not matched then
    insert (trg.v_type, trg.v_no, trg.v_date, trg.v_chq, trg.v_bankcode, trg.v_debit, trg.v_credit, trg.v_narration)
    values (src.voucher_type, src.voucher_no, src.voucher_date, src.cheque_no, src.bank_code, src.debit, src.credit, src.narration)      
    FORMS_DDL(V_COM);
    end;
    END;no any result.
    please guide me is this right way to do this. or kindly suggest me other ways to using merge statement in form.

    Hello,
    1.) why do you use dynamic SQL here? forms_ddl is a tricky one as it doesn't throw exceptions, so debugging is really fun. And I can't see any justification why this has to be dynamic SQL.
    2.) put the whole thing in a stored procedure and call this procedure. write once, run everywhere.
    cheers

  • Why do we use CRAETE DATA statement ?

    Hi,
    Why do we use CREATE DATA statement ? is it only for optimisation  ?
    thanks.
    Edited by: B on Jan 27, 2009 4:13 PM

    >
    B wrote:
    > Hi, thank you for the answers. The reply by Sonia Baboo was not copy paste from abap help. whereas the one from Niki was.
    >
    >
    >  i have rewarded points. the answers were very helpful
    >
    > thanks
    > B
    It was copy and paste from SAP Help.  http://help.sap.com/saphelp_nw70/helpdata/EN/16/0dce040cf711d3b9360000e8353423/content.htm

  • Which return statement i should use.

    I have a problem regarding the return statement that i should use in the following programe.
    //Printing random letters without vowels
    public class Capitals {
      public char mymethod (){
         int counter = 0;               // Counter for number of capitals generated.
        int numberToGenerate = 20;     // Number of capitals to generate.
        char symbol = 0;               // Variable to store a random character.
        // While there are still letters to generate:
              while( counter < numberToGenerate ) {
          // Generate a random symbol between A and Z:
          // This relies on the fact that the codes for the letters are in a
          // contiguous sequence from 'A' to 'Z'. If we add 1 to 'A' we get the
          // code for 'B', if we add 2 we get 'C', and so on. Thus to create a
          // random capital letter from 'A' to 'Z' we can add a random integer
          // between 0 and 25 to 'A'.
          symbol = (char)(26*Math.random() + 'A');
          switch(symbol) {
            //Vowels ignored:
            case 'A':
            case 'E':
            case 'I':
            case 'O':
            case 'U':
              break;
            default:
              //Consonant displayed:
              System.out.print(symbol + " ");
              counter++;
              break;
    return symbol; // My Problem is here <<<<<<<<<<<<<
    public static void main(String args[])   {
    Capitals myCapitals=new Capitals();
    myCapitals.mymethod();
    }Can anyone kindly guide as to what return statement i should use in mymethod() so that it can be called in the main.
    thanks

    return types are not compulsory. there's a school of though amongst some 'C' programmers, that all functions should return something, even if the returned value is of no interest most of the time. some C compilers even force this behaviour, I think it's part of some standard but I can't remember now
    anyways, methods that have something to return need a return type, those that don't can be void. if you're invoking a method just to get it to do some work, it can probably be void, but if it's doing some computation for you you'll likely want to know the result, hence it must return something

  • Why cannot I use hidden or display only item to store value for insert?

    hi, Gurus:
    I have a question:
    I implemented a form with report region in a page, the update works OK, but the add function has a problem:
    There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)
    Many Thanks in advance.
    Sam

    Hi,
    There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)I think both hidden and display items have attributes that can cause problems because of different ways these items function than non-hidden and non-display-only items function. Display Only items have a "Setting" of "Save Session State" Yes/No? That can be a problem.
    Would you do this? Make these items regular items instead and see if you can get those working. Then, we will try to change the fields back to hidden or display only.
    Howard
    Congratulations. Glad you found the solution.
    Edited by: Howard (... in Training) on Apr 11, 2013 10:26 AM

  • Why on earth use nested tables?

    Hi
    I'm boning up on PL/SQL (again) in anticipation of getting a new job.
    I have many years of experience in various data-related roles, many of which used Oracle.
    On the issue of collections, I find myself asking, in the light of my experience, and not for the first time, why on earth would anyone want to do this:
    create or replace type TEST_TT as table of varchar2(10);
    create table TEST_TABLE ( X number
                             ,Y test_tt)
                             nested table Y store as Y_TABLE;                      I really, really, can't think why we would want to store data like this. It seems to me to be unnecessarily complex, hiding a one-to-many relationship inside TEST_TABLE, which should instead be modelled and implemented as a separate table.
    Furthermore, there are loads of tutorials on collections that tell us how to do the above (indeed I am reading Feuerstein at this very time) but nobody seems to say WHY we should do this.
    Can anybody help me here?
    Thanks.
    Jason

    >
    I'm boning up on PL/SQL (again) in anticipation of getting a new job.
    I have many years of experience in various data-related roles, many of which used Oracle.
    On the issue of collections, I find myself asking, in the light of my experience, and not for the first time, why on earth would anyone want to do this:
    I really, really, can't think why we would want to store data like this. It seems to me to be unnecessarily complex, hiding a one-to-many relationship inside TEST_TABLE, which should instead be modelled and implemented as a separate table.
    Furthermore, there are loads of tutorials on collections that tell us how to do the above (indeed I am reading Feuerstein at this very time) but nobody seems to say WHY we should do this.
    >
    For As you have surmised, just because you CAN do it doesn't mean you SHOULD do it. If you are only working with your standard relational data, such as the example you provide, it has many drawbacks and few, if any advantages.
    It is easier to understand why that capability exists from the viewpoint of the question: why SHOULDN'T you be able to store data like that?
    In one sense it is just another object-oriented feature. You can create object types and pass them around to procedure/functions or external processes (e.g. JDBC) so why shouldn't you be able to store that set of related data as an encapsulated object?
    Why do you need an object type that has a set of columns? You can just as easily put those columns into a table. But how do you manipulate a subset of the columns or rows of a table? How do you pass that data around as a controlled, coherant set of data? You can't.
    With an object type you can, though most often don't, implement encapsulated business rules that ensure that any instance of that type MUST implement. Need ADDRESS information that is required to include a street address, city, state and zip? Create an object type with the right constructor methods and you can ensure that those attributes CANNOT be null.
    Once you have functionality to create and manipulate objects why not be able to pass those objects around and stored them in a table? Doesn't mean you should always store them that way but why not be able to? There isn't any reason to limit that functionality simply because you don't think it is the best practice to use it all the time.
    So if you have a small dataset and want all of that data to 'travel' together nest it. There is no child table to create or foreign key to create.
    I put that functionality in the category of CAN DO but DON'T DO except in rare occasions and consider it a fallout of the move to object-oriented things in general. I like the fact that Oracle makes functionilty like that available when they have it.
    Like dynamic sql, materializeds views, bitmap indexes and much other functionality it is often more important to know when NOT to use it than it is to know when to use it.
    Relative to 'best practices' of why NOT to do that for your basic relational data see this part of the article that Justin referred you to:
    >
    Followup March 3, 2003 - 6am Central time zone:
    1) they are parent child tables in disguise but ones that add:
    a 16 byte raw with a unique constraint on the parent table. Most likely you ALREADY HAVE a primary
    key on the parent table and most likely it is smaller.
    a 16 byte raw that you need to index on the child (not auto-indexed, you need to know to do it).
    This is the foreign key and is hidden from you.
    The inability to put many types of constraints on the nested table..
    They are simple parent/child tables - except you lose the ability to access the child table
    directly.
    2) you are NOT storing anything in a "single row". Physically they are a parent child table pair,
    nothing more, nothing less
    If you have my book "Expert one on one Oracle" - I write about them in there, describe their
    implementation and talk about when I would use them.

  • 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.

Maybe you are looking for

  • Error connecting to the BPEL server from JDeveloper

    My student asks about an error she gets while trying to test a connection defined in JDeveloper to a mid-tier BPEL PM. She gets one error the first time the connection is tested, another at second and subsequent tests. The following error I get only

  • Mac Mini - Server running Lion - Network related issues

    I have a mac mini running Lion.  I am having a few issues that did not exist prior to an upgrade.  But for the life of me, I can't figure it out. The problems I'm having are as follows: 1.  screen sharing times out.  It works, then stops after a whil

  • Problem with SAP logon 720 for printng with Citrix.

    Hi, I have a problem with sap logon 720 when printing for Citrix, one time print and other time don't print.... I try to start SAPLPD for prompt comand... it's start but don't print.... i'm write here for look if other people have this problem... I d

  • Expanded Sound choices? I have a 5.1 system.

    I bought a new iMac to replace a Dell. I would like to use the 5.1 Klipch sound system I used with my Dell (Creative Audigy sound card). The Creative sound card was an expansion card I purchased and put into a slot in my Dell many years ago. What are

  • MRP MD04 - message 15 Postpone the process

    Hello Experts, In md04 it is falling into exception and postponing the planned lead time to  open sales order.... we want delivery date as per planned lead time ...i guess system is considering dependant requirements and pushing date to open sales or