easyMock && mock-object — oo technique

* uses java’s proxy feature
* covers one of junit’s weaknesses
* “recording” required
* useful for jdbc testing

http://en.wikipedia.org/wiki/Mock_Object addresses
* needed in what kind of unit testing scenarios

“mock objects can simulate the behavior of complex, real (non-mock) objects and are therefore useful when a real object is difficult to incorporate into a unit test.”
=> For FTTP testing, it might help when u need a “mock iview object” ie a mock object in place of the real iview

bash search`unix command #precedence

Q: what if you have an alias, a shell func, a shell built-in (like “echo”), a unix executable file, and your own script all sharing the same name?

Focus on 2 simple rules for now:

1) Your own aliases override everything else (such as shell functions)

2) $PATH is the very last (after things like shell built-in commands) place searched by the shell. Executables in $PATH are external to the shell.

I think the same precedence holdes for any shell.

simple(@@) topics ] java

singleton,
factory,
dao,
db connection obj
db connection set-up
thread-safe collections
jdbc conn pool
stack^heap
vector^arraylist

–jsp:
forward/redirect
4 scopes

#

simple? Is shell scripting simple?

These tend to be interview questions, because
* most of us are expected to have used them or know them well
* => yardstick to measure and compare candidates
* familiar to most interviewers

php oo match`java@@

The claim: php is 70% as competent as java, in terms of OO features to model and design a system. I think it’s below 70%.

* polymophism, dynamic bind` @@
* strongly typed — fundamental to OO system design
* A java return type can be declared as an interface/abstract type, so clients can safely use an expected service of the interface
* inner class for OO design
* more access modifiers
* Constructor chain reaction up to Object@@
* overload@@
* custom classloader
* factory, singleton and other patterns
* java proxy to implement AOP
* distributed components — RMI, corba… important for some enterprise systems.

–thread-related
each object’s wait set
monitor

— surprises
custom exception@@ yes

DB tables]FX cash trading system(any bank

Q999: database tables that are the biggest or busiest

A: see blog on Currency Tables and SymbolSourceMapping tables to compute safe crosses.
A999 from ZJW and Piroz
– Trade table,
– Order table –limit orders are pending and have a lifetime. Also, London traders often need to hand over overnight orders to NY, either mandatory stop-loss-orders or unfilled customer orders.
– A family of RFQ tables like my bidans/bidstreet/bidreq tables.
– IncomingQuote table is (according to ZJW) the biggest and busiest, but there’s probably a separate table for each quote source.
– OutgoingQuote table ??
– ClientPosition table has a primary key on (ClientAcct, Currency)
– TraderPosition table is the mos interesting. Even though there could be a small number of trader accounts, I was told it’s unlikely that system maintains a separate table for each account. Primary key would be (TraderAcct, Currency). In cash trading, most positions are flat i.e. closed out quickly, so there should be relatively few rows in this table. However, if base currency is USD, then a particular trader’s JPY row would get a lot of concurrent updates. Since this row represents real inventory, all updates must follow strict ACID transaction rule. Possibly a bottleneck just like in bond trading.

Q: Any reference data tables

CurrencyPairDescription
CounterPartyAccount
ClientAccount
TraderAccount
FeedSource ??