Hello, welcome back to my blog about automated trading. Last week I
have covered the task scheduling. This week I will go through and various technologies (last week I told containers, but I really mean technologies (; ).
That's it for today. Next week I publish code for one trading algorithm. Thank you for reading!
Application set up
When I am developing my application I like to have nice dashboard and controls. Typically I do this through the web browser. Reason is, because it is easy and pretty independent. This gives me a lot of chices in terms of cloud providers, devices and browsers. I really like that.
For this I am using standard boing cmbination Tomcat & Spring MVC. Tomcat is a container which holds the environment. Spring gives life to the application. My ideology with spring is following - use it, don't over use it. Therefore I am using only these parts:
- Annotation configuration - so far I found this the simples
- Spring profiles - to be able change implementation of units based on value in property files
- Xml bean configuration - for beans coming from library
- Transactions - annotaion driven
- Scheduling
- Web security
- Jsp view resolver
- Integration with my batis - more below
Data access layer
During the application life cycle I need to persist the data. So I can stop application without worrying about the data loss. For this I am using PostgreSQL. Giving the amount of data I need to store and good functionality this is a right way.
Now more concrete I use MyBatis framework to access the database. I prefer this, because it gives me good control while keeping everything relatively simple. I like to create database schema manually. Now to connect MyBatis with application layer I use framework called em-dao. This framework gives me ability to write application code for Postgre database and in the same time having unit tests connected to in memory HyperSQL database.
Page rendering, css and javascript
To render web pages I am using Jsp. Pages itself are based on jQuery and Twitter Bootstrap. With control pages I am focusing on useability rather than on prettiness. Now to inject these components into my project I am using WebJars. WebJars is project which packages many of these components into a maven dependencies. Then in order to use some css or jsp I only need to include dependency in pom file and set up correct path in the jsp file. There is one catch tho. Some versions of Tomcat7 have a bug which makes this impossible. This has been fixed. So if you are doing this, then use the latest version.
For standardized processes and components like error handling, busy state, data loading and tables I am using framework called em-eac. This makes development much more simple.
That's it for today. Next week I publish code for one trading algorithm. Thank you for reading!