Does making more classes or incapsulation effect perfoemance?

I have a Frame with a TabbedPane on it. There are 8 tabs. Each tab contains a JTable with lots of fields & 4 buttons.
When I design all this stuff in JBuilder all panels are put into one class (...Frame class). I want to put every tab's JPanel into a separate class (... JPanel class). But some say that it might decrease otherall performance. It's sounds like a nonsense to me. But I'm not experienced programmer. And I'd like to make it clear for myself.
One more thing. If I'm setting all class fields private & then write get/set, is the field access slower in this case than if I'm making all fields public?
Can anyone help me? Does anyone know what does really decrease perfomance & what does not?

...but some say that it might decrease otherall performance
Having more classes does increase the time it takes a program to run because of the additional class loading activity. Deciding whether to create another class is one of the toughest things in o-o design, and it rests on whether the extra load time is worth it for readability and reusability. The overall impact is not that large if you are talking about five or ten classes.
If I'm setting all class fields private & then write get/set, is the field access slower in this case than if I'm making all fields public?
Yes it is, but it is pretty negligible, especially if you are just returning a value. The real advantage of get/set is to allow for additional processing to take place when a property is modified or queried.
Mitch Goldstein
Author, Hardcore JFC (Cambridge Univ Press)
[email protected]

Similar Messages

  • MAKING MORE ARCHIVE IN MATERIALIZED VIEW

    Hi experts,
    i created a materialised view and created index on that, but while refreshing the MV it is making more archive log file.
    in index i also opted nologging option, still while refreshing it is still creating more archieve files.
    what to do so that it should not create more archive while refreshing materlialised view.
    thanks

    10g to 8i can work, assuming
    - 8i = 8.1.7
    - You are applying at least the 8.1.7.4 patchset to the master (8i) or you are applying the latest patchset to the slave (10g). Realistically, you probably want to do both.
    If you are talking about using the standard edition, I assume that you are only doing basic replication, not multi-master replication. I also assume you are aware of the limitations on hardware that come with Standard Edition 1-- I don't recall if you are limited to machines that have a capacity for 2 or 4 CPU's. Also, be aware that Oracle considers multi-core CPU's as multiple CPU's.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Making more room on my Ipod

    I have removed a bunch of thing on my ipods playlist but it does not seem to be making more space. What do I need to do to free up space.
    thanks

    Removing songs from a playlist doesn't free up space, playlists are just links to songs. They need to be deleted from the iPod's Music library: Deleting songs or playlists from your iPod

  • How does Motion 2 compare to After Effects?

    I have used After Effects in school but now that I am using FCP instead of AVID I was thinking that it'd probably be a good idea to switch over.
    I mainly want to use Motion 2 for adding filter effects and transistions to my videos. Is the connectivity between FCP and Motion such a boon that I should learn how to use it?
    From messing around in Motion I've found that it seems much more complicated than After Effects and a bit more unwieldy (but I've barely scratched the surface).
    When I looked at what has been added in Motion 3 I was a bit upset that I bought FCS1 a couple months before 2 came out. Motion 3 seems to be much improved, but alas, it's too late.

    I agree. I too am in the job market and find that there are more jobs that ask for After FX experience than Motion. Having learned both, I made the decision of just working with Motion and developing my skills to a higher level.
    Motion is way more enjoyable to work with. I produce faster with it and it does just about everything that After FX can do. If it doesn't...I go to Shake 4.1. Shake has a much better keyer than After FX. You can combine Primate and Keylight together and get much better results than After FX. I even like the work flow better in Shake than I do in After FX.
    I find that, for some reason, I am more creative in Motion than After Effects. It just flows nicer for me I quess. As far as intergration with Flash, there honestly isn't that much difference. While After FX imports and exports .swf and .flv files....Motion or should I say Quicktime exports to .flv. Both produce large file sizes...I think Motion was a few kb smaller than After FX....I usually end up exporting small image sequences with a alpha channel into Flash. Both Motion and After Effects export image sequences.
    Once Motion 3 is out and stable, I think the gap will be alot closer to After FX. I am going to the Final Cut Studio 2 on tour in NYC on Tues, I'll be sure to ask about cast shadows! How can you leave that out?
    As far as getting jobs, I want to find a company that uses Macs and Final Cut in their workflow. Companies that use PC have no choice but to use After FX....Who wants to work on a PC!
    Best Regards,
    Ed
    Powerbook 15" 1.67 GHz   Mac OS X (10.4.9)   Maxed out!

  • Does making final field static improve performance or save memory?

    Are final fields given value at compile time by the compiler?
    private final String FINAL_FIELD = "31";
    Does making final field static improve performance or save memory?

    Actually it's final static fields with primitive or String type that are treated specially. For other final fields only extra compile time checking is produced, they are the same at run time.
    final static primitives are treated as compiler constants, and a literal value is substituted. No actual field is created.
    Myself I consider an awareness of Java internals valuable. For example, if you were unaware of the above the occasional misbehaviour of final static primitives referenced in other classes would be baffling. If your code references a final static primitive from another class it's compiled as a literal, not a reference, so if their value changes in the other class, the referring class will retain the old value if not re-compiled.

  • Does making objects equal null help the gc handle memory leakage problems

    hi all,
    does making objects equal null help the gc handle memory leakage problems ?
    does that help out the gc to collect unwanted objects ??
    and how can I free memory avoid memory leakage problems on devices ??
    best regards,
    Message was edited by:
    happy_life

    Comments inlined:
    does making objects equal null help the gc handle
    memory leakage problems ?To an extent yes. During the mark phase it will be easier for the GC to identify the nullified objects on the heap while doing reference analysis.
    does that help out the gc to collect unwanted objects
    ??Same answer as earlier, Eventhough you nullify the object you cannot eliminate the reference analysis phase of GC which definitelely would take some time.
    and how can I free memory avoid memory leakage
    problems on devices ??There is nothing like soft/weak reference stuffs that you get in J2SE as far as J2ME is concerned with. Also, user is not allowed to control GC behavior. Even if you use System.gc() call you are never sure when it would trigger the GC thread. Kindly as far as possible do not create new object instances or try to reuse the instantiated objects.
    ~Mohan

  • 'My Application Page' is not allowed here because it does not extend class 'System.Web.UI.Page'

    I have a custom SharePoint 2010 solution that includes an aspx page. The aspx page in is in the /layouts folder within the solution and I created it by just adding an application page to the solution. I am trying to create a parent-child relationship between
    two different lists in SharePoint. From the parent I have a custom button on the ribbon that creates a child item with the ID of the parent stamped on it.
    The page is just a processing page that forwards on parameters from the parent to the new child item. (i.e. the ID value)
    The code generated when I add the aspx page is below:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="MY.Solution.Layouts.MY.Solution.processingpage" MasterPageFile="~/_layouts/application.master" %>
    <asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    </asp:Content>
    <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    </asp:Content>
    <asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server"> Processing Page </asp:Content>
    <asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" > Processing Page </asp:Content>
    The code behind is as follows:
    using System;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Administration;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.Utilities;
    using System.Reflection;
    namespace MY.Solution.Layouts.MY.Solution
    public partial class processingpage : LayoutsPageBase
    protected void Page_Load(object sender, EventArgs e)
    try
    //Get a reference to the SPWeb object
    SPWeb oWeb = SPContext.Current.Web;
    //Use the Parameters That Are Passed In
    SPList thisList = oWeb.Lists[new Guid(Request.QueryString["List"])];
    SPListItem thisItem = thisList.GetItemById(int.Parse(Request.QueryString["ID"]));
    sContentType = thisItem["ContentType"].ToString();
    sContentTypeID = thisItem.ContentTypeId.ToString();
    if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAIID = thisItem["ID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/Blist" + "/NewForm.aspx?AIID=" + sAIAuditID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAIID = thisItem["AIID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/AList" + "/NewForm.aspx?AIID=" + sAIID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else if (sContentType == "Some Content Type")
    sContentTypeID = "";
    sAICID = thisItem["AICID"].ToString();
    //Redirect to newform.aspx with the Appropriate parameters.
    Context.Response.Redirect(oWeb.Url + "/Lists/CList" + "/NewForm.aspx?AICID=" + sAICID.ToString() + "&ContentTypeId=" + sContentTypeID + "&ParentItemID" + Context.Request["ID"]);
    else
    LoggingService.LogError("MY.Solution - Processing Page", "No Applicable Content Type Found.");
    catch (Exception ex)
    LoggingService.LogError("My.Solution - Processing Page", ex.Message);
    finally
    //DO SOME FINAL THINGS HERE WHEN REQUIRED.
    In the page I need to use Request.QueryString to get the values from the URL. But when I deploy the solution and load the page I get the error:
    'MY.Solution.Layouts.MY.Solution.processingpage' is not allowed here because it does not extend class 'System.Web.UI.Page'.
    When I change the line:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="MY.Solution.Layouts.MY.Solution.processingpage" MasterPageFile="~/_layouts/application.master" %>
    to inherit as follows:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" MasterPageFile="~/_layouts/application.master" %>
    it does not work either.
    If I change it to inherit like below:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="processingpage.aspx.cs" Inherits="System.Web.UI.Page" MasterPageFile="~/_layouts/application.master" %>
    it also does not work.
    What does this error actually mean?  And why doesn't the default code generated by Visual Studio work?

    @NadeemYousuf I have tried this too and it didn't work.  
    What does the error even mean?  And why does the error appear with default Visual Studio code?  In my example I have just added a basic application page with no other code in it and it still does not work.

  • Does the Flashback malware have an effect on OS X systems without java installed?

    Does the Flashback malware have an effect on OS X systems without java installed? Just asking since i do not have java installed...

    It's not likely, but better safe than sorry. See
    Helpful Links Regarding Flashback Trojan
    Visit Thomas Reed's site for insight and help: Mac Malware Guide
    A Google search can reveal a variety of alternatives on how the remove the trojan should your computer get infected. This can get you started. However, be careful about what you do as new variants of the malware circumvent the efforts of earlier tools.
    Also see Apple's article About Flashback malware.
    Apple has released Java updates for Snow Leopard and Lion users:
    Java for OS X Lion 2012-003; available only for users of Lion with Java installed.
    Java for Mac OS X 10.6 Update 8; available only for users of Snow Leopard.
    Flashback malware removal tool; available only for users of Lion without Java installed.
    Install whichever shows up in Software Update. It removes the malware (if present), updates Java (if present) and tightens up Java settings for the future.  You may download from Apple's web site instead of using Software Update, but it's important to know which one to get, because the other two won't work for you.
    For the truly paranoid see 10 Simple Tips for Boosting The Security Of Your Mac.

  • HT1338 HI i mail app does no more work, only some Icloud 'me' are visible and not even all of them show up. How can I solve this?? thanks!

    Hi I cannot anymore use the mail application. It does no more laod my mails and wont send new ones. Next to my inbox I get a   !   sign
    thanks for your help

    What version of OS X and Mail are you running?

  • HT1420 Does this procedure (deauthorizing iTunes) also effect the Mac app store, or do I need to also reauthorize it somehow before formatting my hard drive?

    Does this procedure (deauthorizing iTunes) also effect the Mac app store, or do I need to also deauthorize it somehow before formatting my hard drive?

    You only need do this in iTunes. See iTunes Store- About authorization and deauthorization.

  • Need help making this class Runnable.

    Hello,
    This class (see below) is working fine the way it is but I have a little problem, I need to execute aprox 500+ commands and each command takes between 30sec to 3 minutes to complete which translate into hours for the job to finish.
    I want to speed the process by multi-tasking and executing (possibly) all commands simultaniously by somehow making this class Threaded/Runnable (miltitasking). There must be something tricky about Runtime class and cannot figured it out.
    Your help would be highly appreciated.
    Regards,
    Ulises
    public class CmdTest {     
    public static void main(String[] args) throws java.io.IOException {
    String outFile = "./ds8300/lsvogrp.txt";
    PrintWriter bout = null;
    try {
    bout     = new PrintWriter(                         new FileWriter(new File(outFile)));     
    } catch (IOException e) {
         e.printStackTrace();
    Runtime run = Runtime.getRuntime();
    run.traceMethodCalls(true);
    Process proc2 = run.exec("cmd /c dscli -user user -passwd psw" + "lsvolgrp -l");
    BufferedWriter ot = new BufferedWriter(
    new OutputStreamWriter(proc2.getOutputStream()));
    BufferedReader br = new BufferedReader(
    new InputStreamReader(proc2.getInputStream()));
    BufferedReader er = new BufferedReader(
    new InputStreamReader(proc2.getErrorStream()));
    try {
    String s;
    while((s=br.readLine())!=null) {
         System.out.println(""+s);
         bout.println(s);
    while((s=er.readLine())!=null) System.out.println("ERR:"+s);
    bout.close();
    System.exit(0);
    }catch (Exception ie) { //catch (InterruptedException ie) {
    System.out.println("Interrupted:"+ie.getMessage());}
    }

    Seems like the same question you asked last year.
    http://forum.java.sun.com/thread.jspa?threadID=5181153&messageID=9705196#9705196
    The proper way to design software is to start at the beginning and design Classes. Not try to butcher that which is working.
    You're running work outside the JVM and this work might interfere with other, similar work (the multi-threading issue.)
    I'd start with paper and pencil and see what conflicts might arise.

  • More than one video effect for same clip?

    Is it possible to apply more than one video effect to the same clip? I know this could be done in previous versions of iMovie, but I can't seem to figure out how to accomplish this task in '09!!
    Thanks!

    In general, no, you cannot do two video effects at the same time.
    However, black and white is a special case, because you can achieve this using Video Adjustments.
    You can select Aged Film and then adjust to Black and White in Video Adjustments.
    Try setting the Saturation slider all the way to the left (0%)
    Then, move the Contrast slider to the right until it is around 50%.

  • Interfaces declare methods that one or more classes may or may not implemen

    Interfaces declare methods that one or more classes may or may not implement.
    true or false?

    Encephalopathic wrote:
    If you want to appear to be more than just someone scrounging for someone else to do their homeworkHe/she is what they is
    [http://forum.java.sun.com/thread.jspa?threadID=5292343]
    [http://forum.java.sun.com/thread.jspa?threadID=5283461]
    [http://forum.java.sun.com/thread.jspa?threadID=5283412]
    [http://forum.java.sun.com/thread.jspa?threadID=5279385]

  • Please! WHY? Why does the main class cannot find symbol symbol : constructor Car(double) location: class Car?

    Why does the main class cannot find symbol symbol : constructor Car(double) location:
    class Car .. ??
    class Car
    { //variable declaration
    double milesStart; double milesEnd; double gallons;
    //constructors
    public Car(double start, double end, double gall)
    { milesStart = start; milesEnd = end; gallons = gall; }
    void fillUp(double milesE, double gall)
    { milesEnd = milesE; gallons = gall; }
    //methods
    double calculateMPG()
    { return (milesEnd - milesStart)/gallons; }
    boolean gashog() { if(calculateMPG()<15) { return true; } else { return false; } }
    boolean economycar() { if(calculateMPG()>30) { return true; } else { return false; } } }
    import java.util.*; class MilesPerGallon
    { public static void main(String[] args)
         double milesS, milesE, gallonsU;
         Scanner scan = new Scanner(System.in);
         System.out.println(\"New car odometer reading: 00000\");
          Car car = new Car(milesS); car.fillUp(milesE, gallonsU);
         System.out.println(\"New Miles: \" + milesE); milesE = scan.nextDouble();
         System.out.println(\"Gallons used: \" + gallonsU);
         gallonsU = scan.nextDouble();
         System.out.println( \"MPG: \" + car.calculateMPG() );
         if(car.gashog()==true) { System.out.println(\"Gas Hog!\");
          if(car.economycar()==true) { System.out.println(\"Economy Car!\");
         } System.out.println(\"\");
         milesS = milesS + milesE;
         System.out.println(\"Enter new miles\");
          milesE = scan.nextDouble();
         System.out.println(\"Enter gallons used: \");
          gallonsU = scan.nextDouble();
         car.fillUp(milesE, gallonsU);
         System.out.println(\"Initial miles: \" + milesS);
         System.out.println(\"New Miles: \" + milesE);
         System.out.println(\"Gallons used: \" + gallonsU);
         System.out.println( \"MPG: \" + car.calculateMPG() );
         System.out.println(\"\"); } }

    Why does the main class cannot find symbol symbol : constructor Car(double) location:
    class Car .. ??
    Please tell us which line of code you posted shows 'Car (double)'.
    The only constructor that I see is this one:
    Car(double start, double end, double gall)

  • Making more archieve file while refreshing materialised view

    Hi experts,
    i have created a materialised view and index on that, while refreshing it is making more archive files,
    how to stop making archieve while refreshing the Materialised view.
    i also opted nologging option on that,

    Hi experts,
    i have created a materialised view and index on that, while refreshing it is making more archive files,
    how to stop making archieve while refreshing the Materialised view.
    i also opted nologging option on that,

Maybe you are looking for

  • My ratings have "disappeared"

    I made a second library for about 5000 photos (CR2) that I took on a trip, which lives on a networked hard drive.  I applied ratings and keywords to about half of the images; but since upgrading to Lion and Aperture 3.2, I cannot see any of the ratin

  • Passing unicode characters from ExtendScript to HTML5 extension

    I need to pass some Japanese text from ExtendScript to the HTML5 extension. But when I receive the string from the extension it's broken in the middle. Is there a way to fix this?

  • Getting system restart time

    Hello all, Not sure if this is the right place to post this question. Pardon me if it is not. Is there a way in java to find out, when the system was restarted the last time. I found out there are a couple of means by which this can be accomplished i

  • Canvas Garbled

    My canvas is garbled just like in this image I found online: http://img403.imageshack.us/img403/4780/picture2hu2.png . This is both on my MBP and PowerMac... any thoughts? TIA

  • Dwb libsoup-WARNING No feature manager for feature of type

    Hi, after upgrading to  glibc-2.18-5 I get this warning. dwb libsoup-WARNING No feature manager for feature of type 'SoupAuthNTLM' And dwb will not autostart anymore. Same on a build with archiso, file a bug?...