Menu

Technical Design

Developer (5)
user unknown

TODO: rewrite according to current implementation.

Here goes a rough tech design for 1.0 release prior its development.
It will include major refactoring to allow easy extensions for new host systems used by scanners and better code reuse. Refactor DB access for trackers. Allow multi-threading for checking player tools. Provide a single entry point for all tools (very basic UI).

1) new Java package organisation:
edu.usun.poker - base

Layers:

  • .integration.room.{networkname} - integration layer; for all functionality specific to poker rooms. {networkname}: entraction, fulltilt, ipoker, merge, ongame, pacific, party, stars.

  • .integration.tracker.{trackername} - integration layer; support for local tracker systems (HUD), like Poker Tracker 3,4, Holdem Manager 1,2. Usually, we are checking players against online host/tracking systems, get some data from there, process it and store in local tools caches and finally save result to HUD notes of the tracker we use locally. {trackername}: pt3, pt4, hm1, hm2

  • .integration.hostsystem.{online host ranking/stats system} - integration layer; support for online ranking/stats/tracking systems, such as OfficialPokerRankings (OPR), SharkScope, Poker Table Ratings (PTR), Poker Pro Labs (prolabs), etc. {online host system}: opr, sharkscope, prolabs, ptr

  • .integration.transport.{protocol} - transport layer for any kind of integration purposes and communication with any system via any protocol. The focus here is utilities for protocols, not specific systems. {protocol}: db - DBA access framework (JDBC by default); http - HTTP communication framework (HTTPUnit by default).

  • .tool.{toolname} - all actual tools (business logic): OPR Console, OPR Scan Tables, SharkScope Console, SharkScope Scan Tables, Poker Math, PTR scanners, Tournament Time Table, etc. Some of them can be grouped together. "toolname": "math" Poker Math tools; "timetable" - Tournament Timetables and any others in the future; "playerscan.{specific sub-system to integrate with}" all kind of player scanners via PTR (cash), OPR, SharkScope, ProLabs, etc goes here.

  • .config.* - all local configuration stuff for tools will go here, in future it will be able to work either with local file system only or additionally with internal PostgreSQL DB. In next releases with will be extended and further refactored under this root package.

  • .ui - all kind of future UI stuff for our tools will go here.

  • .log.{type of logs} - all logging system for these tools; {type of logs}: console - just a current basic System.out console output; log4j - in future a proper log4j logger will be added; ui - output for version of tools with UI.

2) Layers design

2.1) .integration.transport.db - DB Access Framework via JDBC, just copy pasted from very old internal project so might have serious flaws.

./DBAccess.java - framework for JDBC statements processing for select, updates, etc.
./ConnectionFactory.java - DB connection factory.
./IStatementInitializer.java - interface for all helpers to populate JDBC PreparedStatement.
./IDataProceeder.java - interface for all helpers to process JDBC ResultSet.

