Archives for: January 2006

Jan 30, 2006 : currently...

Listening to: Broadcast : Tender Buttons

Reading: A Short History of the World by John M. Roberts

Watching: How I Met Your Mother

Revising: A paper on Konfidi for submission to a conference and a workshop.

Typing: symbols

Jan 26, 2006 : code reuse, meta-indexes

Ugo Cei's recent posts about using Java from Ruby have made me start thinking about such code re-use. Code re-use is obviously a good thing. Very often there are tools out there that do what you need. If it works with the language you are using, and you can find said tool, things are great.

Part 1: the tool must work with your language Cross-over utilities (aka language bindings) will help bring compatibility from one tool into another language. The most common form of this is wrappers around a C library to make it available in PHP, Python, Java, whatever. I don't know how good these tools are and how much they are used. It'd be good to look into. Another option is languages that run on the same interpreter or virtual machine. Think of .NET and the Common Language Runtime. Parrot is the VM that Perl 6 will run on. There is already work to get Python, Lua, Perl 5, and others to run on it. The Java VM could be used to run other languages, but I don't know that it is. I am surprised there is not more momentum on Parrot and other common-language VMs.

Part 2: you must be able to find the tool How do you find new tools? Googling doesn't cut it; there are too many different terms you could use and too many results to search through. Freshmeat used to be my nearly-definitive source of finding tools. But there are so many tool packages that are not in Freshmeat, but are indexed elsewhere. I think of the Apache Software Foundation and the very-much-in-development projects.apache.org. We need a meta-index of software tools. Basically of the top of my head I can list off a dozen. And when I google for them all together, I get nothing. There is no meta-index of software tools. For starters, I'll list some here now:

And I bet there are a lot more language-specific ones that I don't know of. And then what do you do with smaller sites like the following?

Jan 25, 2006 : A factory bean within Spring

Spring is great at providing instances of a class to an object that depends on using one. You can also use one bean to provide multiple instances of the class to other beans:


    <bean id="list" class="java.util.ArrayList" singleton="false"/>
    <bean id="foo" class="my.FooImpl" />
        <property name="people" ref="list" />
        <property name="computers" ref="list" />
    </bean>
    <bean id="bar" class="my.BarImpl" />
        <property name="baz" ref="list" />
    </bean>

You can also have a "factory" so that a class Baz can create many Yaps (e.g. to populate a List<Yap>).


    <bean id="yap" class="my.YapImpl" singleton="false"/>
    <bean id="bar" class="my.BazImpl" />
        <lookup-method name="createNewYap" bean="yap" />
    </bean>

with Java code:


    public interface Yap { ... }
    public class YapImpl implements Yap { ... }
    public interface Baz { ... }
    public class BazImpl implements Baz {
        public getSomeYaps() {
            // I don't think Spring can provide a parameterized type implementation (e.g. the ArrayList<Yap>)
            List<Yap> yaps = new ArrayList<Yap>();
            for (int i = 0; i < 5; i++) {
                Yap yap = createNewYap();
                yap.setSomething(i*2);
                yaps.add(yap);
            }
            return yaps;
        }
        // overridden by Spring
        protected Yap createNewYap()
            return null;
        }
    }

Jan 09, 2006 : Web 2.0 2.0

Next Page >>

Next Page >>

<  January 2006  >
Mon Tue Wed Thu Fri Sat Sun
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Categories


Archives

Misc

Syndicate this blog XML

powered by
b2evolution