I will join all of the other bloggers out there and put in my two cents about Bill Gates.
I had my first and only brush with Gates back in 1991 or 1992. I was a contributing editor for Microsoft Systems Journal back in the old days. One day, I get a call from my editor. He tells me that Bill Gates is stopping in New York for a night, on his way back to Seattle from a European trip. He wanted to have dinner with the MSJ contributing editors to tell them about some exciting stuff in the industry. Would I be interested?
We all met at a Japanese hotel on Park Ave at 32nd St. This hotel had a beautiful restaurant, and Gates, being a sushi fanatic, reserved a tatani room for us.
We all get there at 8PM, and then in walks Gates, followed by his flack, Jon Lazarus (who used to be the publisher of MSJ). In attendance was myself, Ross Greenburg (author of RamNet, and later, some virus-checking program), Greg Comeau (author of Comeau C++), Charles Petzold (author of a book), and Tony Rizzo (my editor).
Gates turned out to be a great guy, despite the constant leg movements under the table. Very personable. He spent most of the night talking about getting Dave Cutler from DEC, and the new operating system he was working on (Windows NT). Every word was preceeded by a stern warning from Lazarus never to repeat what was said.
Of course, the very next week, PC Week featured a big story on Cutler and NT!!!
©2006 Marc Adler - All Rights Reserved
Friday, June 16, 2006
Sunday, June 11, 2006
Thursday, June 01, 2006
Housing Price Futures
I heard about this on NPR radio the other day ... A great way of hedging a housing market. If you are buying now, and are afraid that the housing market might fall through the floor in your town, then you can short the housing future. If you think that your area might see an uptick in housing, then long the future.
(from a CBS Marketwatch article)
The Chicago Merc introduced cash-settled futures and options based on housing markets in Boston, Chicago, Denver, Las Vegas, Los Angeles, Miami, New York, San Diego, San Francisco and Washington, as well as a weighted composite index.
The contracts are priced by multiplying the index value by $250; the average contract size for the various cities is roughly $55,000, although they vary by region, according to Sayee Srinivasan, associate director of research and product development at the CME. He said the exchange is considering adding contracts for other booming real-estate markets such as Phoenix and Orlando.
"The futures markets like volatility, so the contracts based on the most volatile housing markets might see the most volume," Srinivasan said.
For each region, there are four contracts, which expire on a quarterly basis, so there are currently contracts for August 2006, November 2006, February 2007 and May 2007.
Although the contracts have only been trading for a very short period, most of the interest is looking further out on the curve with the May 2007 contracts getting the most action initially, said Fritz Siebel, senior broker at Traditional Financial Services Inc.
There could be demand for longer-dated contracts, something the CME is considering if the existing contracts prove popular enough.
Siebel noted the early interest has been in derivatives based on hot West Coast markets in San Diego, Los Angeles and Las Vegas, and also Miami on the East Coast.
©2006 Marc Adler - All Rights Reserved
(from a CBS Marketwatch article)
The Chicago Merc introduced cash-settled futures and options based on housing markets in Boston, Chicago, Denver, Las Vegas, Los Angeles, Miami, New York, San Diego, San Francisco and Washington, as well as a weighted composite index.
The contracts are priced by multiplying the index value by $250; the average contract size for the various cities is roughly $55,000, although they vary by region, according to Sayee Srinivasan, associate director of research and product development at the CME. He said the exchange is considering adding contracts for other booming real-estate markets such as Phoenix and Orlando.
"The futures markets like volatility, so the contracts based on the most volatile housing markets might see the most volume," Srinivasan said.
For each region, there are four contracts, which expire on a quarterly basis, so there are currently contracts for August 2006, November 2006, February 2007 and May 2007.
Although the contracts have only been trading for a very short period, most of the interest is looking further out on the curve with the May 2007 contracts getting the most action initially, said Fritz Siebel, senior broker at Traditional Financial Services Inc.
There could be demand for longer-dated contracts, something the CME is considering if the existing contracts prove popular enough.
Siebel noted the early interest has been in derivatives based on hot West Coast markets in San Diego, Los Angeles and Las Vegas, and also Miami on the East Coast.
©2006 Marc Adler - All Rights Reserved
Wednesday, May 24, 2006
FX Settlements
The CLS website has a great picture on how settlements work for FX trades. Here it is:

CLS is a bank set up by a consortium of different financial firms. It what my client uses for settling their FX trades.
©2006 Marc Adler - All Rights Reserved