./postgresql/* - PostgreSQL customization
./PostgreSQLDBAccess.java - DBAccess extension specific for PostgreSQL integration.
./PostgreSQLConnectionFactory.java - connection factory for PostgreSQL. Data sources not supported there currently, just direct Connection creation via Class.forName for JDBC driver.

2.2) .integration.transport.http - HTTP communication related utils, HTTPUnit is a primary framework used.

./EncodingUtil.java - some basic encoding for HTTP requests and HTML/JSON/JS results.
./AeSimpleMD5.java - MD5 hashes simple implementation, mostly used to encode credentials in Cookies.

2.3) .integration.tracker - integration layer for local trackers (HUD).

./TrackerNote.java - data container for notes stored in trackers.
./TrackerPlayer.java - data container for players stored in trackers.
./TrackerPlayerMTTStats.java - (obsolete) data container for some MTT player stats stored in trackers.
./ITrackerPlayerInfoUtils.java - interface to access player related info in trackers.
./TrackerPlayerInfoUtilsBase.java - base default implementation for ITrackerPlayerInfoUtils.
./TrackerPlayerInfoUtilsBuilder.java - builder/factory to get ITrackerPlayerInfoUtils implementation specific to the currently configured tracker (POSTGRES_DB_TYPE config property).

./base/db/* - base default tracker DB integration.
./ITrackerDBManager.java - interface for any tracker DB manager.
./TrackerDBManagerBase.java - ITrackerDBManager implementation, base class for all DB managers implementations.
./ITrackerPlayerInfoDBManager.java - interface for DB managers that handle player information in tracker DB. Extends ITrackerDBManager.
./TrackerPlayerInfoDBManagerBase.java - base default implementation for ITrackerPlayerInfoDBManager. Adding player notes is done by removing old notes and adding a new one.
./TrackerPlayerInfoDBManagerBuilder.java - builder/factory to get ITrackerPlayerInfoDBManager implementation specific to the currently configured tracker (POSTGRES_DB_TYPE config property).
./GetPlayerHelper.java - helper to construct JDBC request and parse response for player retrieval from tracker DB.
./GetPlayerNotesHelper.java - helper to construct JDBC request and parse response for player notes retrieval from tracker DB.
./AddPlayerNotesHelper.java - helper to construct JDBC request and parse response to create player notes in tracker DB.
./DeletePlayerNotesHelper.java - helper to construct JDBC request and parse response to delete player notes from tracker DB.

./hm1/* - Hold Manager 1 specific integration.
./HM1TrackerPlayerInfoUtils.java - Holdem Manager 1 specific implementation for ITrackerPlayerInfoUtils.
./db/HM1TrackerPlayerInfoDBManager.java - Holdem Manager 1 specific implementation for ITrackerPlayerInfoDBManager.

./hm2/* - Hold Manager 2 specific integration.
./HM2TrackerPlayerInfoUtils.java - Holdem Manager 2 specific implementation for ITrackerPlayerInfoUtils.
./db/HM2TrackerPlayerInfoDBManager.java - Holdem Manager 2 specific implementation for ITrackerPlayerInfoDBManager.

./pt3/* - Poker Tracker 3 specific integration.
./PT3TrackerPlayerInfoUtils.java - Poker Tracker 3 specific implementation for ITrackerPlayerInfoUtils.
./db/PT3TrackerPlayerInfoDBManager.java - Poker Tracker 3 specific implementation for ITrackerPlayerInfoDBManager. Default logic for adding player notes was overriden - old notes are not deleted, just adding new one.
./db/GetPlayersForLimitByMinHandsQuantityHelper.java - (obsolete) helper to construct JDBC request and parse response to retrieve players for some cash limit based on requested criteria from tracker DB.
./db/GetPlayerMTTStatsHelper.java - (obsolete) helper to construct JDBC request and parse response to retrieve player MTT stats from tracker DB.

./pt4/* - Poker Tracker 4 specific integration.
./PT4TrackerPlayerInfoUtils.java - Poker Tracker 4 specific implementation for ITrackerPlayerInfoUtils.
./db/PT4TrackerPlayerInfoDBManager.java - Poker Tracker 4 specific implementation for ITrackerPlayerInfoDBManager. Default logic for adding player notes was overriden - additional flags are set for player, that he has notes.
./db/UpdatePlayerWithNotesFlags.java - helper to construct JDBC request and parse response to update player with flags that a note was set for him.

2.5) .integration.hostsystem.* - integration layer for online ranking/stats/tracking systems.

TBD

2.6) .tool.* - all tools (business logic)
./IPokerTool.java - basic interface for all tools.
./PokerToolBase.java - IPokerTool base implementation.
./PokerToolBuilder.java - constructs IPokerTool implementations, for now instances are cached and only 1 instance of each tool allowed to exist on the runtime.

./messenger/* - integration with usunmessenger framework for multi-thread tasks (player scans) processing.
./MessengerPokerToolBase.java - IPokerTool implementation for all tools that are going to be integrated with usunmessenger framework


Related

Wiki: Developers Guide

MongoDB Logo MongoDB