Could someone explain this to me, please?

I fixed a problem without really understanding how and why the problem occured or even why my fix worked.  I'm hoping somebody can explain it to me.  Here's the problem:
My form had this structure:
MainSubform
     Page1Subform
          Subform1
          Subform2
          Subform3
     Page2Subform
          other subforms
     Page3Subform
          other subforms.
There were other objects under the
My application viewer, which is FormStream filler, was finding a fourth node under Page1Suform.  I couldn't access this phantom node in any way to find out any information about it, so any Javascript which navigated the hierarchy would error when it tried to reach it.
Through a long consultation with other developers, I found that there was something called a 'bind match" node.  They couldn't explain it to me.  Not knowing what a 'bind match" node was, and figuring it had something to do with linking a data source to an object, I started checking the Default Binding tab in the Object Panel.  The Default Binding for Page1Subform was set to None, while the Default Binding for every other subform was set to Normal.  I set the Default Binding for Page1Subform to Normal and my problem disappeared.  I tried setting other Default Binding properties of other subforms to None to see what would happen, and the phantom node seemed to reappear and follow those subforms around.
Can anybody give me an explanation of what was happening?

Hi again,
right so I have done what you all said and gone and read a book on LabView fundamentals, "introduction to data aquisition with LABVIEW by RH king"
it has answered my questions about the for loop and most of the rest, the thing I am now having trouble with is the pink lines coming from the DAQ assistant, I have tried all the options, generate signal, aquire, sine wave, digital, continuous samples, N samples but I can't get a pink line, all I can get in that location is a gray "error out", is this all it is, just connect error out to error in.
Also another thing that is confusing me is, just before the graph, that component between the last division and the graph indicator, I am having trouble identifying.
Sorry to keep badgering on about this one but I need to get this example completed for work.

