quickly parse a FIX message into key/value pairS

http://bigblog.tanbin.com/2012/03/design-considerations-my-first-homemade.html is the context.

    /**
     * Parsing to array is faster than parsing to a HashMap
     */
    public static ArrayList quickParse(String fromServer) {
        ArrayList ret = new ArrayList(Collections.nCopies(
            MAX_FIX_TAG, (String) null));
        for (String pair : fromServer.split(SOH)) {
            String[] tmp = pair.split(“=”);
            if (tmp.length != 2)  continue;
            int tag = Integer.parseInt(tmp[0]);
            ret.set(tag, tmp[1]); //treat ArrayList as array — efficient
        }
        return ret;
    }

bond ref data service – practical caching strategy

Data change frequency is lower than market data. JMS-based cache update.

There's a thin database layer, supported by a dedicated developer — minimal (if any) stored proc. There's a thick java api layer, supported by a team of developers.

To avoid hitting the DB too frequently, there's an in-memory cache, to be updated whenever data changes in the DB. Some places use RV, some use JMS.

static nested classes unnecessary?

As stated in another post, I always start my nested class as “private static” and relax gradually when justified.

Now, some say static nested classes can always be pulled out as first-class citizens i.e. top level classes. No. A major feature (perhaps 2) I rely on everyday is the private access modifier in the context of nested classes.

Nested class can refer to private members (fields/methods) of the enclosing class; enclosing class can refer to private members of the nested class.

virtual inheritance diamond malformed

Both C1 and C2 should virtually derive from Base. You see the D class instantiation only calling Base ctor once. See http://www.parashift.com/c++-faq-lite/virtual-inheritance-where.html

Now, what if we omit one of the “virtual” keywords? Base ctor called twice — tested in GCC

struct B {
    B() {
        cout << "B\n";
    }
};
struct C1: virtual public B {
    C1() {
        cout << "entering C1()\n";
    }
};
struct C2: virtual public B {
    C2() {
        cout << "entering C2()\n";
    }
};
class D: public C1, C2 {
};

int main() {
    D d;