CLS is a bank set up by a consortium of different financial firms. It what my client uses for settling their FX trades.
©2006 Marc Adler - All Rights Reserved
Services for the Wall Street Stack
I have blogged before about the need for a standardized Wall Street Stack. At my current client, there are several different frameworks that have been built over the years, but no framework has gained enterprise-wide acceptance.
These are the services that are generally needed for a complete application framework. If you can think of any other, let me know.
Authentication - logging in to various databases, web servers, internal systems, etc. Best implemented through an enterprise-wide authentication service (using the user's Kerberos token, etc)
Authorization (Entitlements) - what actions can a user perform within an application and what data is a user entitled to see. Best accomplished through an enterprise-wide system.
Logging - log interesting things that happen in an application. Log4Net is a good framework.
User Preferences - load and save the state of the UI
User Data - each application may want to persist the last state of the application when the user logged off
Configuration - Each application should be configurable through a series of XMl files.
General Services Manager - drives the entire service locator framework
Applet Management - load applets from .NET assemblies
Internal Event Broker - lightweight communication between applets
Data and Persistence layer - ways to load, query, update and cache data. Should be configurable so that we can go through different transport layers
Service Agents - processed async notifications that come to us through subscriptions.
Shell - handles initialization of the application, calls all of the various services, provides presentation services for the applets
UI - menu manager, status bar manager, navbar manager, toolbar manager
Security/Cryptography - does the data need to be encrypted and decrypted? (passwords, sensitive data)
Exception Handling - provides a unified way of handling errors that occur in shell and the various applets
Threading - model for async processing
©2006 Marc Adler - All Rights Reserved
These are the services that are generally needed for a complete application framework. If you can think of any other, let me know.
Authentication - logging in to various databases, web servers, internal systems, etc. Best implemented through an enterprise-wide authentication service (using the user's Kerberos token, etc)
Authorization (Entitlements) - what actions can a user perform within an application and what data is a user entitled to see. Best accomplished through an enterprise-wide system.
Logging - log interesting things that happen in an application. Log4Net is a good framework.
User Preferences - load and save the state of the UI
User Data - each application may want to persist the last state of the application when the user logged off
Configuration - Each application should be configurable through a series of XMl files.
General Services Manager - drives the entire service locator framework
Applet Management - load applets from .NET assemblies
Internal Event Broker - lightweight communication between applets
Data and Persistence layer - ways to load, query, update and cache data. Should be configurable so that we can go through different transport layers
Service Agents - processed async notifications that come to us through subscriptions.
Shell - handles initialization of the application, calls all of the various services, provides presentation services for the applets
UI - menu manager, status bar manager, navbar manager, toolbar manager
Security/Cryptography - does the data need to be encrypted and decrypted? (passwords, sensitive data)
Exception Handling - provides a unified way of handling errors that occur in shell and the various applets
Threading - model for async processing
©2006 Marc Adler - All Rights Reserved
Universal DBs
Lately, I have been talking with IT directors at various financial firms. There seems to be one consistent message --- The holy grail that all of the financial firms are seeking is the universal database, where all trades across all asset classes can be held.
This is especially problematic at financial firms who keep buying other firms (Wachovia, Bank of America).
OLAP is a hot skill right now, and companies what to perform sophisticated queries over huge amounts of data. Finetix currently is working in the OLAP space int he commodities area of a major financial firm. This firm has asked Finetix to invent a cloning machine so we duplicate our 3 OLAP stars and sprinkle them throughout the firm. Maybe I should start attending Andrew Brust's presentations at the various .NET user groups.
©2006 Marc Adler - All Rights Reserved
This is especially problematic at financial firms who keep buying other firms (Wachovia, Bank of America).
OLAP is a hot skill right now, and companies what to perform sophisticated queries over huge amounts of data. Finetix currently is working in the OLAP space int he commodities area of a major financial firm. This firm has asked Finetix to invent a cloning machine so we duplicate our 3 OLAP stars and sprinkle them throughout the firm. Maybe I should start attending Andrew Brust's presentations at the various .NET user groups.
©2006 Marc Adler - All Rights Reserved
Sunday, May 14, 2006
How Do They Find Me?
I have been getting a bunch of calls from recruiters at my desk at my current client. I think that they know the telephone prefixes of the IT departments at the various Wall Street companies. The recruiters call every single number with that prefix in the middle of the night, and wait for the voice mail to kick in. So, they can get a name of a person at a desk at a Wall Street company.
The calls then come....
Recruiter : Hi Marc. I know someone who worked with you at your last company and they thought you were great.
Me (seeing the bullshit form a mile away) : That's fantastic! What company was that?
Recruiter : (sound of frantic typing in the background). Did you say that this was Marc Adler? Hmmm... it was ... XYZ.
Me : Who was the person that referred you?
Recruiter : Let me tell you about this position.
Me : (hangs up)
A recruiter's opening line says everything about his veracity and ethics. If a recruiter comes across like a telemarketer, I will not deal with him. A better line might be :
Recruiter : Hi Marc. I have been retained by Bank of America to hire a team that needs to build a credit derivatives system. Their platform will be a .NET front end, Java backend, wired together by Tibco EMS. Since you are working now for XYZ, and since I know that their credit derivatives systems use that precise technology, I was wondering if you or any of your teammates would be interesting in implementing a system like this over at BofA. Of course, the compensation would be above and beyond your current salary, which given your level, I could probably take a guess at.
Why is this good? I find out the name of the company who is hiring, and I already know that it's not with the company that I am currently with. (The worst thing is to find out that the job is for your position at your current company!). I see that the recruiter has taken the time to find out that I am with the credit derivs area, and has taken the time to know that my current client uses a particular technology. I see that the recruiter is aware of current salaries and could divine what it would take for an established player to move to another company.
I don't want to have to play games with a recruiter to find out about a position. Be straight, be honest. If I am truly interested in something, then I will not do an end-run around you.
Also, do you guys realize that, if you call me in the middle of the day, then the 5 people who sit around me usually hang on every word that I say on the phone?
©2006 Marc Adler - All Rights Reserved
The calls then come....
Recruiter : Hi Marc. I know someone who worked with you at your last company and they thought you were great.
Me (seeing the bullshit form a mile away) : That's fantastic! What company was that?
Recruiter : (sound of frantic typing in the background). Did you say that this was Marc Adler? Hmmm... it was ... XYZ.
Me : Who was the person that referred you?
Recruiter : Let me tell you about this position.
Me : (hangs up)
A recruiter's opening line says everything about his veracity and ethics. If a recruiter comes across like a telemarketer, I will not deal with him. A better line might be :
Recruiter : Hi Marc. I have been retained by Bank of America to hire a team that needs to build a credit derivatives system. Their platform will be a .NET front end, Java backend, wired together by Tibco EMS. Since you are working now for XYZ, and since I know that their credit derivatives systems use that precise technology, I was wondering if you or any of your teammates would be interesting in implementing a system like this over at BofA. Of course, the compensation would be above and beyond your current salary, which given your level, I could probably take a guess at.
Why is this good? I find out the name of the company who is hiring, and I already know that it's not with the company that I am currently with. (The worst thing is to find out that the job is for your position at your current company!). I see that the recruiter has taken the time to find out that I am with the credit derivs area, and has taken the time to know that my current client uses a particular technology. I see that the recruiter is aware of current salaries and could divine what it would take for an established player to move to another company.
I don't want to have to play games with a recruiter to find out about a position. Be straight, be honest. If I am truly interested in something, then I will not do an end-run around you.
Also, do you guys realize that, if you call me in the middle of the day, then the 5 people who sit around me usually hang on every word that I say on the phone?
©2006 Marc Adler - All Rights Reserved
Interesting Call From Microsoft Recruiting
It used to be where millions of applicants would send their resumes to Microsoft in hopes of a job. Howver, this is not your father's Microsoft anymore. The stock has been in the shitter for the past few years (I sold mine for a split-adjusted price of $30 in 2001, and the stock has never gotten higher), and the options program has been dessimated.
Somehow, a Microsoft recruiter got a hold of my name from some past colleague. There is a developer evangalist position open in the New York/New Jersey area. I happen to know the person who just left that position; he had been a familiar face at the various New Jersey .NET User Group meetings. This is not a bad position .... you get to go to companies and user groups around the NYC/NJ area and talk about the latest MS technologies from a developer perspective.
So, this recruiter kept calling and calling. I was not interested in the position at all, but I wanted to get another data point and hear what MS was offering senior-level architects and devs now. She would call me in the middle of the day, at my desk at my client, and I would patiently explain to her that I could not talk about a new job with 5 people sitting around me. She would make plans to call me in the evening, but then had to go pick up her kids somewhere, watch her neighbor's kids, etc. Always some excuse.
We finally managed to connect this week. She started to explain the job to me, but I told her that I was already very familiar with the responsibilities of the position. I told her to get down to brass tacks. What were they paying? I told her what my current base salary was so that we could start negotiating. My hopes would be that she could come close to the base,
She looked in her little black book, muttered to herself "hmmm... since this IS in the New York area, we have to give you a boost in the base", and came up with a number that is about 40% less than what I am making in base salary now.
To top it off, she then asked me why I would leave my current position for one that paid 40% less. This got me a bit steamed. I told her that:
a) It was YOU who have been persuing me, not the other way around. I never said anything about wanting to leave my current position.
b) I would NEVER leave for 40% less, unless it was topped off by outright stock grants that would raise my total comp to a figure that was way over the base (something that they will not guarantee for this position).
c) I told her that I was an avid reader of the Mini-Microsoft blog (she said something like "Oh No!"), and that under the current conditions at Microsoft, I don't think that I would be interested in subjecting myself to that type of lifestyle. In addition, I was not interested in interviewing with some 25-year old pisher who would be asking me logic questions like "How Do You Move Mount Fuji?".
She asked me if I had any colleagues who would be interested, whereby I replied that all of my colleagues who might be interested were making a lot more money than you just offered. I told her that I would never consider at MS until there was evidence of a complete culture change and/or there was sustained upwards movement in the stock price. I told her that she should study Mini-Microsoft very carefully, and note the exodus from her her company.
What an amazing turnaround for the prestige of Microsoft, a company that I used to admire. I consulted for MS for 3 years back from 198901992, writing the first front end for SQL Server. My former MS manager is a group VP, and is a millionaire many times over. But, I am afraid that most of the bright lights there have now been dimmed.
©2006 Marc Adler - All Rights Reserved
Somehow, a Microsoft recruiter got a hold of my name from some past colleague. There is a developer evangalist position open in the New York/New Jersey area. I happen to know the person who just left that position; he had been a familiar face at the various New Jersey .NET User Group meetings. This is not a bad position .... you get to go to companies and user groups around the NYC/NJ area and talk about the latest MS technologies from a developer perspective.
So, this recruiter kept calling and calling. I was not interested in the position at all, but I wanted to get another data point and hear what MS was offering senior-level architects and devs now. She would call me in the middle of the day, at my desk at my client, and I would patiently explain to her that I could not talk about a new job with 5 people sitting around me. She would make plans to call me in the evening, but then had to go pick up her kids somewhere, watch her neighbor's kids, etc. Always some excuse.
We finally managed to connect this week. She started to explain the job to me, but I told her that I was already very familiar with the responsibilities of the position. I told her to get down to brass tacks. What were they paying? I told her what my current base salary was so that we could start negotiating. My hopes would be that she could come close to the base,
She looked in her little black book, muttered to herself "hmmm... since this IS in the New York area, we have to give you a boost in the base", and came up with a number that is about 40% less than what I am making in base salary now.
To top it off, she then asked me why I would leave my current position for one that paid 40% less. This got me a bit steamed. I told her that:
a) It was YOU who have been persuing me, not the other way around. I never said anything about wanting to leave my current position.
b) I would NEVER leave for 40% less, unless it was topped off by outright stock grants that would raise my total comp to a figure that was way over the base (something that they will not guarantee for this position).
c) I told her that I was an avid reader of the Mini-Microsoft blog (she said something like "Oh No!"), and that under the current conditions at Microsoft, I don't think that I would be interested in subjecting myself to that type of lifestyle. In addition, I was not interested in interviewing with some 25-year old pisher who would be asking me logic questions like "How Do You Move Mount Fuji?".
She asked me if I had any colleagues who would be interested, whereby I replied that all of my colleagues who might be interested were making a lot more money than you just offered. I told her that I would never consider at MS until there was evidence of a complete culture change and/or there was sustained upwards movement in the stock price. I told her that she should study Mini-Microsoft very carefully, and note the exodus from her her company.
What an amazing turnaround for the prestige of Microsoft, a company that I used to admire. I consulted for MS for 3 years back from 198901992, writing the first front end for SQL Server. My former MS manager is a group VP, and is a millionaire many times over. But, I am afraid that most of the bright lights there have now been dimmed.
©2006 Marc Adler - All Rights Reserved
Monday, May 01, 2006
What I am doing now
At my new client, one of the Tier-1 IBs on Wall Street, I am now in charge of a FX Exception Processing System. What this system does is allow FX Operations to examine and fix any FX trades which did not go through for one reason or another.
The front end is all C#/.NET, communicating with a Java trade engine using both Web Services and a home-grown XML message broker. Sybase is the database, and from the backend, connectivity is to both CLS and to SWIFTNet.
The GUI uses the Infragistics toolset, and is very grid-intensive. The real-time element is not crucial, and the trade volume is light enough so that we do not have to consider switching to the SyncFusion grid right now.
Any FX Trade Events (in this system, notification of a broken trade is called an 'event') that occur are sent from the backend to our GUI using the message broker. All FX Trades are also sent to our GUI. If the trade that comes in matches a filter criteria that is set up in one of the grids, then the trade is updated (or, in some events, the trade is deleted from the grid).
As more and more groups come on line and use our system, we will be runing into scalability issues. For example, let's say that you have a grid open that is monitoring all trades that occur today. Let's also say that no filtering criteria is set up, other than the fact that you want to look at today's trades. This means that every new trade will be inserted into the top of the grid. This is OK for now, as the trade volume is relatively light. But, more groups have expressed using our GUI. We anticipate that, by the end of the year, we might experience 10x the volume we have now.
I am going to be writing some stress-testing tools that will help us analyze the possible impact of other groups using our system. More on this later.
©2006 Marc Adler - All Rights Reserved
The front end is all C#/.NET, communicating with a Java trade engine using both Web Services and a home-grown XML message broker. Sybase is the database, and from the backend, connectivity is to both CLS and to SWIFTNet.
The GUI uses the Infragistics toolset, and is very grid-intensive. The real-time element is not crucial, and the trade volume is light enough so that we do not have to consider switching to the SyncFusion grid right now.
Any FX Trade Events (in this system, notification of a broken trade is called an 'event') that occur are sent from the backend to our GUI using the message broker. All FX Trades are also sent to our GUI. If the trade that comes in matches a filter criteria that is set up in one of the grids, then the trade is updated (or, in some events, the trade is deleted from the grid).
As more and more groups come on line and use our system, we will be runing into scalability issues. For example, let's say that you have a grid open that is monitoring all trades that occur today. Let's also say that no filtering criteria is set up, other than the fact that you want to look at today's trades. This means that every new trade will be inserted into the top of the grid. This is OK for now, as the trade volume is relatively light. But, more groups have expressed using our GUI. We anticipate that, by the end of the year, we might experience 10x the volume we have now.
I am going to be writing some stress-testing tools that will help us analyze the possible impact of other groups using our system. More on this later.
©2006 Marc Adler - All Rights Reserved
Comings and Goings
In the United States, men are glued to their TV sets, watching the National Football League's annual college draft. This is the time when 26 football teams throw a ridiculous amount of money at elite college atheletes.
On Wall Street, the annual post-bonus dance is almost complete. As people received their bonus checks in February or March, news comes almost every day that this person or that person has departed for company X or Y. This has dessimated several's company's IT departments, as the one person who knows a certain application inside and out is suddenly no more .... and the mad scramble for talent starts anew as companies try to backfill these positions.
(Wall Street is very small ... never burn your bridges.)
Just like the NFL draft, those of us in Wall Street IT sit back and await news to see where our colleagues end up. Such is the situation with me. I sit back and monitor the blogs, anxiously waiting to see where Matt, Pin, and Deglan end up. Matt announced his resignation on his blog, and invited all comers to bid on his services. In his last blog post, he said that he had many offers from his blog readers. Whoever the lucky company is who ends up with Matt, it will be money well spent.
The bar has been raised slightly in terms of compensation packages for senior developers. On Wall Street, a total compensation package of slightly over $200K is becoming more common. The calls from headhunters are becoming more frantic, as Wall Street scrambles to fill positions of their dearly departed developers. The base salary seems to still be $150K, but on Wall Street, bonus is everything. Managing Directors typically make 200-300% in bonus. Developers are still in the 30-40% range in most companies,except for the premier companies, where your 18-hour days might get you upwards of 80%. But, as a colleague of mine told me recently, many a marriage has been sacrificed in exchange for that bonus.
©2006 Marc Adler - All Rights Reserved
On Wall Street, the annual post-bonus dance is almost complete. As people received their bonus checks in February or March, news comes almost every day that this person or that person has departed for company X or Y. This has dessimated several's company's IT departments, as the one person who knows a certain application inside and out is suddenly no more .... and the mad scramble for talent starts anew as companies try to backfill these positions.
(Wall Street is very small ... never burn your bridges.)
Just like the NFL draft, those of us in Wall Street IT sit back and await news to see where our colleagues end up. Such is the situation with me. I sit back and monitor the blogs, anxiously waiting to see where Matt, Pin, and Deglan end up. Matt announced his resignation on his blog, and invited all comers to bid on his services. In his last blog post, he said that he had many offers from his blog readers. Whoever the lucky company is who ends up with Matt, it will be money well spent.
The bar has been raised slightly in terms of compensation packages for senior developers. On Wall Street, a total compensation package of slightly over $200K is becoming more common. The calls from headhunters are becoming more frantic, as Wall Street scrambles to fill positions of their dearly departed developers. The base salary seems to still be $150K, but on Wall Street, bonus is everything. Managing Directors typically make 200-300% in bonus. Developers are still in the 30-40% range in most companies,except for the premier companies, where your 18-hour days might get you upwards of 80%. But, as a colleague of mine told me recently, many a marriage has been sacrificed in exchange for that bonus.
©2006 Marc Adler - All Rights Reserved
Saturday, April 29, 2006
College Admissions
I just returned from a trip to California with my son. We have just started to look at colleges for him. He is a junior in high school, but this is when kids start considering colleges seriously. We went to see U Cal at Berkeley, Stanford, and Pomona. All three very different colleges.
Warning to parents: good grades and good standardized test scores just don't cut it anymore. Stanford rejects an awful lot of kids who get 1600's on their SATs. All of the colleges want to see rigorous courses in high school, great grades, great SAT I and SAT II and AP/IB scores. But they also want students that are unique in some way. The essays that kids have to write for their college applications are extremely important.
It is not only amazing difficult to get into the top-tier schools. It is also getting increasing difficult to get into the upper-middle tier schools. Applications are skewed by professional college counselors who you can hire for $10,000 to $30,000 .... you wonder if a kid gets into a certain college because of his/her own worth, or because daddy's paycheck is fat enough to hire a pro.
Now, we have to capture the one big intangible that my son has into an essay .. the fact that he is a leader ... not in the academic sense (ie: he is not the editor of the school newspaper nor the quarterback of his school's football team) ... but the fact that he has packs of kids that follow him around, that kids are constantly calling him and messaging him, that he can snap his fingers and a whole cadre of students will appear to schlep his drumset from gig to gig. In other words, someone who has that special magnetism that command attention amongst his peers (think Tony Soprano).
I wonder if Stanford is interested in the future leader of La Cosa Nostra.....
(To the British readers here .. does the same thing apply to Oxford and Cambridge? Is most of the UK clamoring to get into these two schools?)
©2006 Marc Adler - All Rights Reserved
Warning to parents: good grades and good standardized test scores just don't cut it anymore. Stanford rejects an awful lot of kids who get 1600's on their SATs. All of the colleges want to see rigorous courses in high school, great grades, great SAT I and SAT II and AP/IB scores. But they also want students that are unique in some way. The essays that kids have to write for their college applications are extremely important.
It is not only amazing difficult to get into the top-tier schools. It is also getting increasing difficult to get into the upper-middle tier schools. Applications are skewed by professional college counselors who you can hire for $10,000 to $30,000 .... you wonder if a kid gets into a certain college because of his/her own worth, or because daddy's paycheck is fat enough to hire a pro.
Now, we have to capture the one big intangible that my son has into an essay .. the fact that he is a leader ... not in the academic sense (ie: he is not the editor of the school newspaper nor the quarterback of his school's football team) ... but the fact that he has packs of kids that follow him around, that kids are constantly calling him and messaging him, that he can snap his fingers and a whole cadre of students will appear to schlep his drumset from gig to gig. In other words, someone who has that special magnetism that command attention amongst his peers (think Tony Soprano).
I wonder if Stanford is interested in the future leader of La Cosa Nostra.....
(To the British readers here .. does the same thing apply to Oxford and Cambridge? Is most of the UK clamoring to get into these two schools?)
©2006 Marc Adler - All Rights Reserved
Event Manager Code - Possible Enhancements
Now that I have posted the code for the Event Manager that I have used in several projects, I would like to list some possible enhancements that I have considered:
Precompile regular expressions
The Event Manager supports wildcards. The .NET RegularExpression classes are used to perform matching of a published topic with a wildcarded subscription. Howver, I do not pre-compile the regexps. This is a very simple change to make.
Enhanced regular expressions
We can expand the regular expressions that wildcarded subscriptions will accept. For example, to subscribe to an insert or delete action for a trade, we should be able to have a wildcard topic that looks like this:
Magmasystems.TradingSystem.Trade.[InsertedDeleted]
Stronger typing of args for event declarations
The third argument of EventManager.Fire() is anything that derives from EventManagerArgs. We can add more type safety by specifying the subclass of EventManagerArgs that a publisher expects to send and that the corresponding subscribers expect to receive.
Scoping
Microsoft's CAB has the notion of event scoping. We can limit a published event to subscribers that run in the same thread (or a certain thread) as the publisher. We can limit the scope to a named "applet". Otherwise, by default, the event is published globally.
EventManager.Register(this)
I am not totally thrilled with the fact that, for every object that publishes or subscribes, a call to EventManager.Register(this) is called. The Register() function will examine the passed class, using reflection on the class to build up a dictionary of publishers and subscribers to a topic.
Dynamically register the publisher and subscriber
Instead of using the static way of decorating a method, we may want to add publications and subscriptions dynamically. For instance, we should be able to say something liek this:
EventManager.Subscribe("Magmasystems.TradingSystem.Trade.*", this.OnTradeEvent);
Sinks for event publishing
Implement Sinks so a class can have a crack at an event args before it is sent to the subscribers.
©2006 Marc Adler - All Rights Reserved
Precompile regular expressions
The Event Manager supports wildcards. The .NET RegularExpression classes are used to perform matching of a published topic with a wildcarded subscription. Howver, I do not pre-compile the regexps. This is a very simple change to make.
Enhanced regular expressions
We can expand the regular expressions that wildcarded subscriptions will accept. For example, to subscribe to an insert or delete action for a trade, we should be able to have a wildcard topic that looks like this:
Magmasystems.TradingSystem.Trade.[InsertedDeleted]
Stronger typing of args for event declarations
The third argument of EventManager.Fire() is anything that derives from EventManagerArgs. We can add more type safety by specifying the subclass of EventManagerArgs that a publisher expects to send and that the corresponding subscribers expect to receive.
Scoping
Microsoft's CAB has the notion of event scoping. We can limit a published event to subscribers that run in the same thread (or a certain thread) as the publisher. We can limit the scope to a named "applet". Otherwise, by default, the event is published globally.
EventManager.Register(this)
I am not totally thrilled with the fact that, for every object that publishes or subscribes, a call to EventManager.Register(this) is called. The Register() function will examine the passed class, using reflection on the class to build up a dictionary of publishers and subscribers to a topic.
Dynamically register the publisher and subscriber
Instead of using the static way of decorating a method, we may want to add publications and subscriptions dynamically. For instance, we should be able to say something liek this:
EventManager.Subscribe("Magmasystems.TradingSystem.Trade.*", this.OnTradeEvent);
Sinks for event publishing
Implement Sinks so a class can have a crack at an event args before it is sent to the subscribers.
©2006 Marc Adler - All Rights Reserved
Friday, April 28, 2006
Event Manager Code - EventManager.cs
Here is the code for the main EventManager class.
There are a number of ways that I would like to improve the code, but just never have had the time. When I get a few free moments, I will discuss some of the enhancements that I would like to put in the code eventually.
©2006 Marc Adler - All Rights Reserved
There are a number of ways that I would like to improve the code, but just never have had the time. When I get a few free moments, I will discuss some of the enhancements that I would like to put in the code eventually.
// for MethodImplAttrbute
using System;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
// for ISynchronizer
// --------------------------------------------------------------------
//
// This code is (C) Copyright 2005 Marc Adler
//
// --------------------------------------------------------------------
namespace Magmasystems.EventManager
{
public delegate bool EventManagerEventHandler(object sender, string topicName, EventArgs e);
public class EventManager
{
#region Delegates
// Internal delegate used to help us fire async events
private delegate void AsyncFire(Delegate del, object[] args);
#endregion
#region Variables
// The singleton EventManager
private static EventBroker _theEventManager = null;
// A Dictionary of EventManagerEventInfo classes, indexed by the topic name
private Hashtable _theEventDictionary = null;
private Hashtable _theWildcardSubscribers = null;
// Used to disabled and re-enable the firing of events
private bool _isEnabled = true;
#endregion
#region Constructors and Static Instance
protected EventBroker()
{
}
// This is the way that the EventManager singleton is accessed
static public EventManager Instance
{
get
{
if(_theEventManager == null)
{
_theEventManager = new EventBroker();
_theEventManager._theEventDictionary = new Hashtable();
_theEventManager._theWildcardSubscribers = new Hashtable();
_theEventManager._isEnabled = true;
}
return _theEventManager;
}
}
#endregion
#region Properties
private Hashtable Dictionary
{
get
{
// make sure that the dictionary and event manager are instantiated
return _theEventDictionary;
}
}
private Hashtable WildcardDictionary
{
get
{
// make sure that the dictionary and event manager are instantiated
return _theWildcardSubscribers;
}
}
public bool Enabled
{
get { return this._isEnabled; }
set { this._isEnabled = value; }
}
#endregion
#region General Methods
static public void Register(object o)
{
Type type = o.GetType();
MethodInfo[] methods = type.GetMethods();
foreach (MethodInfo mi in methods)
{
// if(mi.DeclaringType != type)
// continue;
object[] oAttrs = mi.GetCustomAttributes(true);
foreach (object oAttr in oAttrs)
{
EventManagerEventInfo evInfo;
if(oAttr is EventSubscriberAttribute)
{
EventSubscriberAttribute evSubAttr = oAttr as EventSubscriberAttribute;
evInfo = FindTopicEntry(evSubAttr.Topic, true);
if(evInfo != null)
{
EventSubscriberInfo subInfo = evInfo.AddSubscriber(evSubAttr.Topic, o, evSubAttr.IsBackground, mi);
if(subInfo.HasWildcards)
{
EventBroker.Instance._theWildcardSubscribers[evSubAttr.Topic] = evInfo;
}
}
}
else if(oAttr is EventPublisherAttribute)
{
EventPublisherAttribute evPubAttr = oAttr as EventPublisherAttribute;
evInfo = FindTopicEntry(evPubAttr.Topic, true);
if(evInfo != null)
{
evInfo.AddPublisher(evPubAttr.Topic, o);
}
}
}
}
}
static private EventManagerEventInfo FindTopicEntry(string topicName, bool createIfEmpty)
{
EventManagerEventInfo evInfo ;
topicName = topicName.ToUpper();
object oEventInfo = EventBroker.Instance._theEventDictionary[topicName];
if(oEventInfo == null)
{
if(createIfEmpty)
{
// Allocate a new entry
evInfo = new EventManagerEventInfo();
EventBroker.Instance.Dictionary[topicName] = evInfo;
}
else
{
evInfo = null;
}
}
else
{
// Use the existing entry
evInfo = oEventInfo as EventManagerEventInfo;
}
return evInfo;
}
#endregion
#region Ways to Fire and Event
[MethodImpl(MethodImplOptions.NoInlining)]
static public void Fire(object sender, string topicName, EventArgs args)
{
if (EventBroker.Instance.Enabled == false)
return;
EventManagerEventInfo evInfo = FindTopicEntry(topicName, false);
if(evInfo != null)
{
evInfo.Fire(sender, topicName, args);
}
foreach (object oKey in EventBroker.Instance._theWildcardSubscribers.Keys)
{
string keyName = oKey as String;
Regex regExp = new Regex(keyName, RegexOptions.IgnoreCase);
if(regExp.IsMatch(topicName))
{
evInfo = EventBroker.Instance._theWildcardSubscribers[oKey] as EventManagerEventInfo;
evInfo.Fire(sender, topicName, args);
}
}
}
#endregion
#region Inner Class for EventManagerEventInfo
///
/// EventManagerEventInfo
/// This class represents information about a single event
///
public class EventManagerEventInfo
{
#region Variables
// Multicast delegate of all subcribers to this event
private event EventManagerEventHandler _eventHandler;
// The list of classes that publish this event
private ArrayList _publishers;
// The list of classes that subscribe to this event
private ArrayList _subscribers;
#endregion
#region Constructors
public EventManagerEventInfo()
{
this._publishers = new ArrayList();
this._subscribers = new ArrayList();
this._eventHandler = null;
}
#endregion
#region Events
public event EventManagerEventHandler EventManagerEvent
{
add { this._eventHandler += value; }
remove { this._eventHandler -= value; }
}
#endregion
#region Properties
public EventManagerEventHandler EventHandler
{
get { return this._eventHandler; }
}
public ArrayList Publishers
{
get { return this._publishers; }
}
public ArrayList Subscribers
{
get { return this._subscribers; }
}
#endregion
#region Methods
public EventSubscriberInfo AddSubscriber(string topicName, object objectRef, bool isBackground, MethodInfo mi)
{
EventSubscriberInfo subInfo = new EventSubscriberInfo(this, topicName, objectRef, isBackground, mi);
this._eventHandler += new EventManagerEventHandler(subInfo.OnPublisherFired);
this.Subscribers.Add(subInfo);
return subInfo;
}
public EventPublisherInfo AddPublisher(string topicName, object objectRef)
{
EventPublisherInfo pubInfo = new EventPublisherInfo(this, topicName, objectRef);
this.Publishers.Add(pubInfo);
return pubInfo;
}
public void RemoveSubscriber(EventSubscriberInfo sub)
{
this.Subscribers.Remove(sub);
}
public void RemovePublisher(EventPublisherInfo pub)
{
this.Publishers.Remove(pub);
}
#endregion
#region Event Firing
public void Fire(object sender, string topicName, EventArgs args)
{
// This handles the event firing to the SubscriberInfo class. In turn, the
// SubscriberInfo object will invoke the actual delegate. The SubscriberInfo
// object will determine whether the delegate shoul dbe called synchronously
// or asynchronously.
if(this.EventHandler != null)
{
this.EventHandler(sender, topicName, args);
}
}
#endregion
}
#endregion
#region Inner class for EventPublisherInfo
public class EventPublisherInfo
{
#region Variables
private EventManagerEventInfo _evInfo;
private WeakReference _objectRef;
private string _topicName; // the upper-cased name
private string _displayName; // used to generate context menus at runtime
#endregion
#region Constructors
private EventPublisherInfo()
{
this._objectRef = null;
}
public EventPublisherInfo(EventManagerEventInfo evInfo, string topicName) : this()
{
this._evInfo = evInfo;
this.DisplayName = topicName;
this._topicName = topicName.ToUpper();
}
public EventPublisherInfo(EventManagerEventInfo evInfo, string topicName, object objectRef) : this(evInfo, topicName)
{
this._objectRef = new WeakReference(objectRef);
}
#endregion
#region Properties
public WeakReference Publisher
{
get { return (this._objectRef.IsAlive == true) ? this._objectRef : null; }
set { this._objectRef = value; }
}
public string DisplayName
{
get { return this._displayName; }
set { this._displayName = value; }
}
#endregion
}
#endregion
#region Inner class for EventSubscriberInfo
public class EventSubscriberInfo
{
#region Variables
private EventManagerEventInfo _eventInfo; // ref back to the holding container
private WeakReference _objectRef;
private MethodInfo _methodInfo; // The method that the event firer should Invoke
private bool _isBackground;
private EventManagerEventHandler _delegateForAsync;
private string _topicName; // we may have wildcards
private bool _hasWildcards; // to help determine whether to use RegEx or not
#endregion
#region Constructors
private EventSubscriberInfo()
{
this._objectRef = null;
this._isBackground = false;
this._hasWildcards = false;
}
public EventSubscriberInfo(EventManagerEventInfo evInfo, string topicName) : this()
{
this._eventInfo = evInfo;
this.TopicName = topicName; // use the property so that formatting is done
}
public EventSubscriberInfo(EventManagerEventInfo evInfo, string topicName, object objectRef) : this(evInfo, topicName)
{
this._objectRef = new WeakReference(objectRef);
}
public EventSubscriberInfo(EventManagerEventInfo evInfo, string topicName, object objectRef, bool isBackground, MethodInfo mi) : this(evInfo, topicName, objectRef)
{
this._isBackground = isBackground;
this._methodInfo = mi;
if(isBackground)
{
this._delegateForAsync = (EventManagerEventHandler) Delegate.CreateDelegate(typeof (EventManagerEventHandler), objectRef, mi.Name);
}
}
#endregion
#region Properties
public object Subscriber
{
get { return (this._objectRef.IsAlive) ? this._objectRef.Target : null; }
}
public bool IsBackground
{
get { return this._isBackground; }
set { this._isBackground = value; }
}
public string TopicName
{
get { return this._topicName; }
set { this._topicName = FormatTopicName(value); }
}
public bool HasWildcards
{
get { return this._hasWildcards; }
}
#endregion
#region Methods
private string FormatTopicName(string topic)
{
// We want to make things easy for matching publishers and sunscribers.
// 1) We always use upper-case topic names.
// 2) Replace the dots with slashes so that the dot is not taken as a regexp
// character by the pattern matcher.
// 3) Let us know whether this topic has a wildcard in it so we know whether
// to use the slow regexp matcher or the faster Equals operator.
if(topic.IndexOfAny(new char[] {'*'}) >= 0)
this._hasWildcards = true;
return topic.Replace('.', '/').ToUpper();
}
#endregion
#region Event Firing
///
/// This gets called whenever the event manager fires an event.
/// This does the hard work in event firing. It eventually calls
/// the subscriber's delegate in order to process the event. it also determines
/// whether the delegate should be called synchronously or asynchronously.
///
///
///
///
///
//
public bool OnPublisherFired(object sender, string topicName, EventArgs args)
{
// If the object that this subscriber is bound to has been garbage-collected, then
// remove the subscriber from the EventInfo's subscriber list and return.
if(this.Subscriber == null)
{
this._eventInfo.RemoveSubscriber(this);
return true;
}
if(this.IsBackground)
{
AsyncFire asyncFire = new AsyncFire(InvokeDelegate);
asyncFire.BeginInvoke(this._delegateForAsync, new object[] {sender, topicName, args}, new AsyncCallback(Cleanup), null);
}
else
{
object oRet = this._methodInfo.Invoke(this.Subscriber, new object[] {sender, topicName, args});
if(oRet is Boolean)
return (bool) oRet;
}
return true;
}
private void InvokeDelegate(Delegate del, object[] args)
{
ISynchronizeInvoke synchronizer = del.Target as ISynchronizeInvoke;
if(synchronizer != null) // Requires thread affinity
{
if(synchronizer.InvokeRequired)
{
synchronizer.Invoke(del, args);
return;
}
}
// Not requiring thread afinity or invoke is not required
del.DynamicInvoke(args);
}
private void Cleanup(IAsyncResult asyncResult)
{
asyncResult.AsyncWaitHandle.Close();
}
#endregion
}
#endregion
}
}
©2006 Marc Adler - All Rights Reserved
Event Manager Code - EventManagerArgs.cs
These are two minor argument classes that are used to send information from the event publisher to the subscriber. The args are sent as the third parameter in the EventManager.Fire() function.
©2006 Marc Adler - All Rights Reserved
using System;
namespace Magmasystems.EventManager
{
///
/// Summary description for EventManagerArgs.
///
public class EventManagerArgs : EventArgs
{
public EventManagerArgs()
{
}
}
// This is used to pass string data between the publisher and subscriber
public class EventManagerMessageArgs : EventManagerArgs
{
private string _message;
public EventManagerMessageArgs(string msg)
{
this._message = msg;
}
public string Message
{
get { return this._message; }
}
}
}
©2006 Marc Adler - All Rights Reserved
Event Manager Code - EventSubscriberAttribute.cs
The EventSubscriberAttribute is used to decorate a C# function that is the recipient of a subscribed event from our event manager. The topic name can be a wildcard string, just like Tibco. For instance, to subscribe to all actions that happen to a trade, you can subscribe to topic "TradingSystem.Trade.*".
Notice that the attribute is declared with AllowMultiple=true. This lets a function have multiple subscription declarations.
The final thing to notice is the IsBackground flag. If a subscriber is declared with IsBackground=true, then the event will be dispatched to the subscriber on a worker thread (internally, Begin/EndInvoke is used).
Here is the code:
©2006 Marc Adler - All Rights Reserved
Notice that the attribute is declared with AllowMultiple=true. This lets a function have multiple subscription declarations.
The final thing to notice is the IsBackground flag. If a subscriber is declared with IsBackground=true, then the event will be dispatched to the subscriber on a worker thread (internally, Begin/EndInvoke is used).
Here is the code:
using System;
// --------------------------------------------------------------------
//
// This code is (C) Copyright 2005 Marc Adler
//
// --------------------------------------------------------------------
namespace Magmasystems.EventManager
{
///
/// EventSubscriberAttribute
///
[AttributeUsage(AttributeTargets.Method, AllowMultiple=true)]
public class EventSubscriberAttribute : System.Attribute
{
private string _topicName;
private bool _isBackground;
public EventSubscriberAttribute()
{
}
///
/// EventSubscriberAttribute
///
/// The name of the event
public EventSubscriberAttribute(string topicName)
{
this._topicName = topicName;
this._isBackground = false;
}
public string Topic
{
get
{
return this._topicName;
}
set
{
this._topicName = value;
}
}
public bool IsBackground
{
get
{
return this._isBackground;
}
set
{
this._isBackground = value;
}
}
}
}
©2006 Marc Adler - All Rights Reserved
Event Manager Code - EventPublisherAttribute.cs
The EventPublisherAttribute is a C# attribute that decorates a function that publishes an internal event. Any function that publishes an event out to our little event broker should decorate itself with this attribute.For example:
Here is the code:
©2006 Marc Adler - All Rights Reserved
[EventPublisher("Brokerage.TradingSystem.Trade.ReceivedFromBackend")]
public void OnTradeReceived(Trade trade)
{
.......
EventManager.Fire(this, "Brokerage.TradingSystem.Trade.ReceivedFromBackend",
tradeArgs);
}
Here is the code:
using System;
// --------------------------------------------------------------------
//
// This code is (C) Copyright 2005 Marc Adler
//
// --------------------------------------------------------------------
namespace Magmasystems.EventManager
{
///
/// EventPublisherAttribute
///
public class EventPublisherAttribute : Attribute
{
private string _topicName;
public EventPublisherAttribute()
{
}
///
/// EventPublisherAttribute
///
/// The name of the event
public EventPublisherAttribute(string topicName)
{
this._topicName = topicName;
}
public string Topic
{
get
{
return this._topicName;
}
set
{
this._topicName = value;
}
}
}
}
©2006 Marc Adler - All Rights Reserved
Thursday, April 27, 2006
A Lightweight IntraApp Event Broker for C#/.NET
Over the years, I have managed to write a repository of interesting classes that has helped me in architecting and developing systems. Over the coming months, and as time allows, I will submit some of these classes for your use.
I wrote the EventBroker about two years ago for a trading system that had Tibco connectivity to a message bus that published quotes. I wanted a symmetrical processing model from the back end to the front end, and also, within the front end. So, I wrote a .NET/C#-based lightweight event broker that was like a min-Tibco within the GUI.
The Microsoft CAB has something similar, and when it came out, I took a few ideas from it (such as the handling of WeakReferences) and integrated it into my own Event Broker. CAB differs from mine in several respects .... namely, it has the concept of Event Scope, and it also has a different way of decorating code (it decorates event declarations, while mine decorates methods).
However, this event broker has been used in several trading systems and seems to function well.
In the next several posts, I will post the code of the Event Broker. You are free to use it as long as my copyright is maintained and proper acknowledgement is given. Also, I am anxious to hear of any improvments, enhancements and bug fixes you might make to any of the classes that I publish here. You can always reach me at magmasystems at yahoo dot com.
The Event Broker
The application uses a lightweight Publish/Subscribe (PubSub) model internally in order to notify the controller or UI layer of interesting events. A typical interesting event is a change in the underlying data model.
The mechanism that implements PubSub within the application is called the Event Broker. Event publishers and event subscribers will be automatically registered with the Event Manager by the use of customized .NET attributes.
The use of the Event Manager in no way precludes the application from doing its own event management using the standard .NET event/delegate mechanism.
Using the EventBroker in a class
Any class that wants to use the Pub/Sub capabilities of the EventBroker should do two thing.
1) Include a reference to the EventBroker's assembly. Also, reference the namespace within your class:
using Magmasystems.TradingSystem.EventManager;
2) Register the class with the EventBroker. A good place to do this is in the class' constructor. To register the class with the Event Broker, all that needs to be done is to put in the following line of code:
EventBroker.Register(this);
There are several .NET attributes that can be used to decorate functions in order to define them as either Event Publishers or Event Subscribers. When one of these attributes is constructed, the EventTopic parameter is examined. The EventTopic is added to the EventManager's internal Dictionary. A Dictionary collection is used in order to provide fast access to a particular Topic/Event pairing.
[EventPublisher(string EventTopic)]
This registers a function or class to be an event publisher. The class will publish an event with a specific name. Any subscribers to that topic will be notified.
[EventSubscriber(string EventTopic, options)]
This registers a subscriber to an event. The attribute should be placed directly above the function that will be used as the event handler. The options can be one of the following:
* Background - the handler is called asynchronously
The string-based topic name can be the actual name of a published topic, or it can be a wildcarded topic like "Magmasystems.TradingSystem.Trade.*".
To fire an event, the static method EventManager.Fire() is called
EventManager.Fire(object obj, string eventTopic, EventArgs args);
Event handlers have the signature:
public delegate bool EventManagerEventHandler(object sender,
string topicName, EventArgs e);
Here is a piece of code that publishes an event (The recipient could be a controller that processes events from views and from the models):
[EventPublisher("Magmasystems.TradingSystem.Controller.Action.GetTrades")]
private void GetTrades()
{
GetTradeArgs args = new GetTradeArgs();
args.CUSIP = "12345";
EventBroker.Fire(this, "Barcap.Gcdit.Odc.Controller.Action.GetTrades", args);
}
Here is a piece of code from a controller that subscribes to an event
[EventSubscriber("Magmasystems.TradingSystem.Controller.Action.GetTrades")]
public void GetTrades(object sender, string topicName, System.EventArgs e)
{
GetTradesUnitOfWork.GetTradesArgs args = e as GetTradesUnitOfWork.GetTradesArgs;
if (e == null)
return;
ExecuteAction(new GetTradesUnitOfWork(this._context.UIApplicationContext, args));
}
There is a .Net event associated with every topic that is registered. Events are really Multicast Delegates. Every subscriber to an event adds an event handler to the list of delegates. When an event is fired, the delegate list is traversed and each delegate will be invoked either synchronously or asynchronously. The options can include the Background flag. This tells the event firing mechanism that the underlying delegate should be invoked asynchronously. If the Background flag is not present in the attribute declaration, then the underlying delegate will be invoked synchronously.
Guidelines for Usage
Any class can publish an event, and any class can subscribe to that event. The event bus is global to the entire application.
The line of code that registers a class with the EventBroker is best put in the constructor of the Base Class.
Following our adoption of a namespace convention, we have also adopted a general naming convention for events. This convention is:
companyname.department.application.domainobject.action
©2006 Marc Adler - All Rights Reserved
I wrote the EventBroker about two years ago for a trading system that had Tibco connectivity to a message bus that published quotes. I wanted a symmetrical processing model from the back end to the front end, and also, within the front end. So, I wrote a .NET/C#-based lightweight event broker that was like a min-Tibco within the GUI.
The Microsoft CAB has something similar, and when it came out, I took a few ideas from it (such as the handling of WeakReferences) and integrated it into my own Event Broker. CAB differs from mine in several respects .... namely, it has the concept of Event Scope, and it also has a different way of decorating code (it decorates event declarations, while mine decorates methods).
However, this event broker has been used in several trading systems and seems to function well.
In the next several posts, I will post the code of the Event Broker. You are free to use it as long as my copyright is maintained and proper acknowledgement is given. Also, I am anxious to hear of any improvments, enhancements and bug fixes you might make to any of the classes that I publish here. You can always reach me at magmasystems at yahoo dot com.
The Event Broker
The application uses a lightweight Publish/Subscribe (PubSub) model internally in order to notify the controller or UI layer of interesting events. A typical interesting event is a change in the underlying data model.
The mechanism that implements PubSub within the application is called the Event Broker. Event publishers and event subscribers will be automatically registered with the Event Manager by the use of customized .NET attributes.
The use of the Event Manager in no way precludes the application from doing its own event management using the standard .NET event/delegate mechanism.
Using the EventBroker in a class
Any class that wants to use the Pub/Sub capabilities of the EventBroker should do two thing.
1) Include a reference to the EventBroker's assembly. Also, reference the namespace within your class:
using Magmasystems.TradingSystem.EventManager;
2) Register the class with the EventBroker. A good place to do this is in the class' constructor. To register the class with the Event Broker, all that needs to be done is to put in the following line of code:
EventBroker.Register(this);
There are several .NET attributes that can be used to decorate functions in order to define them as either Event Publishers or Event Subscribers. When one of these attributes is constructed, the EventTopic parameter is examined. The EventTopic is added to the EventManager's internal Dictionary. A Dictionary collection is used in order to provide fast access to a particular Topic/Event pairing.
[EventPublisher(string EventTopic)]
This registers a function or class to be an event publisher. The class will publish an event with a specific name. Any subscribers to that topic will be notified.
[EventSubscriber(string EventTopic, options)]
This registers a subscriber to an event. The attribute should be placed directly above the function that will be used as the event handler. The options can be one of the following:
* Background - the handler is called asynchronously
The string-based topic name can be the actual name of a published topic, or it can be a wildcarded topic like "Magmasystems.TradingSystem.Trade.*".
To fire an event, the static method EventManager.Fire() is called
EventManager.Fire(object obj, string eventTopic, EventArgs args);
Event handlers have the signature:
public delegate bool EventManagerEventHandler(object sender,
string topicName, EventArgs e);
Here is a piece of code that publishes an event (The recipient could be a controller that processes events from views and from the models):
[EventPublisher("Magmasystems.TradingSystem.Controller.Action.GetTrades")]
private void GetTrades()
{
GetTradeArgs args = new GetTradeArgs();
args.CUSIP = "12345";
EventBroker.Fire(this, "Barcap.Gcdit.Odc.Controller.Action.GetTrades", args);
}
Here is a piece of code from a controller that subscribes to an event
[EventSubscriber("Magmasystems.TradingSystem.Controller.Action.GetTrades")]
public void GetTrades(object sender, string topicName, System.EventArgs e)
{
GetTradesUnitOfWork.GetTradesArgs args = e as GetTradesUnitOfWork.GetTradesArgs;
if (e == null)
return;
ExecuteAction(new GetTradesUnitOfWork(this._context.UIApplicationContext, args));
}
There is a .Net event associated with every topic that is registered. Events are really Multicast Delegates. Every subscriber to an event adds an event handler to the list of delegates. When an event is fired, the delegate list is traversed and each delegate will be invoked either synchronously or asynchronously. The options can include the Background flag. This tells the event firing mechanism that the underlying delegate should be invoked asynchronously. If the Background flag is not present in the attribute declaration, then the underlying delegate will be invoked synchronously.
Guidelines for Usage
Any class can publish an event, and any class can subscribe to that event. The event bus is global to the entire application.
The line of code that registers a class with the EventBroker is best put in the constructor of the Base Class.
Following our adoption of a namespace convention, we have also adopted a general naming convention for events. This convention is:
companyname.department.application.domainobject.action
©2006 Marc Adler - All Rights Reserved
Friday, April 14, 2006
Note To Self - Traversing Rows in a Single Band
I am not really a hardcore Infragistics person. I find it amazing that some of the features that I consider essential in their UltraWEBGrid offering are not found in their UltraWINGrid product.
I am writing a prototype of an app that has multiple levels of grouping. I need to be able to double-click on the column header of a band, and have it do something to only the rows in that band. For instance, if the user double-clicks on the column that says 'Selected', then I want every checkbox in that group to be toggled without affecting the rows in any other group.