Similar Messages

  • When running labview's test executive I recieve runtime error: Call to step "PRE-RUN" failed. Could someone explain this error?

    I have a set of vi's that work when run under labview. However, when calling these vi's from labview's test executive I recieve runtime error: Call to step "PRE-RUN" failed. in Assign Connector Pane.vi->Call Test.vi->Execute Pre-Run.vi->Test Executive. Could someone explain this error to me? (or ideally tell me how to fix it?) Thanks.

    Hello,
    There are any number of possible causes to this problem. Which version of Test Executive are you using? Have you upgraded your Test Executive recently? The latest version is 5.1.1. If you have changed anything about Test Executive on your computer recently, I recommend you perform a mass compile of all your VI libraries, as having different versions of the VIs on your system could often result in the "Call to Step XYZ Failed" errors. Also, are you using any DAQ or Analysis VIs in your steps? We have seen problems where the use of DAQ or Analysis VIs in the sequence can cause intermittent "Call to Step...Failed" errors. There are some KnowledgeBase entries on our website that discuss this problem. Are you using the Test Executive in the VI environment, or
    as an executable? Again, there are some problems with using Test Executive as an executable that result in these errors, and there are also KnowledgeBase entries that discuss these problems.
    If you have a pared-down application that demonstrates the problem, feel free to send me your VIs and your .seq file and I will try to reproduce the problem.
    Alternatively, I would suggest you visit www.ni.com/teststand to learn about TestStand, our state-of-the-art Test Sequencing software that completely outperforms Test Executive. It is very easy to use and much more powerful, and we have a top-notch support team available dedicated exclusively to supporting TestStand. As you are probably aware, we are no longer developing Test Executive, and instead are concentrating our efforts on making TestStand the penultimate solution for all our customers' test sequencing needs.
    I appreciate your patience on this issue. Please let me know if I can offer further assistance.
    Have a pleasant weeken
    d.
    Sincerely,
    Darren Nattinger
    Applications Engineer
    National Instruments
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Could Someone Explain Interfaces in English Please?

    Hi Everyone-
    I'm new to Java. I've been reading "Learning Java" from O'Reilly. From what I understand, Interfaces are sort of a structural framework that lists certain methods. Any class that implements an interface must contain this "structure" and any objects intantiated using this class will be of the interface type? Is this correct? If not can someone explain interfaces in laymen's terms and the what is the usefulness of implementing Interfaces?
    Thanks.
    SA

    I'm new to Java. I've been reading "Learning Java"
    from O'Reilly. From what I understand, Interfaces are
    sort of a structural framework that lists certain
    methods. Any class that implements an interface must
    contain this "structure" ...OK so far...
    and any objects intantiated
    using this class will be of the interface type? Is
    this correct? It depends what you mean by "interface type". An interface can be said to define a type. So a class that implements that interface implements that type, and an object instantiated from that class is an instance of that type.
    If not can someone explain interfaces in
    laymen's terms and the what is the usefulness of
    implementing Interfaces?The utility of interfaces is that, without being tied down to particular implementations, allows types of objects to be defined.
    For example....is there a doctor in the house? Say:
    1) a Doctor is:
    - human
    - has gone to medical school
    - heals the sick
    2) a Norwegian is:
    - a person from Norway (assume we've defined "person" at this point)
    3) a Canadian is:
    - a person from Canada
    So:
    4) a Norwegian Doctor is a person from Norway who fulfills the qualifications to be a doctor
    5) a Canadian Doctor is a person from Canada who fulfills the qualifications to be a doctor
    6) a Canadian who is not a Canadian Doctor, is a person from Canada who does not fulfill the qualifications to be a doctor.
    If your appendix is about to burst, you need a doctor. You don't care if the doctor is Canadian or Norwegian (assume everybody including yourself speaks Esperonto so there aren't any language issues). You do care deeply if the person trying to remove your appendix is a Canadian but not a Canadian doctor.
    If you were establishing a hospital, you'd want doctors. If you were to write this in code, you'd have something like:
    Hospital.hireDoctor(Doctor doc);meaning, that method in the Hospital class will hire a doctor, which is the important part. So this would work:
    Doctor doc = NorwegianMedicalSchool.createDoctor();
    Doctor doc_eh = CanadianMedicalSchool.createDoctor();
    yourHospital.hireDoctor(doc);
    yourHospital.hireDoctor(doc_eh);The point is, you can write your Hospital code without knowing precisely how "Doctor" is implemented -- whether the doctors come from Canada or Norway. You just write it as appropriate given that you have a Doctor. And then when a Doctor is created by a Japanese medical school, it doesn't break your code. This is why interfaces are said to define "contracts" -- an interface defines what something is (i.e., what it does), and you can make your code insist on getting something that does that (fulfills the contract).
    Does this make any sense? Have I offended the Canadians? Probably.

  • Could someone explain this please?

    Hi im new to the PCI-E world and i still really dont understand what this stuff means,this is a example off of a motherboard;
    PCI Express 2.0 x16     1 x mazarine PCI Express x16 slot with x16 operation
                                    1 x light-blue PCI Express x16 slot with x8 operation
    does the x8 mean the video card will only work half as good in the second slot?
    sorry for the newb question :(

    Have a read here: https://forum-en.msi.com/index.php?topic=115732.0

  • Could someone explain this java practice to me

    Hi
    I have been reading the latest JDC tech tip newsletter and i came across the following line:
    Set sethash = new Hashset();
    I'm assuming an object of class Set implements the Hashset interface but why not use
    Set sethash = new Set();
    Instead? What are the advantages (if any ) are there in creating a reference to an object in this way? I've seen this quite often but could never understand why its done.
    I've always wondered about this.
    Thanks
    Kola

    1. well first of all a forum is one way of finding out
    something maybe not the best but its a way,
    No, sometimes a forum is not "a way" at all. For instance this forum is not the place to ask a question like....
    I have 100 million dollars and I need to set up a competitive service to completely replace ebay - so what do I do?
    Some questions are entirely too broad. Some questions are just impossible. Some questions display a severe lack of knowledge of some infrastruture which can only be address in java once that other knowledge is acquired.
    So not all questions are appropriate.
    2. its not as if i'm asking somone to do some
    homework, i'm asking more experienced developers than
    me why they do certain things a certain way. If i
    asked what is an interface then i could understand...
    Yes but your question is phrased rather poorly and so it is open to interpretation. The following are all interpretations that I saw:
    -You don't know what an interface is.
    -You simply didn't look at the definitions for the items that you specified in your example.
    -You don't know why one uses an interface in the first place.
    I suspect that reply 2 correctly guessed what your question was. However I consider that a luck guess. And notice that I do not list it in my guesses. Keep in mind that the only reason I believe this to be true is because I have seen the same question before (and I read a lot of questions.) Without my experience that is probably harder to see.
    3. if you read my post you would of seen that i said
    i've often seen something done a certain way and
    wondered why is that being Lazy? The operative word
    being "often"
    Lazy in the other posts probably refers to the preception that your question stems from the second guess that I made above. They felt that you could have looked it up.
    4. i could read as many books as i want..gang of 4,
    code complete, just java, dietel & dietel,thinking in
    java etc somethings you only learn through experience
    so i'm lazy because i have less experience than
    others?
    Same point as 3.
    5. finally if you do not have a construtive response
    to this message please do not bother with a reply i
    have no time for flame wars and i'm embarrassed to
    have to post this around other mature and talented
    programmers such as the ones that returned helpful
    answers to my posts!
    I can't speak for the others but I respond to about 10 posts a day. I read at least 30 a day. I do that six days a week. For me, it just sometimes gets tiring to see a question that the poster could have found the answer for by just looking at the java docs or by doing a simple search. Most of the time I just answer the question. Sometimes I point out that they could have found the answer themselves.
    Others can sometime be less tolerant of this.
    And still others just like to cause havoc. At least one of the responders to your post is of this type.
    Sometimes even free advice has a cost.

  • Could someone explain this output?

    my Maze class
    import java.util.Scanner;
    import java.io.*;
    public class MazeProblem{
         private char [][] maze;               //maze array of 0's and 1's
         private boolean [][] visit;          //visited/unvisited array
         private int height, width;          //height and width of array
         private int startx, starty;          //starting point
         private int exitx, exity;          //exit point
         private Scanner sc;                    //file reader
         private StringTokenizer st;          // to split the file.
         public MazeProblem(String file){
              try{
                   sc = new Scanner(new BufferedReader(new FileReader(file)));
                   while (sc.hasNextLine()){
                        height = sc.nextInt();
                        width = sc.nextInt();
                        System.out.println("no. of rows: " +height); // tester code
                        System.out.println("no. of cols: " +width);      //tester
                        maze = new char[height][width];
                        visit = new boolean [height][width];
                        for (int i = 0; i < height; i++){
                             for (int j = 0; j < width; j++){
                                  maze [j] = sc.next().toCharArray()[0];
                        System.out.println("");
                        startx = sc.nextInt();
                        System.out.println("startx = " + startx);
                        starty = sc.nextInt();
                        System.out.println("starty = " + starty);
                        exitx = sc.nextInt();
                        System.out.println("exitx = " + exitx);
                        exity = sc.nextInt();
                        System.out.println("exity = " + exity);
              catch(FileNotFoundException e){
                   System.out.println("File not found.");
                   System.exit(0);
              finally{
                   sc.close();
              for (int i = 0; i < height; i++){
                   for(int j = 0; j < width; j++){
                        System.out.print(" " + maze[i][j]);
              System.out.println("");     
         //find out if there is a path from start to finish
         public boolean isPath(){
              return isPath(startx, starty);     //call recursive method
         //recursive method that chekcs for the path from current location
         //to finish location.
         private boolean isPath(int x, int y){
              //base case current loc. outside of maze
              if (x < 0 || x >= height || y < 0 || y >= width)
                   return false;
              //base case current loc. is a wall
              else if (maze[x][y] == '1')
                   return false;
              //base case current loc already visited
              else if (visit[x][y] == true)
                   return false;
              //base case current loc is exit
              else if (x == exitx && y == exity)
                   return true;
              else{
                   visit[x][y] = true;               //mark current location as visited
                   //if there is a path from one of the neighbors then there
                   //is a path from current loc.
                   if (isPath(x-1, y) || isPath(x+1, y) || isPath(x, y-1)
                        || isPath(x, y+1)){
                        return true;
                   else                              //if there are no paths from neighbors
                        return false;               //then there is no path from current loc.
    }tester classimport java.util.Scanner;
    public class MazeTest{
         public static void main(String[] args){
              Scanner sc = new Scanner(System.in);
              System.out.print("enter your file name: ");
              String file = sc.nextLine();
              MazeProblem maze = new MazeProblem(file);
                   if (maze.isPath())
                        System.out.println("Path: " + maze.isPath());
                   else
                        System.out.println("No path present.");
    }when ran at command:
    no. of rows: 4
    no. of cols: 6
    startx = 2
    starty = 1
    exitx = 0
    exity = 4
    1 0 1 1 0 1
    0 0 1 0 0 0
    1 0 1 0 1 0
    0 0 0 0 1 1
    Path: false
    there is an obvious path.
    if I change my tester file to omit the if else portion the program works.
    But I would like to output if there isnt a path available, and can't seem to make that happen.
    the file looks like this:
    4 6
    1 0 1 1 0 1
    0 0 1 0 0 0
    1 0 1 0 1 0
    0 0 0 0 1 1
    2 1
    0 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    B_pnzk wrote:
    if (maze.isPath())
    System.out.println("Path: " + maze.isPath());
    else
    // etc
    This bit of the code caught my eye. Since you output is saying "Path: false" how does it ever get to that line given that the condition was if(maze.isPath())?
    It seems to me that you could change the MazeTest main() method so that this oddity doesn't occur. Or - with a little more effort - you could change the MazeProblem class so that it can't occur.

  • Could someone explain this tip?

    I have been given the following tip from my tutor to make my program:
    When you open the file for reading (before calling method
    acceptData), you will/should have created a Scanner object
    for reading from the file. It is this Scanner reference that
    should be passed to acceptData as the method's second argument
    (not a File argument).
    Does any one know exactly what should be written above "acceptData" and how it should be passed to "acceptData"?
    I don't think you should need the code to answer this question, correct me if I'm wrong.
    Thanks for any help in advance!

    I don't really understand, I have tried doing what you said above. I just keep getting different things, don't think I'm doing it right.
    These are the 3 modules that are being dealt with a the minute:
    public static void main(String[] args) throws IOException
              int Month;
              String reply;
              initialiseVariables();
              int Year = getYear();
              boolean leapYear = isLeapYear(Year);
              File dataFile = new File("Data" + Year + ".txt");
              Scanner input = new Scanner (dataFile);
              for(Month = 1; Month < 13; ++Month)
                   acceptData(Month,dataFile);
                   int numDays = getMonthDays(Month,leapYear);
                   updateStatistics(Month,numDays);
              displayStatistics();
              saveStatistics(Year);
              do
                   int monthNum = getMonth();
                   displayData(monthNum);
                   System.out.print("\nDo you wish to do this again?(y/n) ");
                   reply = input.next().toLowerCase();
              }while (reply.equals("y"));
              System.out.println("\n");
    public static void acceptData(int monthNum, Scanner scanner, File fileName) throws FileNotFoundException
              System.out.println("\nMonth Rainfall Max Temp Sun Hours");
              System.out.println("----- -------- -------- ---------\n");
              MonthName[monthNum] = scanner.next();
              System.out.print (MonthName[monthNum]);
              Rainfall[monthNum] = Integer.parseInt(input.nextLine());
              System.out.print (Rainfall[monthNum]);
              MaxTemp[monthNum] = Integer.parseInt(input.nextLine());
              System.out.print (MaxTemp[monthNum]);
              MaxDay[monthNum] = Integer.parseInt(input.nextLine());
              System.out.print (MaxDay[monthNum]);
              SunHours[monthNum] = Integer.parseInt(input.nextLine());
              System.out.print (SunHours[monthNum]);
              System.out.println();
              input.close();
    public static int getYear()
              int Year;
              Scanner input = new Scanner(System.in);
              System.out.println("\nPlease enter a year: ");
              Year = input.nextInt ();
              File fileName = new File("Data" + Year + ".txt");
              while (!fileName.exists())
                        System.out.println ("\n*** File not found! ***");
                        System.out.println("\nPlease enter a year: ");
                        Year = input.nextInt ();
                        fileName = new File("Data" + Year + ".txt");
              return Year;
    I basically need acceptData to work so it prints from the file onto the screen.

  • Could someone explain this method of using forms

    this method used in a page of the web site I currently tinker on has a peculiar look to the way one of the forms was put in place. That form below and its code aswell should make the form visible on the page is desing view, but its isn't showing one, though on the server and web browser it does show that the form exist and working just fine, what Im trying to get at is that all the other forms are visible in desing view except this one, and I need to edit some of the text on it cause the letters are too far from the forms on the right. so where might this form be located? any help is greately appreciated cause I'm trying to get to know the whole site in case of a technical/design issue if one arises.

    To see parsed data in PHP pages, you need a local testing server.
    WAMP for Windows
    http://www.wampserver.com/en/
    XAMPP for Windows
    http://www.apachefriends.org/en/xampp-windows.html
    XAMPP for Mac
    http://www.apachefriends.org/en/xampp-macosx.html
    MAMP for Mac
    http://www.mamp.info/en/downloads/index.html
    Setting up a PHP environment in Dreamweaver
    http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html
    Nancy O.

  • Could someone explain this to me.

    I have a panel that I add transparent textpanes with shapes drawn over the top, the shapes and textpanes originat from a class named round button.
    I add the shapes in a loop:
    for( int i = 0; i < answer.length; i++ ){
           if( answer[i] != null ){
              String answerText = answer;
    buttonPanel.add(new RoundButton(answerText, buttonColor,
    buttonShape, size, myMouseListener));
    I've noticed that the first time I add 2 textpanes and shapes I get six calls to the drawSquareButton method. WHY?
    I can not figure it out. Although I only get 2 squares on the screen, the flicker of the process is driving me nuts.
    Below is class RoundButton
    public class RoundButton extends JTextPane {
    private Color color;
    public String buttonShape;
    private String label;
    private Dimension size;
    private java.awt.event.MouseListener myMouseListener;
    public RoundButton(String label, Color color, String buttonShape,
                        Dimension size, java.awt.event.MouseListener myMouseListener) {
           super();
           setOpaque (false);
           setEditorKit (new MyEditorKit());
           SimpleAttributeSet set =  new SimpleAttributeSet();
           StyleConstants.setAlignment (set, StyleConstants.ALIGN_CENTER ); 
           setParagraphAttributes (set, true);
           setText(label);
           addMouseListener(myMouseListener);
           this.color = color;
           setPreferredSize(size);
           this.buttonShape = buttonShape;
    // set the rendering hints for the Graphics object 
      private Graphics2D setGraphicsObject(Graphics g){
            Graphics2D g2 = (Graphics2D)g; 
            g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING,
                         RenderingHints.VALUE_ANTIALIAS_ON );
            g2.setRenderingHint( RenderingHints.KEY_RENDERING,
                         RenderingHints.VALUE_RENDER_QUALITY );    
            g2.setRenderingHint( RenderingHints.KEY_COLOR_RENDERING,
                         RenderingHints.VALUE_COLOR_RENDER_QUALITY);
            return g2;
    // Determine which shape to draw
      protected void paintComponent(Graphics g) {
         System.out.println("paint component");
            if( buttonShape.equals("square"))
                drawSquareButton(g, color);
            else if(buttonShape.equals ("oval"))
                drawOvalButton(g, color);
            else if(buttonShape.equals ("circle"))
                drawRoundButton(g, color);
            super.paintComponent(g);
      public void drawSquareButton(Graphics g, Color color){
            System.out.println("draw square button");
            Graphics2D g2 = setGraphicsObject(g);
            g2.setStroke(new BasicStroke(1.2f));
            g2.setColor(color);
            g2.fill(new RoundRectangle2D.Double(1,1,(getWidth()-3),(getHeight()-3),30,30));
            g2.setColor(color.darker ());
            g2.setStroke(new BasicStroke(2.2f));
            g2.draw(new RoundRectangle2D.Double(1,1,(getWidth()-3),(getHeight()-3),30,30));
      public void drawOvalButton(Graphics g, Color color){
            Graphics2D g2 = setGraphicsObject(g);
            g2.setStroke(new BasicStroke(1.2f));
            g2.setColor(color);
            g2.fillOval(0, 0, getSize().width-1, getSize().height-1);
            g2.setStroke (new BasicStroke(2.2f));
            g2.setColor(color.darker());
            g2.drawOval(0, 0, getSize().width-1, getSize().height-1);
      public void drawRoundButton(Graphics g, Color color){
            Graphics2D g2 = setGraphicsObject(g);
            g2.setStroke(new BasicStroke(1.2f));
            g2.setColor(color);
            g2.fillArc(0,0,getSize().width-1,getSize().height-1,0,360);
            g2.setStroke (new BasicStroke(2.2f));
            g2.setColor(color.darker());
            g2.drawArc(0,0,getSize().width-1, getSize().height-1, 0, 360);

    Do you really want the super.paintComponent() after you've drawn your components?
    Perhaps an else?
    // Determine which shape to draw
      protected void paintComponent(Graphics g) {
         System.out.println("paint component");
            if( buttonShape.equals("square"))
                drawSquareButton(g, color);
            else if(buttonShape.equals ("oval"))
                drawOvalButton(g, color);
            else if(buttonShape.equals ("circle"))
                drawRoundButton(g, color);
            else
                super.paintComponent(g);
    }

  • I want to download iPhoto but it won't let me says I need iOS5.1.  I have the 4s. Could someone explain this?.1.

    I want to download iPhoto but it won't. Says I need iOS5.0. I have the new 4s. Can anyone help me out?

    Your iPhone has to have the iOS upgraded to 5.1 first. If you have not updated it is probably running 5.0 or 5.0.1
    To update the iOS go to
    Settings > General > Software Update then follow the prompts.
    If that says your are at 5.1 then reboot your iPad. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider until the Apple logo appears. Let go of the buttons and let the iPad restart. See if that fixes your problem.

  • Could someone explain what is wrong with this refind expression?

    Hi, could someone explain what is wrong with this refind expression
    faultCode:Server.Processing faultString:'Unable to invoke CFC - Malformed regular expression "^[0-2][0-9][/][0-1][0-2][/][1-2][0-9]{3}+$".'
    thanks

    ^[0-2][0-9][/][0-1][0-2][/][1-2][0-9]{3}$ works,
    thanks
    dates 12/12/2007matching

  • Could someone answer this please.

    Could someone answer this please. I uploaded all my photo's to the cloud from my mac. I then checked on my iPhone and iPad and i could see all 8000 photo's so I deleted them from the mac pro and then set up my mac book air. now I can only see 500 of the 8000 photo's?

    The following is from this Apple document: iCloud: My Photo Stream FAQ
    Does using My Photo Stream substitute for using iCloud Backup or iTunes to back up the photos in my Camera Roll?
    No. Photos in My Photo Stream are saved on the iCloud server for 30 days. To save or back up these photos, you must copy them from My Photo Stream to your Camera Roll on your iOS device. You can then back up your Camera Roll using iCloud or iTunes.
    You should also review this Apple document: My Photo Stream and iCloud Photo Sharing limits
    Bottom line:  iCloud is not a substitute for a local backup of your files including your iPhoto library.  Time Machine and an external HD is the easiest backup strategy to implement.

  • I know this isn't really the right place to ask, but could someone explain why when I open Portal 2, that I got off steam and spent a whole day downloading, keeps crashing when I click the Campaign/Single Player mode. It Freezes and then crashes. Help!

    I know this isn't really the right place to ask, but could someone explain why when I open Portal 2, that I got off steam and spent a whole day downloading, keeps crashing when I click the Campaign/Single Player mode. It Freezes and then crashes. Help!

    I know this isn't really the right place to ask...
    Uhm, why don't you go to the right place, then? There are several Steam/Portal forums out there...

  • Could someone explain the Factory Method Design Pattern

    Hi Experts.
    Could someone please explain for me the Factory Method Design Pattern. I read it a little and I understand that it is used in JDBC drivers but i'm not clear on it.
    Could someone explain.
    Thanks in advance
    stephen

    Basically, you have one class that's sole purpose is to create instances of a set of other classes.
    What will usually happen is you have a set of related classes that inherit from some base class. We'll say for example that you have a base class CAR and it has sub-classes FORD, GM, HONDA (sorry Crylser). Instead of having the user call the constructors for FORD, GM, and HONDA, you can give the user a Factory Class that will give him a copy. We'll call our factory class Dealership. Inside dealership, you can have a static function :
    public static Car makeCar(String type)
    if(type.equals("FORD")
    return new FORD();
    else if(type.equals("GM")
    return new GM();
    else if(type.equals("HONDA")
    return new HONDA();
    So when the user needs a car, they will just call
    Dealership.makeCar("FORD").
    This is a good way to hide the implementation of your classes from the user, or if you require complex initialization of your objects.
    Another good example of this is in the Swing library. To get a border around a component, you call static methods on BorderFactory.
    Hope this helped.
    Ed

  • Could someone explain what is Object?

    Could someone explain what is Object? I have a little
    idea what is it, but not sure. Please give me some
    concret example. Thanks.

    An object is an Instance of a class. A class describes a uniwue entity with behaviors and attributes. For example you can consider your arm.
    public class Arm {
      /** How many hairs on the arm. */
      private int hairCount;  // <== This is an attribute
      /** This is a method to set the hairCount Variable.
       * We dont let the outside user set it directly because that would
       * create problems if we wanted to change its implementation to
       * use a float. In addition we might have logic in this setter to
       * prevent bad data.
      public void setHairCount(final int hairCount) {
        // this is a good example of logic in the set method that we dont
        // want the user to bypass.
        if (hairCount < 0) {
          throw new IllegalArgumentException();
        this.hairCount = hairCount; // <-- Note how we have to use this. to
                                    //     access the instance variable
                                    //     insead of the parameter.
      /** This is a method to move the arm.
       * This is behavior of the class. ONLY behavior pertaining to an arm
       * belongs in the arm class. For example, the method "sneeze" would
       * not belong here but be in the Nose class instead. You can see then
       * that each class describes an entity.
      public void move() {
        // code to move the arm.
    }We have only ONE class per type but we can have many objects. For example the description of an arm does not change no matter who'se arm it is. The data in the class changes but not the actual essence of the arm. So we instantiate two arms for every person (assuming they arent disabled). To instantiate is to create a new object like so.
    Arm myarm = new Arm(): This creates a new object that we can work with.
    So consider the old inteview question of, "What is the difference between a class and an object?" The answer is, "A class is a map or desription of an object; whereas an object is a descrite instance of a class."

Maybe you are looking for

  • Problem with Alt , JMenu and Mnemonics

    I have built an application with a JMenuBar containing several JMenu's, the first of which is a File menu. All JMenus and JMenuItems have mnemonics associated with them. When I press the alt key the underlines show and focus appears to be given to th

  • Dynamic SQL Select String VS non-dynamic USING Clause

    This isn't a question, I just wanted to share a solution to a problem I have encountered several times. e.g. You have 'n' number of variables, of which any combination could be used in a SQL string. But it's difficult to execute the SQL string with U

  • Macbook air more GB RAM

    hey, i recently got a new 11.6" MacBook Air with 2gb ram and i was wondering if it was possible to add 2 more gb of ram ??

  • Autocorrect trigger: time vs. spacebar/return/punctuation

    The autocorrect feature in Mountain Lion is frustrating in that it operates differently from iOS devices. If you type a word which autocorrect wants to correct, time is the trigger for the autocorrection instead of the spacebar or other terminator. F

  • What is the reccomended way to clean the macbook screen?

    i dont want to put water on my screen or windex, how ever cleaning it with a dry tissue doesnt get the fingerprints offf.. what should i use.. thanks :)- kel Macbook 13 inch   Mac OS X (10.4.7)