Red Squirrel Reflections
Dave Hoover explores the psychology of software development

Dave Hoover
dave.hoover@gmail.com

Categories
All [Atom]
Craftsmanship [Atom]
Dynamic [Atom]
Intersection [Atom]
Learning [Atom]
Links [Atom]
Polyglot [Atom]
Projects [Atom]
XP [Atom]
Old Blog

Obtivian Blogs

Andy Maleh
Colin Harris
Fred Polgardy
Jim Breen
Kevin Taylor
Todd Webb
Turner King
Tyler Jennings

Archives

March 2009 (1)
January 2009 (1)
December 2008 (1)
October 2008 (3)
September 2008 (1)
June 2008 (4)
April 2008 (3)
March 2008 (1)
February 2008 (1)
August 2007 (1)
July 2007 (1)
June 2007 (1)
May 2007 (4)
April 2007 (3)
March 2007 (5)
February 2007 (6)
January 2007 (6)
December 2006 (10)
November 2006 (5)
October 2006 (8)
September 2006 (8)
August 2006 (5)
July 2006 (12)
June 2006 (7)
May 2006 (5)
April 2006 (5)
March 2006 (4)
February 2006 (2)
January 2006 (5)
December 2005 (5)
November 2005 (3)
October 2005 (3)
September 2005 (6)
August 2005 (4)
July 2005 (7)
June 2005 (14)
May 2005 (6)
April 2005 (8)
March 2005 (9)
February 2005 (11)
January 2005 (16)
Old Archives

 

Thu, 20 Jan 2005

Mansfield on Reusability

I need to thank Wilkes for providing me and my teammates with a hearty afternoon laugh. Or more specifically, I should thank Richard Mansfield and his take on object-oriented programming and reusability:
"A frequent argument for OOP is it helps with code reusability, but one can reuse code without OOP--often by simply copying and pasting."

[/links] permanent link

Quote Manager Project -- Day 4

An ongoing pet project blog...

I set up a project in IDEA. It's time to start hacking together some GUI code. The first task I am looking to complete is to simply add a new quote to the XML file.

OK, so let's do some GUI work. Hopefully I will be able to write a test or two along the way... Here's what I'm starting with:

package com.redsquirrel.quotes.gui;

public class MAIN {
    public static void main(String[] args) {
        new QuoteManagerPanel();
    }
}
IDEA tells me to Create Class 'QuoteManagerPanel', and I hit the magical ALT-ENTER combination. And away we go! Hack, hack, hack. I've got something visible...

Here's the code that did it:

package com.redsquirrel.quotes.gui;

import javax.swing.JFrame;

public class MAIN {
    private static final String TITLE = "Quote Manager";

    public static void main(String[] args) {
        JFrame frame = new JFrame(TITLE);

        frame.getContentPane().add(new QuoteManagerPanel());

        frame.pack();
        frame.setVisible(true);
    }
}

package com.redsquirrel.quotes.gui;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;

public class QuoteManagerPanel extends JPanel {

    public QuoteManagerPanel() {
        add(new JLabel("Quote: "));
        add(new JTextArea(3, 15));
    }
}
Time to add all of the data field for a quote. I won't bore you with anymore Swing code for a while. It's gonna get ugly...

[/projects/quotes] permanent link


powered by blosxom