Version Control 101 – The SimCorp Way

Download Report

Transcript Version Control 101 – The SimCorp Way

Types in APL – The SimCorp Way
Dyalog User Conference 2007
Lars Stampe Villadsen, SimCorp A/S (Denmark)
Agenda
• Company presentation (short )
• It is all about structure
• Defined types in SimCorp Dimension
2
Business Idea
SimCorp offers integrated software solutions to financial
service providers supporting their activities worldwide on the
financial markets. Our solutions are firmly based on our high
quality standards and our insight into financial theory,
methods and practices.
3
SimCorp Dimension era
SimCorp History
2007
2003
2000
1999
1998
1997
SimCorp sells IT2
SimCorp Dimension
TMS2000 full STP product
IT2 acquired to substitute TRACTS
TMS2000 most important product
Sale of Actuarial department
1996
1995
Official launch of TMS2000
First TMS2000 implementations
TMS2000 development intensified
10 Years Revenue Development
EURm
160
140
Customised software
120
100
80
1991
1990
1985
Getting Focused
Risk management modules
Financial analytics and library
Building society systems
Money market systems
Pricing models for derivatives
Treasury systems
60
40
20
0
1996
4
1998
2000
2002
2004
2006
It is all about structure
Big house – strict rules
Naming conventions:
^[a-z_][a-z0-9_]+$
^[a-z][a-zA-Z0-9_]+[A-Z] [a-zA-Z0-9_]+[a-z]$
^_[a-z0-9] [a-z0-9_]+$
^[a-z][a-zA-Z0-9_]+[A-Z] [a-zA-Z0-9_]+[A-Z]$
^[A-Z][A-Z0-9_]+$
Reserved prefixes:
^t[A_Z0_9_]+$
^p[A_Z0_9_]+$
^d[A_Z0_9_]+$
…
5
Local variable: dates
Function: dcAndBasicParts
Local d-func: _swap
Global variable: intTAB
Utility function: FSI
Constant for a table: tIBI
Constant for a ’pointer’: pSECSHORT
Constant for an enumeration: dIT_BOND
It is all about structure – cont.
Lets make a simple function:
datessince„ex1Main date
© Calculate dayes between today and specified date.
toDay„10000 100 100ƒ3†ŒTS
datessince„toDay-date
ex1Main 20071001
1
CHK 'ex1Main' © ... Comply with standards ?
ERROR: Missing header: ex1Main
ERROR: Missing header (©0©): ex1Main
ERROR: Parameters/result not specified in ex1Main: date datessince
WARNING: References to unknown functions in ex1Main:
toDay
6
It is all about structure – cont.
datessince„ex1Main date
©0©
©3© date
:
©4© datessince :
© Calculate dayes between today and specified date.
toDay„10000 100 100ƒ3†ŒTS
datessince„toDay-date
Comment conventions:
©0©
General description of function
©2©
Description of left argument
©3©
Description of right argument
©4©
Description of result
7
It is all about structure – cont.
Clean up:
datessince„ex1Main date;today
©0© Calculate days between today and specified date.
©3© date
: Reference date
©4© datessince : Days between reference date and today
today„10000 100 100ƒ3†ŒTS
datessince„today-date
CHK 'ex1Main'
Yes!
8
© ... Comply with standards ?
It is all about structure – cont.
But it is so hard to program in Power Point
so we go the dangerous way – live action!
9
Defined types in SimCorp Dimension
vtBOOL
Boolean. Valid values are bFALSE and bTRUE (wrapping 0 and 1).
vtCHAR
Character
vtDATE
APL internal date (integer of the form yyyymmdd).
vtDOMAIN(dDOMAIN)
Domain. Valid values are members of domain dDOMAIN.
vtDOUBLE
Floating point number.
vtENUM(APL expr.)
Enumeration. Valid values are the result of the enclosed APL
expression.
vtINT
Integer.
vtNULL
Null. Valid values are numeric null and text null.
vtSTRING
String of characters. Note that also a single character will be
accepted as a string.
vtTIME
APL Time of day fraction. Floating point number between 0 and 1.
vtTS
Full APL time stamp. Floating point number.
vtUINT
Unsigned integer.
vtVARIANT
The joker type. Variables not type declared are considered variants.
vtZERO
Zero. Valid values are – surprise – 0.
10
Defined types in SimCorp Dimension – cont.
The named variables types can be used in the function comment headers to
specify argument and result types. They can be grouped together to form more
complex variables, e.g,
{vtUINT {vtSTRING vtTS}}
A 2-vector consisting of an unsigned integer and a 2-vector consisting of a
string and a timestamp.
{vtDOUBLE vtDATE vtDOMAIN(dPRICETYPE)}
A 3-vector consisting of a float, a date and a domain value in the domain
dPRICETYPE.
11
Defined types in SimCorp Dimension – cont.
Arrays of different dimensions of a variable type can be specified using “[“, “]”
and “;”, e.g,
vtBOOL[]
A vector of Booleans.
vtINT[;]
A 2-dimensional array of integers.
vtSTRING[2-] A vector of length two or more containing strings.
12
Defined types in SimCorp Dimension – cont.
Sometimes several types are allowed for a variable. Use “|” to separate
different choices, e.g,
vtDATE|vtZERO
A scalar date or zero.
vtDOUBLE|vtNULL
A float or null.
Any combination of the above is allowed, e.g,
{vtDOUBLE|vtSTRING|vtNULL}[;5-10]
A matrix with between 5 and
10 columns containing a mix of floats, strings and nulls.
13
Defined types in SimCorp Dimension – cont.
It is possible to specify the shape of a variable relative to another variable in
the argument and result.
The main limitation is that the shape of a variable can only be specified relative
to an already declared variable, e.g,
fooGoo arg;flds;mat;opt
©0© A function.
©3© arg[1] : mat As vtDOUBLE[;]
: Matrix of floats
©3© [2] : flds As vtUINT[$3:mat:2] : Field list corresponding to <mat>
©3© [3] : opt As vtBOOL
: Option
©5© FST: VarTypes
mat flds opt„arg
14