Sounds easy, right? Find out which header you double-clicked on, and then get the child rows that are associated with that header. The problem is that headers are not considered true rows within UltraWinGrid. They are "UI Elements". They do not have references to the rows that are directly beneath them.
After a while of messing around with the HeaderDoubleClicked event, I finally decided to base my procesing off of the MouseDoubleClick event.
Here is what I finally came up with after a few hours of tinkering around. (By the way, the function 'ToggleSelected' is a good way of walking down the entire tree of rows in a grouped grid.)
It works. The key was the UIElement.GetContext() function, which I finally found by reading a two sentence Knowledge Base article on the Infragistics website.
©2006 Marc Adler - All Rights Reserved
I am writing a prototype of an app that has multiple levels of grouping. I need to be able to double-click on the column header of a band, and have it do something to only the rows in that band. For instance, if the user double-clicks on the column that says 'Selected', then I want every checkbox in that group to be toggled without affecting the rows in any other group.

Sounds easy, right? Find out which header you double-clicked on, and then get the child rows that are associated with that header. The problem is that headers are not considered true rows within UltraWinGrid. They are "UI Elements". They do not have references to the rows that are directly beneath them.
After a while of messing around with the HeaderDoubleClicked event, I finally decided to base my procesing off of the MouseDoubleClick event.
Here is what I finally came up with after a few hours of tinkering around. (By the way, the function 'ToggleSelected' is a good way of walking down the entire tree of rows in a grouped grid.)
private UltraGridRow m_firstRowOfTheHeaderThatWasDoubleClickedOn = null;
private void dgTrades_MouseDoubleClick(object sender, MouseEventArgs e)
{
Infragistics.Win.UIElement element =
this.dgTrades.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
if (element != null)
{
this.CalcGridRowForDblClick(element);
if (element is Infragistics.Win.TextUIElement)
{
HeaderBase hdr = element.GetContext(typeof(HeaderBase)) as HeaderBase;
if (hdr != null)
this.dgTrades_DoubleClickHeader(hdr);
}
}
}
private void dgTrades_DoubleClickHeader(HeaderBase hdr)
{
if (hdr.Column.Key == "Selected")
{
if (this.m_firstRowOfTheHeaderThatWasDoubleClickedOn != null)
this.ToggleSelected(e.Header,
this.m_firstRowOfTheHeaderThatWasDoubleClickedOn);
}
this.m_firstRowOfTheHeaderThatWasDoubleClickedOn = null;
}
private void ToggleSelected(HeaderBase header, UltraGridRow row)
{
if (row == null)
return;
UltraGridBand band = header.Band;
UltraGridRow childRow = row.GetChild(ChildRow.First, band);
if (childRow == null)
{
// May be a leaf node
UltraGridColumn colSelected = band.Columns["Selected"];
if (colSelected == null)
return;
int idx = colSelected.Index;
for (; row != null; row = row.GetSibling(SiblingRow.Next, false))
{
row.Cells[idx].Value = !((bool)row.Cells[idx].Value);
}
}
else
{
// Is a non-leaf node
this.ToggleSelected(header, childRow);
this.ToggleSelected(header, row.GetSibling(SiblingRow.Next, false));
}
}
private UltraGridRow CalcGridRowForDblClick(Infragistics.Win.UIElement uiElement)
{
this.m_firstRowOfTheHeaderThatWasDoubleClickedOn = null;
if (uiElement == null)
return null;
object elementContext = uiElement.GetContext(typeof(UltraGridRow));
if (elementContext == null)
return null;
UltraGridRow row = elementContext as UltraGridRow;
if (row != null)
this.m_firstRowOfTheHeaderThatWasDoubleClickedOn = row;
return row;
}
It works. The key was the UIElement.GetContext() function, which I finally found by reading a two sentence Knowledge Base article on the Infragistics website.
©2006 Marc Adler - All Rights Reserved
Thursday, April 06, 2006
RIP: Doug Walker (Alien Planetscapes)
Doug Walker, long-time mainstay of the New York Spacerock scene and founder of the band Alien Planetscapes, passed away Tuesday April 4th at home. Doug had a heart condition for several years, and it finally caught up to him.
Doug was one of my oldest friends. I met Doug in 1975, and played in several seminal free-jazz bands with him in the mid to late 70's, including the great Third Sun.
Doug lost his wife Fran 2 years ago in a horrific car crash.
Doug leaves behind his son Evan, who was born three weeks after my own son.
God Bless You, Doug. Now you can jam with Robert Moog.

©2006 Marc Adler - All Rights Reserved
Doug was one of my oldest friends. I met Doug in 1975, and played in several seminal free-jazz bands with him in the mid to late 70's, including the great Third Sun.
Doug lost his wife Fran 2 years ago in a horrific car crash.
Doug leaves behind his son Evan, who was born three weeks after my own son.
God Bless You, Doug. Now you can jam with Robert Moog.

©2006 Marc Adler - All Rights Reserved
Friday, March 24, 2006
What is the World Coming To?
First I take a full-time job, then DonXML does!
http://donxml.com/allthingstechie/archive/2006/03/20/2609.aspx
Don and I are moving in parallel paths. We have both found small consulting companies that are staffed with people that we respect. We both feel, and been given the opportunities, to make a difference in our companies and to help grow the business.
From what I remember, Don does not like to cross the Hudson River, so I will leave him to the NJ Pharma companies while I go after the Financials!
©2006 Marc Adler - All Rights Reserved
http://donxml.com/allthingstechie/archive/2006/03/20/2609.aspx
Don and I are moving in parallel paths. We have both found small consulting companies that are staffed with people that we respect. We both feel, and been given the opportunities, to make a difference in our companies and to help grow the business.
From what I remember, Don does not like to cross the Hudson River, so I will leave him to the NJ Pharma companies while I go after the Financials!
©2006 Marc Adler - All Rights Reserved
Sunday, March 19, 2006
Rules of Engagement
My Expectations from a Client
My first engagement with Finetix has just ended, and it was an eye-opener in certain respects.
I have been thinking about what I would like to include in a retrospective to the client in order to help them manage future projects successfully. Instead of enumerating what I consider to be the positives and negatives of the project, I would like to add some of the aspects to my master “Lessons Learned” list, and also to reiterate some of my long-standing project-management processes.
1) Clearly Define Roles
2) Always Be Engaged
3) Make Sure Everyone Knows Everything
4) Define A Methodology And Stick To It
5) Have The Environment Completely Set Up
6) Have Documentation Ready
7) Engage the Business Analysts and Business Users
8) Do Not Pair-Program Unless Absolutely Necessary
9) Always Have a Roadmap For Refactoring
Clearly Define Roles
If you are bringing in consultants to lead the technical team, then tell your team members and enforce the leadership. If you are expecting your consultants to be short-term body-shoppers who are coding, then tell them this up front. Do not allow incorrect perceptions to pervade the group.
There will always be bruised feelings when you bring consultants on to a project in a leadership role. We consultants completely understand this. Nobody wants their work to be reevaluated and critiqued. If the consultants are being brought in to do rearchitecture, then they must be given the power to lead the effort.
Make it clear as to who holds the trump card.
Always Be Engaged
As a project manager, make sure that you know what all of your team members are doing, and make sure that all team members know what each other is doing. Make sure that the server side and client side teams communicate. Many server-side devs have also done GUI work and vice-versa.
If you have to support a legacy version of your product, then make sure that you are able to delegate that task to certain members of the team. Have a plan to get these “legacy developers” involved with the new development. The legacy devs are subject matter experts who are important to the whole team.
Make Sure Everyone Knows Everything
As mentioned above, do not isolate the groups. Involve the Business Analysts and Business Users where appropriate. Unless there are well-defined isolation layers, make sure that you try to completely define the communication layers and formats between the client and server. If the BA’s are planning something new, have them run it by the entire team so that the team can discuss the ramifications on the architecture.
Define A Methodology And Stick To It
If you are going to do Agile or Scrum, then stick to it. If you are going to do Waterfall, then stick to it. If you are going to decide on daily standups, then stick to it.
Have The Environment Completely Set Up
Consultants get paid a lot of money, and their efforts are usually time-boxed. So, make sure that they are productive from day one. Have all user accounts set up. Have all of the software ready. If this software requires additional registration, then make sure that this is done. Make sure that there are enough licenses for the software, and make sure that support packages have been purchased.
Make sure that the computers have enough memory and enough free disk space. Developers need about 2gb of RAM and about 100gb of free hard drive space. Make sure that certain shared drives can be accessed.
Make sure that the security people in the building know that a team is starting, and to expect them. If a consultant is made to wait in the lobby while security tries to track down someone to sign them in, then this serves nobody.
Have Documentation Ready
Does the system have documentation? Use cases? Architecture docs? If not, then either prepare them or prepare for a steeper learning process.
Engage the Business Analysts and Business Users
I have talked about this before. If you are writing a trading system, then the developers should be able to have access to the traders. The developers should be able to peek over a trader’s shoulder while he is working. The developers should have a complete feel for the kind of system that a trader would like to have.
If there are BAs that the developers must interact with, then make sure that the devs and BAs have constant interaction. Make sure that the BAs know if some of their ideas will be difficult to implement.
Do Not Pair-Program Unless Absolutely Necessary
I continue to abhor pair programming. I think that it cuts down productivity in a big way. I think that the best development is done when the developer is “in the zone”, and does not have to expend energy explaining every move to someone else.
Instead, have design meetings and developer meetings. It does not have to be “Big Design Up Front”. However, if a developer is architecting a crucial module, then let him present the design to the entire team and get critiques before the effort is too far gone.
Always Have a Roadmap For Refactoring
Do you know why a product is being refactored? Does the business absolutely need it? Do you really need to rewrite an entire application from scratch?
Remember that, when you refactor an application, you need a plan to retain all of the business logic that is built in to the existing app.
Make sure that the code has comments. Make sure that there is plenty of technical documentation. Make sure that all of the business rules are documented.
Make sure that all dead code has been eliminated from the application. It is difficult to rearchitect a system if the hands of 30 different people have been in it over the years.
These are my ideal Rules of Engagement for any project that I will be on, either as a leader or as a hired hand. I would love to hear your comments.
©2006 Marc Adler - All Rights Reserved
My first engagement with Finetix has just ended, and it was an eye-opener in certain respects.
I have been thinking about what I would like to include in a retrospective to the client in order to help them manage future projects successfully. Instead of enumerating what I consider to be the positives and negatives of the project, I would like to add some of the aspects to my master “Lessons Learned” list, and also to reiterate some of my long-standing project-management processes.
1) Clearly Define Roles
2) Always Be Engaged
3) Make Sure Everyone Knows Everything
4) Define A Methodology And Stick To It
5) Have The Environment Completely Set Up
6) Have Documentation Ready
7) Engage the Business Analysts and Business Users
8) Do Not Pair-Program Unless Absolutely Necessary
9) Always Have a Roadmap For Refactoring
Clearly Define Roles
If you are bringing in consultants to lead the technical team, then tell your team members and enforce the leadership. If you are expecting your consultants to be short-term body-shoppers who are coding, then tell them this up front. Do not allow incorrect perceptions to pervade the group.
There will always be bruised feelings when you bring consultants on to a project in a leadership role. We consultants completely understand this. Nobody wants their work to be reevaluated and critiqued. If the consultants are being brought in to do rearchitecture, then they must be given the power to lead the effort.
Make it clear as to who holds the trump card.
Always Be Engaged
As a project manager, make sure that you know what all of your team members are doing, and make sure that all team members know what each other is doing. Make sure that the server side and client side teams communicate. Many server-side devs have also done GUI work and vice-versa.
If you have to support a legacy version of your product, then make sure that you are able to delegate that task to certain members of the team. Have a plan to get these “legacy developers” involved with the new development. The legacy devs are subject matter experts who are important to the whole team.
Make Sure Everyone Knows Everything
As mentioned above, do not isolate the groups. Involve the Business Analysts and Business Users where appropriate. Unless there are well-defined isolation layers, make sure that you try to completely define the communication layers and formats between the client and server. If the BA’s are planning something new, have them run it by the entire team so that the team can discuss the ramifications on the architecture.
Define A Methodology And Stick To It
If you are going to do Agile or Scrum, then stick to it. If you are going to do Waterfall, then stick to it. If you are going to decide on daily standups, then stick to it.
Have The Environment Completely Set Up
Consultants get paid a lot of money, and their efforts are usually time-boxed. So, make sure that they are productive from day one. Have all user accounts set up. Have all of the software ready. If this software requires additional registration, then make sure that this is done. Make sure that there are enough licenses for the software, and make sure that support packages have been purchased.
Make sure that the computers have enough memory and enough free disk space. Developers need about 2gb of RAM and about 100gb of free hard drive space. Make sure that certain shared drives can be accessed.
Make sure that the security people in the building know that a team is starting, and to expect them. If a consultant is made to wait in the lobby while security tries to track down someone to sign them in, then this serves nobody.
Have Documentation Ready
Does the system have documentation? Use cases? Architecture docs? If not, then either prepare them or prepare for a steeper learning process.
Engage the Business Analysts and Business Users
I have talked about this before. If you are writing a trading system, then the developers should be able to have access to the traders. The developers should be able to peek over a trader’s shoulder while he is working. The developers should have a complete feel for the kind of system that a trader would like to have.
If there are BAs that the developers must interact with, then make sure that the devs and BAs have constant interaction. Make sure that the BAs know if some of their ideas will be difficult to implement.
Do Not Pair-Program Unless Absolutely Necessary
I continue to abhor pair programming. I think that it cuts down productivity in a big way. I think that the best development is done when the developer is “in the zone”, and does not have to expend energy explaining every move to someone else.
Instead, have design meetings and developer meetings. It does not have to be “Big Design Up Front”. However, if a developer is architecting a crucial module, then let him present the design to the entire team and get critiques before the effort is too far gone.
Always Have a Roadmap For Refactoring
Do you know why a product is being refactored? Does the business absolutely need it? Do you really need to rewrite an entire application from scratch?
Remember that, when you refactor an application, you need a plan to retain all of the business logic that is built in to the existing app.
Make sure that the code has comments. Make sure that there is plenty of technical documentation. Make sure that all of the business rules are documented.
Make sure that all dead code has been eliminated from the application. It is difficult to rearchitect a system if the hands of 30 different people have been in it over the years.
These are my ideal Rules of Engagement for any project that I will be on, either as a leader or as a hired hand. I would love to hear your comments.
©2006 Marc Adler - All Rights Reserved
Friday, March 17, 2006
Transition #1
My last day in the land of the Freeborn is today. Good exposure to Credit Derivs.
Starting Monday at the home of the Big Mack. Enhancing an FX system.
©2006 Marc Adler - All Rights Reserved
Starting Monday at the home of the Big Mack. Enhancing an FX system.
©2006 Marc Adler - All Rights Reserved
Tuesday, March 14, 2006
Garden Leave
I rode on the train this morning with a neighbor who is a Managing Director at a Wall Street firm. He is switching companies, and just handed in his resignation. However, he does not start his new position for another 90 days.
It seems that most Wall Street companies are imposing a minimum number of days that you have to stay with a firm when you give your notice. In his case, he had to give 90 days notice. However, his current employer must pay him for the entire 90 days.
His current employer wants him out of the office as fast as possible, so that he does not have the chance to do any internal recruiting. So, he gets to sit at home for 3 months and collect a paycheck.
From what he told me, this practice has been prevalent in Europe, and is just starting to make the rounds in the United States. He told me that it is referred to as "Garden Leave", because the only thing you can do for 3 months is putt around in your garden.
©2006 Marc Adler - All Rights Reserved
It seems that most Wall Street companies are imposing a minimum number of days that you have to stay with a firm when you give your notice. In his case, he had to give 90 days notice. However, his current employer must pay him for the entire 90 days.
His current employer wants him out of the office as fast as possible, so that he does not have the chance to do any internal recruiting. So, he gets to sit at home for 3 months and collect a paycheck.
From what he told me, this practice has been prevalent in Europe, and is just starting to make the rounds in the United States. He told me that it is referred to as "Garden Leave", because the only thing you can do for 3 months is putt around in your garden.
©2006 Marc Adler - All Rights Reserved
"On Becoming a Quant" by Mark Joshi
This was an interesting post that I found on a financial forum. For all of you who have harbored the fantasy of becomign a quant, here is a treatise on what it is like in the real world. Thanks to Mark Joshi for writing this.
ON BECOMING A QUANT
MARK JOSHI
What does a quant do?
A quant designs and implements mathematical models for the pricing
of derivatives.
What sorts of quants are there?
(1) Front office/desk quant
(2) Model validating quant
(3) Research quant
(4) Quant developer
A desk quant implements pricing models directly used by traders.
Main plusses close to the money and opportunities to move into trading.
Minuses can be stressful and depending on the outfit may not involve
much research.
A model validation quant independently implements pricing models
in order to check that front office models are correct. Plusses more
relaxed, less stressful. Minusses model validation teams can be uninspired
and far from the money.
Research quant tries to invent new pricing approaches and sometimes
carries out blue-sky research. Plusses it’s interesting and you learn a
lot more. Minusses sometimes hard to justify your existence.
Quant developer – a glorified programmer but well-paid and easy to
find a job.
All forms of quants spend a large amount (i.e. more than half) their
time programming. However, implementing new models is interesting
in itself. The standard programming approach is object-oriented C++.
A wannabe quant must learn C++.
In the UK standard sources for job adverts are www.jobserve.com
search under ”quant”, the FT appointments section on a Thursday,
and www.wilmott.com has a jobs board. A lot of adverts are from
recruitment consultants rather than from banks. It’s important to
realize that the job may not even exist – the consultant wants to get
decent candidates that he can then try to place them in banks. The
consultant gets a commission from the bank if he can place you. They
tend to have short attention spans. If you do well at the first couple of
interviews then they will work hard to get you a good job but if you
don’t they will quickly lose interest. Also, be aware their agenda is to
get a good commission rather than to help you so they will push you
at jobs on that basis.
In fact, going via a recruitment consultant is the standard way to
get a job. Quants are generally not hired as a part of the on campus
recruitment process but instead hired as they are needed by the team.
Because of this it’s not a great idea to start applying a long time before
you want to start. Obviously personal contacts should be exploited
as much as possible. Banks tend not to be into paying expenses for
interviews. One therefore needs to go to London or New York and
attempt to get as many interviews as possible as quickly as possible.
What should one learn? Standard books are
• Hull - Options future and other derivatives – comprehensive
but low level mathematically and can be frustrating for pure
mathematicians
• Baxter and Rennie – accessible introduction to martingale approach
but oriented towards theory rather than practicalitues
• Wilmott (Derivatives) – good on the PDE approach but not so
good on other approaches.
My book will be published in early 2003 and I like it, of course.
Stochastic calculus is useful but not as important as it at first appears.
Standard texts are Oksendal, and Karatzas and Shreve. It’s
hard to find the time to pick it up on the job so it’s worth learning in
advance. It’s also worth spending some time going over basic probability
theory – eg Chung’s books.
Interviewers tend to care more about understanding the basics well
than on knowing a lot. It’s also important to demonstrate genuine
interest in the field. Read the Economist and the FT or Wall Street
Journal comprehensively. It’s not unusual to ask basic calculus or analysis
questions e.g. what is the integral of log x. Asking for a derivation
of the Black-Scholes equation is very common too. They always ask
you to explain your thesis so be prepared to be able to do this.
Generally, a PhD (or almost a PhD) is a necessity to get a quant
job. I would advise against starting before it’s awarded as it tends to
be hard to get it done whilst doing a busy job.
The main challenge for a pure mathematician is to be able to get
one’s hands dirty and learning to be more focussed on getting numeric
results than on fancy theories. The main way to do this is to implement
pricing models for practice. If this doesn’t appeal you aren’t suited to
being a quant. There are quite a few ex-pure mathematicians working
in the city so it can certainly be done but there is some prejudice
towards applied maths and physics people.
How much does a quant earn? A quant with no experience will
generally get between 35 and 50k pounds. This will generally go up
fairly rapidly. Bonuses are generally a large component of total salary.
How hard does a quant work? This varies a lot. At RBS we get in
between 8.30 and 9 and go home around 6pm. The pressure varies.
Some of the American banks expect much longer hours. Wall St tends
to be more demanding than the City. In London 5 to 6 weeks holidays
is standard. In the US 2 to 3 is standard.
©2006 Marc Adler - All Rights Reserved
ON BECOMING A QUANT
MARK JOSHI
What does a quant do?
A quant designs and implements mathematical models for the pricing
of derivatives.
What sorts of quants are there?
(1) Front office/desk quant
(2) Model validating quant
(3) Research quant
(4) Quant developer
A desk quant implements pricing models directly used by traders.
Main plusses close to the money and opportunities to move into trading.
Minuses can be stressful and depending on the outfit may not involve
much research.
A model validation quant independently implements pricing models
in order to check that front office models are correct. Plusses more
relaxed, less stressful. Minusses model validation teams can be uninspired
and far from the money.
Research quant tries to invent new pricing approaches and sometimes
carries out blue-sky research. Plusses it’s interesting and you learn a
lot more. Minusses sometimes hard to justify your existence.
Quant developer – a glorified programmer but well-paid and easy to
find a job.
All forms of quants spend a large amount (i.e. more than half) their
time programming. However, implementing new models is interesting
in itself. The standard programming approach is object-oriented C++.
A wannabe quant must learn C++.
In the UK standard sources for job adverts are www.jobserve.com
search under ”quant”, the FT appointments section on a Thursday,
and www.wilmott.com has a jobs board. A lot of adverts are from
recruitment consultants rather than from banks. It’s important to
realize that the job may not even exist – the consultant wants to get
decent candidates that he can then try to place them in banks. The
consultant gets a commission from the bank if he can place you. They
tend to have short attention spans. If you do well at the first couple of
interviews then they will work hard to get you a good job but if you
don’t they will quickly lose interest. Also, be aware their agenda is to
get a good commission rather than to help you so they will push you
at jobs on that basis.
In fact, going via a recruitment consultant is the standard way to
get a job. Quants are generally not hired as a part of the on campus
recruitment process but instead hired as they are needed by the team.
Because of this it’s not a great idea to start applying a long time before
you want to start. Obviously personal contacts should be exploited
as much as possible. Banks tend not to be into paying expenses for
interviews. One therefore needs to go to London or New York and
attempt to get as many interviews as possible as quickly as possible.
What should one learn? Standard books are
• Hull - Options future and other derivatives – comprehensive
but low level mathematically and can be frustrating for pure
mathematicians
• Baxter and Rennie – accessible introduction to martingale approach
but oriented towards theory rather than practicalitues
• Wilmott (Derivatives) – good on the PDE approach but not so
good on other approaches.
My book will be published in early 2003 and I like it, of course.
Stochastic calculus is useful but not as important as it at first appears.
Standard texts are Oksendal, and Karatzas and Shreve. It’s
hard to find the time to pick it up on the job so it’s worth learning in
advance. It’s also worth spending some time going over basic probability
theory – eg Chung’s books.
Interviewers tend to care more about understanding the basics well
than on knowing a lot. It’s also important to demonstrate genuine
interest in the field. Read the Economist and the FT or Wall Street
Journal comprehensively. It’s not unusual to ask basic calculus or analysis
questions e.g. what is the integral of log x. Asking for a derivation
of the Black-Scholes equation is very common too. They always ask
you to explain your thesis so be prepared to be able to do this.
Generally, a PhD (or almost a PhD) is a necessity to get a quant
job. I would advise against starting before it’s awarded as it tends to
be hard to get it done whilst doing a busy job.
The main challenge for a pure mathematician is to be able to get
one’s hands dirty and learning to be more focussed on getting numeric
results than on fancy theories. The main way to do this is to implement
pricing models for practice. If this doesn’t appeal you aren’t suited to
being a quant. There are quite a few ex-pure mathematicians working
in the city so it can certainly be done but there is some prejudice
towards applied maths and physics people.
How much does a quant earn? A quant with no experience will
generally get between 35 and 50k pounds. This will generally go up
fairly rapidly. Bonuses are generally a large component of total salary.
How hard does a quant work? This varies a lot. At RBS we get in
between 8.30 and 9 and go home around 6pm. The pressure varies.
Some of the American banks expect much longer hours. Wall St tends
to be more demanding than the City. In London 5 to 6 weeks holidays
is standard. In the US 2 to 3 is standard.
©2006 Marc Adler - All Rights Reserved
Monday, March 13, 2006
The Wall Street Stack Revisited
Chris pointed me to an article on the MSDN/Smart Client page. A startup company called IdeaBlade is offering much of the business object and form-binding backbone that all of us have developed in the past.
I would be interested to hear your opinions of it.
©2006 Marc Adler - All Rights Reserved
I would be interested to hear your opinions of it.
©2006 Marc Adler - All Rights Reserved
Lepus Reports
Allow me to give a shout out to Lepus Reports. I just discovered an archive of past Lepus Reports on my current client's Intranet, and have been devouring each issue with relish.
They release two reports per month; a Research Report that contains about 10 articles dealing with a specific area of financial IT, and a briefer Management Report. For instance, one article might give an overview of ECNs, talk about the current trends in ECN usage, and give a brief overview of the various vendors in that space. They will also survey a number of financial firms to find out what they are currently using.
The last few pages of each report are devoted to news, so you can find out about new products, who has changed companies, and who has bought out whom.
If I were a financial IT consultant who changed clients every few months (which I am) and needed to get up to speed on a certain domain, I would certainly reach for a Lepus Report to get a quick backgrounder.
Note: I have no connection with Lepus, other than being a satisfied reader.
©2006 Marc Adler - All Rights Reserved
They release two reports per month; a Research Report that contains about 10 articles dealing with a specific area of financial IT, and a briefer Management Report. For instance, one article might give an overview of ECNs, talk about the current trends in ECN usage, and give a brief overview of the various vendors in that space. They will also survey a number of financial firms to find out what they are currently using.
The last few pages of each report are devoted to news, so you can find out about new products, who has changed companies, and who has bought out whom.
If I were a financial IT consultant who changed clients every few months (which I am) and needed to get up to speed on a certain domain, I would certainly reach for a Lepus Report to get a quick backgrounder.
Note: I have no connection with Lepus, other than being a satisfied reader.
©2006 Marc Adler - All Rights Reserved
Wednesday, February 08, 2006
Thursday, February 02, 2006
A Data Point - Senior .NET Arch/Dev Salary
Even though my resume is not in the "active" state on Monster and Dice, I still get a ton of calls from headhunters. Since coming out of my New Jersey territory, and working in New York, I now pay attention to what Wall Street dev managers, architects, and developers are making. After all, when we try to recruit candidates for Finetix, we need to be a little more than competitve with the current batch of companies.
Perhaps everyone have just gotten their new budgets approved ... perhaps it is all of the annual February job movement taking place, and new hires want to re-stock their technical teams .... but this week has been ridiculous in the number of calls and emails that I have been getting for Wall Street firms looking for solid technical talent. The same thing must be happening over in the City of London.
On Wall Street, it seems that the base salary for a senior .NET and Java architect/developer is $150,000. This must mean that the salary for a City of London position is around £100,000. (Can any London-based developer confirm this?)
Bonus is everything on Wall Street. It was shocking to hear that the bonuses for average developers at my current client around around 10%. Lehman's bonus are much, much higher, but you have to work every Saturday. UBS is around 40%.
I would love to get more data points. Please feel free to comment.
©2006 Marc Adler - All Rights Reserved
Perhaps everyone have just gotten their new budgets approved ... perhaps it is all of the annual February job movement taking place, and new hires want to re-stock their technical teams .... but this week has been ridiculous in the number of calls and emails that I have been getting for Wall Street firms looking for solid technical talent. The same thing must be happening over in the City of London.
On Wall Street, it seems that the base salary for a senior .NET and Java architect/developer is $150,000. This must mean that the salary for a City of London position is around £100,000. (Can any London-based developer confirm this?)
Bonus is everything on Wall Street. It was shocking to hear that the bonuses for average developers at my current client around around 10%. Lehman's bonus are much, much higher, but you have to work every Saturday. UBS is around 40%.
I would love to get more data points. Please feel free to comment.
©2006 Marc Adler - All Rights Reserved
Monday, January 30, 2006
A Wish - Validators for Properties in C#
While writing a validation framework for a whole bunch of business objects this weekend, I wish I would have had the following in C#/.NET
public double Notional
{
get
{
return this._notional;
}
set
{
this._notional = value;
}
validate
{
if (this._notional <>
{
this.AddBrokenRule("A Buyer's notional cannot be negative");
return false;
}
return true;
}
}
If I called businessObject.IsValid, then all properties of the businessObject that implemented validate would be tested. Each object would automatically contain an IList of all broken business rules.
There would be support for this in the Visual Studio designer, so that I could created a resource-based string for each error message.
©2006 Marc Adler - All Rights Reserved
public double Notional
{
get
{
return this._notional;
}
set
{
this._notional = value;
}
validate
{
if (this._notional <>
{
this.AddBrokenRule("A Buyer's notional cannot be negative");
return false;
}
return true;
}
}
If I called businessObject.IsValid, then all properties of the businessObject that implemented validate would be tested. Each object would automatically contain an IList of all broken business rules.
There would be support for this in the Visual Studio designer, so that I could created a resource-based string for each error message.
©2006 Marc Adler - All Rights Reserved
Boy, Things Have Changed!
When I left my position as Technical Director of a new division of SGP in March 2002, I knew that the market was starting to turn bad for consultants. Even the ones who were "known quantities" out there. I left SGP because I wanted to fulfill a dream and persue a master's degree in Percussion Performance. I had never had any downtime since graduating college and the pull of music was becoming stronger.
However, on my first day of freedom, at 8:30 AM (they did not even wait until 9), I got a call from an old colleague of mine who was forming a new company and wanted me to be CTO of it. This position carried me until the summer of 2003, when we sold the company to our biggest competitor.
During this time, I heard all sorts of horror stories about the consulting market. Nobody could find a job anywhere! At the apex of this madness, the New York Times magazine ran a story about a former high-flyer in the Internet world who was working at The Gap, selling jeans and trying to eke out a living. After we sold the company, I had about 2 months where I experienced the depths of the consulting marketplace. People with 10 years of heavy C++ were being offered $35 an hour, and were happy to take it!
Fast forward to January 2006.....
Jobs seems to be abundant in the IT field. How abundant? I just posted a help-wanted ad for Finetix, and I received a grand total of 2 replies, one of which was from a glorified computer technician. Now, Finetix happens to be a good company to work for. They have interesting projects in the Wall Street area and they pay about 10-15% over the prevailing market rate in order to get the best talent that they could find. But, seriously... 2 replies!!!
Anyone interested in working for Finetix? Send your resume to me at magmasystems@yahoo.com.
©2006 Marc Adler - All Rights Reserved
However, on my first day of freedom, at 8:30 AM (they did not even wait until 9), I got a call from an old colleague of mine who was forming a new company and wanted me to be CTO of it. This position carried me until the summer of 2003, when we sold the company to our biggest competitor.
During this time, I heard all sorts of horror stories about the consulting market. Nobody could find a job anywhere! At the apex of this madness, the New York Times magazine ran a story about a former high-flyer in the Internet world who was working at The Gap, selling jeans and trying to eke out a living. After we sold the company, I had about 2 months where I experienced the depths of the consulting marketplace. People with 10 years of heavy C++ were being offered $35 an hour, and were happy to take it!
Fast forward to January 2006.....
Jobs seems to be abundant in the IT field. How abundant? I just posted a help-wanted ad for Finetix, and I received a grand total of 2 replies, one of which was from a glorified computer technician. Now, Finetix happens to be a good company to work for. They have interesting projects in the Wall Street area and they pay about 10-15% over the prevailing market rate in order to get the best talent that they could find. But, seriously... 2 replies!!!
Anyone interested in working for Finetix? Send your resume to me at magmasystems@yahoo.com.
©2006 Marc Adler - All Rights Reserved
Friday, January 13, 2006
User Groups in the NYC/NJ Area
Here are user groups of interest that one can attend after work if you are in the NYC/NJ area.
New York City .NET Developers Group
The meetings are usually held at Microsoft, 1290 Avenue of the Americas (the AXA building - bet. 51st/52nd Sts.), 6th floor
The Design Patterns Study Group of New York
The weekly meeting are held at various places, depending on which subgroup you belong to.
New Jersey .NET Developers Group
The monthly meetings are held at the Microsoft NJ Office in Iselin.
©2006 Marc Adler - All Rights Reserved
New York City .NET Developers Group
The meetings are usually held at Microsoft, 1290 Avenue of the Americas (the AXA building - bet. 51st/52nd Sts.), 6th floor
The Design Patterns Study Group of New York
The weekly meeting are held at various places, depending on which subgroup you belong to.
New Jersey .NET Developers Group
The monthly meetings are held at the Microsoft NJ Office in Iselin.
©2006 Marc Adler - All Rights Reserved
Monday, January 09, 2006
MFC to C#/.NET Porting Service???
Are people out there still learning C++ and MFC? I can't imagine that they are. If you are a financial services company, and you have a big application written in MFC (let's forget about ATL and WTL right now), how difficult is it for you to find an MFC developer to enhance the application?
Would you pay for a porting company to transform the application into a C#/.NET application? Or, if there was a product available, would you pay for a .NET framework that is quasi-compatible with MFC?
Maybe Finetix will give me some seed money for this!
©2006 Marc Adler - All Rights Reserved
Would you pay for a porting company to transform the application into a C#/.NET application? Or, if there was a product available, would you pay for a .NET framework that is quasi-compatible with MFC?
Maybe Finetix will give me some seed money for this!
©2006 Marc Adler - All Rights Reserved
Monday, December 19, 2005
General Contractors
My Finetix colleague, Chris, just reminded me of the lunchtime conversation we had a few days ago with one of our good friends from RiskFocus. It got me thinking about an interesting model for development.
Think of what a General Contractor does when you do construction on a home. He gets (hopefully) the best-of-breed specialists to perform certain functions. He has one company to do the foundation, another to do the framing, another to do the electrical wiring, and another to do the sheet rock and spackling. Each of these tasks is done efficiently by the tradesman, and then it is understood that they move on to another construction job.
I am wondering if anyone has followed this model in developing systems. A "General Contractor" gets the best consultants around to perform a specific specialist task, something that they do best. The job lasts for one month, and then the contractor moves to a different development job. There would be a specialist to write the framework, a specialist to plug in the security and entitlements, a specialist to write the Web Services and fix any interoperability issues, a specialist to write the calculation engines, and then a GUI specialist to plug in a front end. Each member of this well-oiled team would be versed in the various interfaces and abstractions that the other members of the team use, so that the security specialist would come in, and know immediately where to hook in his stuff to various parts of the framework.
The members of the team would rotate amongst the various specialties so they do not end up getting tagged as a master in only a single discipline.
I have never seen this model being used, but I would be curious if anyone has ever tried it.
Your comments are welcome.
©2005 Marc Adler - All Rights Reserved
Think of what a General Contractor does when you do construction on a home. He gets (hopefully) the best-of-breed specialists to perform certain functions. He has one company to do the foundation, another to do the framing, another to do the electrical wiring, and another to do the sheet rock and spackling. Each of these tasks is done efficiently by the tradesman, and then it is understood that they move on to another construction job.
I am wondering if anyone has followed this model in developing systems. A "General Contractor" gets the best consultants around to perform a specific specialist task, something that they do best. The job lasts for one month, and then the contractor moves to a different development job. There would be a specialist to write the framework, a specialist to plug in the security and entitlements, a specialist to write the Web Services and fix any interoperability issues, a specialist to write the calculation engines, and then a GUI specialist to plug in a front end. Each member of this well-oiled team would be versed in the various interfaces and abstractions that the other members of the team use, so that the security specialist would come in, and know immediately where to hook in his stuff to various parts of the framework.
The members of the team would rotate amongst the various specialties so they do not end up getting tagged as a master in only a single discipline.
I have never seen this model being used, but I would be curious if anyone has ever tried it.
Your comments are welcome.
©2005 Marc Adler - All Rights Reserved
Sunday, November 27, 2005
The Wall Street Stack
It has been done plenty of times on Wall Street..... what I call the Wall Street Stack.
I just came off of a large project where I architected (yet another) one. I am current involved in one now. So are plenty of other people that I know in other companies.
Everyone's trading applications seems to be the same. Here are the standard elements:
1) The UI layer. The UI layer is usually designed around the Model-View-Controller pattern. It generally uses some third-party UI suite, such as Infragistics, Component One, or Syncfusion.
2) The UI usually contains an Outlook-style navigation bar on the left side. On the right is usually an MDI-ish area. There are multiple tabbed controls, each containing a grid control. The grid is a respresentation of the underlying business objects.
3) Filter criteria that is used to filter the results on the grid. The filter UI is usually placed on the same panel as the grid and consists of a number of comboboxes and edit fields that represent dates and static criteria. Filters can usually be translated into an SQL statement.... a dataview-like pattern can be applied to the underlying model to produce a filtered view.
4) User preferences and workspace persistence. Users can save the layout of the workspace, and load the layout when they log onto a new session from any machine.
5) Entitlements by role. Entitlements control various aspects of the UI, such as what menus, toolbar buttons, and controls are available to the user.
6) A Data layer that sits between the UI layer and the middle-tier. The data layer can contain a business facade, smart business objects (that are decorated with .NET attributes), a data access layer (contains a reference to the cache), and service providers that interface with a database and/or a middle-tier. The data layer can communicate with the middle-tier in both synchronous and asynchronous fashion.
7) Middle-tier (usually Java-based) that accesses the underlying database. Communication with the middle-tier is through some variant of XML (usually SOAP). (Sorry, .NET middle-tiers have not caught on yet in Wall Street ... I cite projects at Lehman, Wachovia, Citicorp, Goldman...)
8) Schemas shared between the client and middle-tier.
9) Subscription to asynchronous events, usually by some mechanism as a message bus (Tibco RV or EMS), or Smart Sockets (which is now owned by Tibco). When something happens to the underlying data, the middle-tier will broadcast an event to all of the clients that are hooked up to it. Each client has something that I call a "service agent", which is like a web service in reverse. The service agent receives the subscription event, and propogates the evented data up the chain.
10) A rich event manager. The event manager can be thought of as a mini-Tibco that resides totally within the client. The event manager should support wildcarding.
This stack is being implemented over and over again. The closest thing that I have seen to a corporate standard is the OCEAN framework that Goldman has.
There has to be a vendor who can commercialize this stack and sell it across the various financial companies. Anyone want to start a company with me????
As an aside, the Microsoft Composite Application Block bears close watching. However, it is only available for .NET 2.0. Many of the current .NET-based projects are still using 1.1.
©2005 Marc Adler - All Rights Reserved
I just came off of a large project where I architected (yet another) one. I am current involved in one now. So are plenty of other people that I know in other companies.
Everyone's trading applications seems to be the same. Here are the standard elements:
1) The UI layer. The UI layer is usually designed around the Model-View-Controller pattern. It generally uses some third-party UI suite, such as Infragistics, Component One, or Syncfusion.
2) The UI usually contains an Outlook-style navigation bar on the left side. On the right is usually an MDI-ish area. There are multiple tabbed controls, each containing a grid control. The grid is a respresentation of the underlying business objects.
3) Filter criteria that is used to filter the results on the grid. The filter UI is usually placed on the same panel as the grid and consists of a number of comboboxes and edit fields that represent dates and static criteria. Filters can usually be translated into an SQL statement.... a dataview-like pattern can be applied to the underlying model to produce a filtered view.
4) User preferences and workspace persistence. Users can save the layout of the workspace, and load the layout when they log onto a new session from any machine.
5) Entitlements by role. Entitlements control various aspects of the UI, such as what menus, toolbar buttons, and controls are available to the user.
6) A Data layer that sits between the UI layer and the middle-tier. The data layer can contain a business facade, smart business objects (that are decorated with .NET attributes), a data access layer (contains a reference to the cache), and service providers that interface with a database and/or a middle-tier. The data layer can communicate with the middle-tier in both synchronous and asynchronous fashion.
7) Middle-tier (usually Java-based) that accesses the underlying database. Communication with the middle-tier is through some variant of XML (usually SOAP). (Sorry, .NET middle-tiers have not caught on yet in Wall Street ... I cite projects at Lehman, Wachovia, Citicorp, Goldman...)
8) Schemas shared between the client and middle-tier.
9) Subscription to asynchronous events, usually by some mechanism as a message bus (Tibco RV or EMS), or Smart Sockets (which is now owned by Tibco). When something happens to the underlying data, the middle-tier will broadcast an event to all of the clients that are hooked up to it. Each client has something that I call a "service agent", which is like a web service in reverse. The service agent receives the subscription event, and propogates the evented data up the chain.
10) A rich event manager. The event manager can be thought of as a mini-Tibco that resides totally within the client. The event manager should support wildcarding.
This stack is being implemented over and over again. The closest thing that I have seen to a corporate standard is the OCEAN framework that Goldman has.
There has to be a vendor who can commercialize this stack and sell it across the various financial companies. Anyone want to start a company with me????
As an aside, the Microsoft Composite Application Block bears close watching. However, it is only available for .NET 2.0. Many of the current .NET-based projects are still using 1.1.
©2005 Marc Adler - All Rights Reserved
The Wall Street Stack
It has been done plenty of times on Wall Street..... what I call the Wall Street Stack.
I just came off of a large project where I architected (yet another) one. I am current involved in one now. So are plenty of other people that I know in other companies.
Everyone's trading applications seems to be the same. Here are the standard elements:
1) The UI layer. The UI layer is usually designed around the Model-View-Controller pattern. It generally uses some third-party UI suite, such as Infragistics, Component One, or Syncfusion.
2) The UI usually contains an Outlook-style navigation bar on the left side. On the right is usually an MDI-ish area. There are multiple tabbed controls, each containing a grid control. The grid is a respresentation of the underlying business objects.
3) Filter criteria that is used to filter the results on the grid. The filter UI is usually placed on the same panel as the grid and consists of a number of comboboxes and edit fields that represent dates and static criteria. Filters can usually be translated into an SQL statement.... a dataview-like pattern can be applied to the underlying model to produce a filtered view.
4) User preferences and workspace persistence. Users can save the layout of the workspace, and load the layout when they log onto a new session from any machine.
5) Entitlements by role. Entitlements control various aspects of the UI, such as what menus, toolbar buttons, and controls are available to the user.
6) A Data layer that sits between the UI layer and the middle-tier. The data layer can contain a business facade, smart business objects (that are decorated with .NET attributes), a data access layer (contains a reference to the cache), and service providers that interface with a database and/or a middle-tier. The data layer can communicate with the middle-tier in both synchronous and asynchronous fashion.
7) Middle-tier (usually Java-based) that accesses the underlying database. Communication with the middle-tier is through some variant of XML (usually SOAP). (Sorry, .NET middle-tiers have not caught on yet in Wall Street ... I cite projects at Lehman, Wachovia, Citicorp, Goldman...)
8) Schemas shared between the client and middle-tier.
9) Subscription to asynchronous events, usually by some mechanism as a message bus (Tibco RV or EMS), or Smart Sockets (which is now owned by Tibco). When something happens to the underlying data, the middle-tier will broadcast an event to all of the clients that are hooked up to it. Each client has something that I call a "service agent", which is like a web service in reverse. The service agent receives the subscription event, and propogates the evented data up the chain.
10) A rich event manager. The event manager can be thought of as a mini-Tibco that resides totally within the client. The event manager should support wildcarding.
This stack is being implemented over and over again. The closest thing that I have seen to a corporate standard is the OCEAN framework that Goldman has.
There has to be a vendor who can commercialize this stack and sell it across the various financial companies. Anyone want to start a company with me????
As an aside, the Microsoft Composite Application Block bears close watching. However, it is only available for .NET 2.0. Many of the current .NET-based projects are still using 1.1.
©2005 Marc Adler - All Rights Reserved
I just came off of a large project where I architected (yet another) one. I am current involved in one now. So are plenty of other people that I know in other companies.
Everyone's trading applications seems to be the same. Here are the standard elements:
1) The UI layer. The UI layer is usually designed around the Model-View-Controller pattern. It generally uses some third-party UI suite, such as Infragistics, Component One, or Syncfusion.
2) The UI usually contains an Outlook-style navigation bar on the left side. On the right is usually an MDI-ish area. There are multiple tabbed controls, each containing a grid control. The grid is a respresentation of the underlying business objects.
3) Filter criteria that is used to filter the results on the grid. The filter UI is usually placed on the same panel as the grid and consists of a number of comboboxes and edit fields that represent dates and static criteria. Filters can usually be translated into an SQL statement.... a dataview-like pattern can be applied to the underlying model to produce a filtered view.
4) User preferences and workspace persistence. Users can save the layout of the workspace, and load the layout when they log onto a new session from any machine.
5) Entitlements by role. Entitlements control various aspects of the UI, such as what menus, toolbar buttons, and controls are available to the user.
6) A Data layer that sits between the UI layer and the middle-tier. The data layer can contain a business facade, smart business objects (that are decorated with .NET attributes), a data access layer (contains a reference to the cache), and service providers that interface with a database and/or a middle-tier. The data layer can communicate with the middle-tier in both synchronous and asynchronous fashion.
7) Middle-tier (usually Java-based) that accesses the underlying database. Communication with the middle-tier is through some variant of XML (usually SOAP). (Sorry, .NET middle-tiers have not caught on yet in Wall Street ... I cite projects at Lehman, Wachovia, Citicorp, Goldman...)
8) Schemas shared between the client and middle-tier.
9) Subscription to asynchronous events, usually by some mechanism as a message bus (Tibco RV or EMS), or Smart Sockets (which is now owned by Tibco). When something happens to the underlying data, the middle-tier will broadcast an event to all of the clients that are hooked up to it. Each client has something that I call a "service agent", which is like a web service in reverse. The service agent receives the subscription event, and propogates the evented data up the chain.
10) A rich event manager. The event manager can be thought of as a mini-Tibco that resides totally within the client. The event manager should support wildcarding.
This stack is being implemented over and over again. The closest thing that I have seen to a corporate standard is the OCEAN framework that Goldman has.
There has to be a vendor who can commercialize this stack and sell it across the various financial companies. Anyone want to start a company with me????
As an aside, the Microsoft Composite Application Block bears close watching. However, it is only available for .NET 2.0. Many of the current .NET-based projects are still using 1.1.
©2005 Marc Adler - All Rights Reserved
Sunday, November 13, 2005
Full-Layer vs Bottom-Up Reachitecture and Scrum
Mission
To reengineer a credit derivates trading system using Scrum. (30-day sprints)
Findings
The existing application is somewhat monolithic, with direct database access from the UI layer, and business rules embedded in the UI.
Things to consider
1) The users want to see visible functionality after each sprint. We need to rearchitect, but our refactoring must not affect the current UI.
2) We need to implement new structured products after the 3rd sprint.
Question
Would you rearchitect from the bottom up and devote each sprint to deliver a fully-tested foundation layer, working your way up until you hit the UI layer? Or, would each sprint consist of implementing the entire stack with ever-increasing functionality?
I would love to hear your opinions.
©2005 Marc Adler - All Rights Reserved
To reengineer a credit derivates trading system using Scrum. (30-day sprints)
Findings
The existing application is somewhat monolithic, with direct database access from the UI layer, and business rules embedded in the UI.
Things to consider
1) The users want to see visible functionality after each sprint. We need to rearchitect, but our refactoring must not affect the current UI.
2) We need to implement new structured products after the 3rd sprint.
Question
Would you rearchitect from the bottom up and devote each sprint to deliver a fully-tested foundation layer, working your way up until you hit the UI layer? Or, would each sprint consist of implementing the entire stack with ever-increasing functionality?
I would love to hear your opinions.
©2005 Marc Adler - All Rights Reserved
Microsoft Discovers Scrum
http://developers.slashdot.org/developers/05/11/13/0545244.shtml?tid=109&tid=8
©2005 Marc Adler - All Rights Reserved
©2005 Marc Adler - All Rights Reserved
Friday, November 11, 2005
Bovine Memories
Posting about my Microsoft contract brought back some interesting memories.
When I started the Microsoft contract to write some GUI-based management tools for their new SQL Server, Microsoft and IBM were still putting the finishing touches on OS/2 Presentation Manager. So, I started writing the software using an internal Microsoft character windowing system called COW .. short for Character-Oriented Windows. This was the only user interface system that MS had for OS/2. (Remember, SQL Server started life as an OS/2 product.) COW was used most notably in OS/2's LAN Manager. I forgot what the API was like, but I still have all my COW libraries and docs on 5 1/4" floppies in a filing cabinet... I just can't bear to part with those disks!
I used to get these 100 lb boxes shipped to me every week from Microsoft. Tons of manuals for SQL Server, OS/2 PM, LAN Manager, OS/2, etc. Thankfully, these went into the trash can a few years ago.
My manager on that consulting contract, Bob Muglia, is now a bigwig at Microsoft. He just got another bump in rank in the most recent corporate restructing at MS.
My experience with giving MS a fixed-price contract taught me that time-and-materials is the only way to go! It didn't help that Microsoft was in a big pissing match at the time with Sybase.
©2005 Marc Adler - All Rights Reserved
When I started the Microsoft contract to write some GUI-based management tools for their new SQL Server, Microsoft and IBM were still putting the finishing touches on OS/2 Presentation Manager. So, I started writing the software using an internal Microsoft character windowing system called COW .. short for Character-Oriented Windows. This was the only user interface system that MS had for OS/2. (Remember, SQL Server started life as an OS/2 product.) COW was used most notably in OS/2's LAN Manager. I forgot what the API was like, but I still have all my COW libraries and docs on 5 1/4" floppies in a filing cabinet... I just can't bear to part with those disks!
I used to get these 100 lb boxes shipped to me every week from Microsoft. Tons of manuals for SQL Server, OS/2 PM, LAN Manager, OS/2, etc. Thankfully, these went into the trash can a few years ago.
My manager on that consulting contract, Bob Muglia, is now a bigwig at Microsoft. He just got another bump in rank in the most recent corporate restructing at MS.
My experience with giving MS a fixed-price contract taught me that time-and-materials is the only way to go! It didn't help that Microsoft was in a big pissing match at the time with Sybase.
©2005 Marc Adler - All Rights Reserved
Wednesday, November 09, 2005
Just Who Do You Think You Are! (Part 4)
The left episode left Marc writing Windows-based equity workstations for Goldman by day, and packing word processors and text editors at night. (Because the ME Text Editor was one of the first 50 applications written for OS/2, Marc got to go down and show the editor at the IBM OS/2 booth at 1988 Spring COMDEX... learning OS/2 turned out to be a good move, as we shall see in a minute.)
Two opportunities came along at the same time that Marc could not pass up. Marc's wife was a Cobol/CICS for Drexel Burnham at the time (remember Michael Milkin???). Somehow, her boss's boss found out that there was a developer who was writing Windows software for Goldman at the time, and developer who could be enticed away for a certain sum of money. In addition, a new development manager who had just been hired by Microsoft had been looking for an OS/2/PM developer who could help him write software for his new group. Marc could not refuse either, so he accepted both!!!
So, now it was writing a DOS and Windows trading system for Drexel, and helping Microsoft write software for a product that they had licensed from Sybase and renamed.... SQL Server. Marc also started writing articles for Microsoft Systems Journal, which was run by the great Tony Rizzo, bless his soul!!!
Believe it or not, the Drexel contract was the more interesting of the two by a longshot! The problem was that, whatever was written for the Windows version of the trading system had to be replicated on the DOS version as well.... the traders had laptops that could not run Windows very well.
So, Marc had an idea..... why not write the Windows-based trading system in C, using the Windows API. And, for the DOS version, use the same API. This involved reimplementing the Windows API in a DOS library. This led to another product.... the Magma Extensible Window and Event Library... or MEWEL for short.
Next chapter.... MEWEL kicks Magma Systems into high gear....
©2005 Marc Adler - All Rights Reserved
Two opportunities came along at the same time that Marc could not pass up. Marc's wife was a Cobol/CICS for Drexel Burnham at the time (remember Michael Milkin???). Somehow, her boss's boss found out that there was a developer who was writing Windows software for Goldman at the time, and developer who could be enticed away for a certain sum of money. In addition, a new development manager who had just been hired by Microsoft had been looking for an OS/2/PM developer who could help him write software for his new group. Marc could not refuse either, so he accepted both!!!
So, now it was writing a DOS and Windows trading system for Drexel, and helping Microsoft write software for a product that they had licensed from Sybase and renamed.... SQL Server. Marc also started writing articles for Microsoft Systems Journal, which was run by the great Tony Rizzo, bless his soul!!!
Believe it or not, the Drexel contract was the more interesting of the two by a longshot! The problem was that, whatever was written for the Windows version of the trading system had to be replicated on the DOS version as well.... the traders had laptops that could not run Windows very well.
So, Marc had an idea..... why not write the Windows-based trading system in C, using the Windows API. And, for the DOS version, use the same API. This involved reimplementing the Windows API in a DOS library. This led to another product.... the Magma Extensible Window and Event Library... or MEWEL for short.
Next chapter.... MEWEL kicks Magma Systems into high gear....
©2005 Marc Adler - All Rights Reserved
Let the Traders Have Some!
In the good old days, when I was designing trader workstations for Goldman and Drexel Burnham, we use to have close interaction with the traders themselves. We were in an Extreme Programming mode by necessity. Traders were giving us constanmt feedback, and we were able to stand over their shoulders while they traded so we could see how they interacted with the data.
Nowadays, the development staff is usually isolated from the traders... we get our specs from the Business Analysts. Not only that... you often get screen layouts from the BAs too! This often results in Windows apps that look like the old CICS screens... miles and miles of edit and comboboxes, modal interactions, etc. The traders don't mind... they are used to spending a good portion of their days in Excel, or they are used to the austere look of a Bloomberg terminal.
UI design has advanced over the past few years. Let the developers stand over a trader for a while. Let us see how they put a trade together. Let us try to make things easier for them.
©2005 Marc Adler - All Rights Reserved
Nowadays, the development staff is usually isolated from the traders... we get our specs from the Business Analysts. Not only that... you often get screen layouts from the BAs too! This often results in Windows apps that look like the old CICS screens... miles and miles of edit and comboboxes, modal interactions, etc. The traders don't mind... they are used to spending a good portion of their days in Excel, or they are used to the austere look of a Bloomberg terminal.
UI design has advanced over the past few years. Let the developers stand over a trader for a while. Let us see how they put a trade together. Let us try to make things easier for them.
©2005 Marc Adler - All Rights Reserved
Tuesday, November 08, 2005
Index and Bespoken Tranches
In the credit derivatives trading system we are building, we need to add support for various structured products. Two of the products are index and bespoken tranches. Other instruments that we will eventually have to implement are NTDs, CDOs, and CDO2.
We all know what a Credit Default Swap (CDS) is, right? It's a form of insurance that someone takes out on a company. One party (the buyer of the insurance) pays a periodic premium to a counterparty (seller of the insurance) for insurance on an underlying instrument (bond or other credit instrument). If there is a "credit event" on the underlying (ie: a company goes bust, misses an interest payment, or the CEO runs away to Bermuda with his secretary), the seller of the insurance must pay the buyer a certain sum of money, known as the "recovery rate". The CDS has some parameters, such as the seniority (who is first in line to get paid in case the company goes belly up), the tenor (how long the buyer has to pay the premiums for), and the notional (the value of the underlying instrument).
There are Indexes on CDS's. We can create our own index, such as the bonds of all of the American auto manufacturers. Or, we can use an exchange-manufactured index.
CDS indices are so popular that there is a CDS index on the Dow. The most widely-traded CDS index is the one for North American Investment Grade instruments. It accounts for over 80% of the CDX volume that is traded.
So, now we know what a CDS Index is. On to Tranches....
A Tranche is a certain level of risk. According to Investopedia:
Tranche is a term often used to describe a specific class of bonds within an offering wherein each tranche offers varying degrees of risk to the investor. For example, a CMO offering a partitioned MBS portfolio might have mortgages (tranches) that have one-year, two- year, five-year and 20-year maturities.
For the above-mentioned index, there are 5 tranches. The Equity tranche covers the first 3% of losses on the credit instruments. The Mezzanine tranche covers from 3-7%. The two Senior tranches cover 7-10% and 10-15% respectively. The Super Senior tranche covers the last 15-30% of losses.
Index Tranches are for active traders. A Bespoken Tranche is one that is put together on the wishes of an investor. It is usually created for long-term investment.
©2005 Marc Adler - All Rights Reserved
We all know what a Credit Default Swap (CDS) is, right? It's a form of insurance that someone takes out on a company. One party (the buyer of the insurance) pays a periodic premium to a counterparty (seller of the insurance) for insurance on an underlying instrument (bond or other credit instrument). If there is a "credit event" on the underlying (ie: a company goes bust, misses an interest payment, or the CEO runs away to Bermuda with his secretary), the seller of the insurance must pay the buyer a certain sum of money, known as the "recovery rate". The CDS has some parameters, such as the seniority (who is first in line to get paid in case the company goes belly up), the tenor (how long the buyer has to pay the premiums for), and the notional (the value of the underlying instrument).
There are Indexes on CDS's. We can create our own index, such as the bonds of all of the American auto manufacturers. Or, we can use an exchange-manufactured index.
CDS indices are so popular that there is a CDS index on the Dow. The most widely-traded CDS index is the one for North American Investment Grade instruments. It accounts for over 80% of the CDX volume that is traded.
So, now we know what a CDS Index is. On to Tranches....
A Tranche is a certain level of risk. According to Investopedia:
Tranche is a term often used to describe a specific class of bonds within an offering wherein each tranche offers varying degrees of risk to the investor. For example, a CMO offering a partitioned MBS portfolio might have mortgages (tranches) that have one-year, two- year, five-year and 20-year maturities.
For the above-mentioned index, there are 5 tranches. The Equity tranche covers the first 3% of losses on the credit instruments. The Mezzanine tranche covers from 3-7%. The two Senior tranches cover 7-10% and 10-15% respectively. The Super Senior tranche covers the last 15-30% of losses.
Index Tranches are for active traders. A Bespoken Tranche is one that is put together on the wishes of an investor. It is usually created for long-term investment.
©2005 Marc Adler - All Rights Reserved
Monday, November 07, 2005
Wife + Chaos = Scrum
My wife has inherited this credit derivatives project which seems to be in a huge mess.
She is curious about Scrum, and wants to know if it will bring order to her chaos.
She and her colleagues at the Tier-1 powerhouse have been invited to the Finetix Scrum breakfast on Nov 30.
©2005 Marc Adler - All Rights Reserved
She is curious about Scrum, and wants to know if it will bring order to her chaos.
She and her colleagues at the Tier-1 powerhouse have been invited to the Finetix Scrum breakfast on Nov 30.
©2005 Marc Adler - All Rights Reserved
Sunday, November 06, 2005
Be Afraid ... Be Very Afraid
Looks like there are enough serious bugs in the first release of Visual Studio .NET 2005 to make me question recommending it for use (not that any of the tier-1 banks that we deal with are likely to jump with both feet into barely-released software).
Too bad .. we can really use generics on the current project, where we would like to implement strongly-typed caches of various trading instruments.
©2005 Marc Adler - All Rights Reserved
Too bad .. we can really use generics on the current project, where we would like to implement strongly-typed caches of various trading instruments.
©2005 Marc Adler - All Rights Reserved
Tuesday, November 01, 2005
I Got the Clearcase/UCM Blues
Sitting here, suffering from ClearCase/UCM .... we have probably lost several hours of work because of UCM troubles.
Deglan warned me about UCM ..... and anything that makes you long for the sweet embrace of SourceSafe must be a new form of pain.
©2005 Marc Adler - All Rights Reserved
Deglan warned me about UCM ..... and anything that makes you long for the sweet embrace of SourceSafe must be a new form of pain.
©2005 Marc Adler - All Rights Reserved
Subscribe to:
Posts (Atom)