Skip to content
Browse files

issue #28 - rename all interfaces (and their files) to start with "I"

  • Loading branch information...
1 parent 3baa484 commit f79bf3daec2eed7961572a12809ccc226585024a @gbirchmeier gbirchmeier committed Nov 26, 2012
Showing with 470 additions and 434 deletions.
  1. +1 −1 AcceptanceTest/ATApplication.cs
  2. +2 −2 AcceptanceTest/ATRunner.cs
  3. +1 −1 Examples/Executor/Executor.cs
  4. +3 −3 Examples/Executor/Program.cs
  5. +3 −3 Examples/SimpleAcceptor/Program.cs
  6. +1 −1 Examples/SimpleAcceptor/SimpleAcceptorApp.cs
  7. +2 −2 Examples/TradeClient/Program.cs
  8. +1 −1 Examples/TradeClient/TradeClientApp.cs
  9. +3 −3 QuickFIXn/AbstractInitiator.cs
  10. +24 −24 QuickFIXn/Applications/FIX4Application.cs
  11. +22 −22 QuickFIXn/Applications/FIX5Application.cs
  12. +1 −1 QuickFIXn/ClientHandlerThread.cs
  13. 0 QuickFIXn/DataDictionary/{FieldMapSpec.cs → IFieldMapSpec.cs}
  14. 0 QuickFIXn/DataDictionary/{GroupSpec.cs → IGroupSpec.cs}
  15. +1 −1 QuickFIXn/FileLog.cs
  16. +2 −2 QuickFIXn/FileLogFactory.cs
  17. +1 −1 QuickFIXn/FileStore.cs
  18. +34 −34 QuickFIXn/FileStoreFactory.cs
  19. +1 −2 QuickFIXn/IAcceptor.cs
  20. +104 −98 QuickFIXn/{Application.cs → IApplication.cs}
  21. +7 −1 QuickFIXn/{Log.cs → ILog.cs}
  22. +8 −2 QuickFIXn/{LogFactory.cs → ILogFactory.cs}
  23. +7 −1 QuickFIXn/{MessageStore.cs → IMessageStore.cs}
  24. +8 −2 QuickFIXn/{MessageStoreFactory.cs → IMessageStoreFactory.cs}
  25. +7 −1 QuickFIXn/{Responder.cs → IResponder.cs}
  26. +1 −1 QuickFIXn/MemoryStore.cs
  27. +2 −2 QuickFIXn/MemoryStoreFactory.cs
  28. +22 −22 QuickFIXn/NullApplication.cs
  29. +25 −25 QuickFIXn/NullLog.cs
  30. +8 −8 QuickFIXn/QuickFix.csproj
  31. +63 −63 QuickFIXn/ScreenLog.cs
  32. +51 −51 QuickFIXn/ScreenLogFactory.cs
  33. +7 −7 QuickFIXn/Session.cs
  34. +6 −6 QuickFIXn/SessionFactory.cs
  35. +4 −4 QuickFIXn/SessionState.cs
  36. +1 −1 QuickFIXn/SocketInitiatorThread.cs
  37. +3 −3 QuickFIXn/ThreadedSocketAcceptor.cs
  38. +6 −6 QuickFIXn/Transport/SocketInitiator.cs
  39. +8 −8 UnitTests/SessionFactoryTest.cs
  40. +2 −2 UnitTests/SessionTest.cs
  41. +7 −6 tutorial/compatibility.md
  42. +7 −7 tutorial/creating-an-application.md
  43. +3 −3 tutorial/receiving-messages.md
View
2 AcceptanceTest/ATApplication.cs
@@ -3,7 +3,7 @@
namespace AcceptanceTest
{
- public class ATApplication : MessageCracker, Application
+ public class ATApplication : MessageCracker, IApplication
{
public event System.Action StopMeEvent;
View
4 AcceptanceTest/ATRunner.cs
@@ -23,8 +23,8 @@ static void Main(string[] args)
testApp.StopMeEvent += new System.Action(delegate() { _stopMe = true; });
SessionSettings settings = new SessionSettings(args[0]);
- MessageStoreFactory storeFactory = new FileStoreFactory(settings);
- LogFactory logFactory = null;
+ IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
+ ILogFactory logFactory = null;
if (settings.Get().Has("Verbose") && settings.Get().GetBool("Verbose"))
logFactory = new FileLogFactory(settings);
acceptor = new ThreadedSocketAcceptor(testApp, storeFactory, settings, logFactory);
View
2 Examples/Executor/Executor.cs
@@ -8,7 +8,7 @@
namespace Executor
{
- public class Executor : QuickFix.MessageCracker, QuickFix.Application
+ public class Executor : QuickFix.MessageCracker, QuickFix.IApplication
{
static readonly decimal DEFAULT_MARKET_PRICE = 10;
View
6 Examples/Executor/Program.cs
@@ -24,9 +24,9 @@ static void Main(string[] args)
try
{
SessionSettings settings = new SessionSettings(args[0]);
- Application executorApp = new Executor();
- MessageStoreFactory storeFactory = new FileStoreFactory(settings);
- LogFactory logFactory = new FileLogFactory(settings);
+ IApplication executorApp = new Executor();
+ IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
+ ILogFactory logFactory = new FileLogFactory(settings);
ThreadedSocketAcceptor acceptor = new ThreadedSocketAcceptor(executorApp, storeFactory, settings, logFactory);
acceptor.Start();
View
6 Examples/SimpleAcceptor/Program.cs
@@ -30,9 +30,9 @@ static void Main(string[] args)
try
{
SessionSettings settings = new SessionSettings(args[0]);
- Application app = new SimpleAcceptorApp();
- MessageStoreFactory storeFactory = new FileStoreFactory(settings);
- LogFactory logFactory = new FileLogFactory(settings);
+ IApplication app = new SimpleAcceptorApp();
+ IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
+ ILogFactory logFactory = new FileLogFactory(settings);
IAcceptor acceptor = new ThreadedSocketAcceptor(app, storeFactory, settings, logFactory);
acceptor.Start();
View
2 Examples/SimpleAcceptor/SimpleAcceptorApp.cs
@@ -14,7 +14,7 @@ namespace SimpleAcceptor
/// Note that this app is *NOT* a message cracker.
/// </summary>
- public class SimpleAcceptorApp : /*QuickFix.MessageCracker,*/ QuickFix.Application
+ public class SimpleAcceptorApp : /*QuickFix.MessageCracker,*/ QuickFix.IApplication
{
#region QuickFix.Application Methods
View
4 Examples/TradeClient/Program.cs
@@ -31,8 +31,8 @@ static void Main(string[] args)
{
QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file);
TradeClientApp application = new TradeClientApp();
- QuickFix.MessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
- QuickFix.LogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
+ QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
+ QuickFix.ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);
initiator.Start();
application.Run();
View
2 Examples/TradeClient/TradeClientApp.cs
@@ -4,7 +4,7 @@
namespace TradeClient
{
- public class TradeClientApp : QuickFix.MessageCracker, QuickFix.Application
+ public class TradeClientApp : QuickFix.MessageCracker, QuickFix.IApplication
{
public enum FixVersion { FIX40, FIX41, FIX42, FIX43, FIX44, FIX50 }
View
6 QuickFIXn/AbstractInitiator.cs
@@ -24,15 +24,15 @@ public bool IsStopped
#endregion
- public AbstractInitiator(Application app, MessageStoreFactory storeFactory, SessionSettings settings)
+ public AbstractInitiator(IApplication app, IMessageStoreFactory storeFactory, SessionSettings settings)
: this(app, storeFactory, settings, null, null)
{ }
- public AbstractInitiator(Application app, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory)
+ public AbstractInitiator(IApplication app, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory)
: this(app, storeFactory, settings, logFactory, null)
{ }
- public AbstractInitiator(Application app, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory, IMessageFactory messageFactory)
+ public AbstractInitiator(IApplication app, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory, IMessageFactory messageFactory)
{
settings_ = settings;
View
48 QuickFIXn/Applications/FIX4Application.cs
@@ -1,24 +1,24 @@
-
-namespace QuickFix.Applications
-{
- public class FIX4Application : Application
- {
- public FIX4Application() { }
-
- public void FromAdmin(Message message, SessionID sessionID)
- {
- System.Diagnostics.Debug.WriteLine("Received FIX admin message: " + message.ToString());
- }
-
- public void FromApp(Message message, SessionID sessionID)
- {
- System.Diagnostics.Debug.WriteLine("Received FIX app message: " + message.ToString());
- }
-
- public void OnCreate(SessionID sessionID) { }
- public void OnLogout(SessionID sessionID) { }
- public void OnLogon(SessionID sessionID) { }
- public void ToAdmin(Message message, SessionID sessionID) { }
- public void ToApp(Message message, SessionID sessionID) { }
- }
-}
+
+namespace QuickFix.Applications
+{
+ public class FIX4Application : IApplication
+ {
+ public FIX4Application() { }
+
+ public void FromAdmin(Message message, SessionID sessionID)
+ {
+ System.Diagnostics.Debug.WriteLine("Received FIX admin message: " + message.ToString());
+ }
+
+ public void FromApp(Message message, SessionID sessionID)
+ {
+ System.Diagnostics.Debug.WriteLine("Received FIX app message: " + message.ToString());
+ }
+
+ public void OnCreate(SessionID sessionID) { }
+ public void OnLogout(SessionID sessionID) { }
+ public void OnLogon(SessionID sessionID) { }
+ public void ToAdmin(Message message, SessionID sessionID) { }
+ public void ToApp(Message message, SessionID sessionID) { }
+ }
+}
View
44 QuickFIXn/Applications/FIX5Application.cs
@@ -1,22 +1,22 @@
-
-namespace QuickFix.Applications
-{
- public class FIX5Application : Application
- {
- public void FromAdmin(Message message, SessionID sessionID)
- {
- System.Diagnostics.Debug.WriteLine("Received FIX admin message: " + message.ToString());
- }
-
- public void FromApp(Message message, SessionID sessionID)
- {
- System.Diagnostics.Debug.WriteLine("Received FIX app message: " + message.ToString());
- }
-
- public void OnCreate(SessionID sessionID) { }
- public void OnLogout(SessionID sessionID) { }
- public void OnLogon(SessionID sessionID) { }
- public void ToAdmin(Message message, SessionID sessionID) { }
- public void ToApp(Message message, SessionID sessionID) { }
- }
-}
+
+namespace QuickFix.Applications
+{
+ public class FIX5Application : IApplication
+ {
+ public void FromAdmin(Message message, SessionID sessionID)
+ {
+ System.Diagnostics.Debug.WriteLine("Received FIX admin message: " + message.ToString());
+ }
+
+ public void FromApp(Message message, SessionID sessionID)
+ {
+ System.Diagnostics.Debug.WriteLine("Received FIX app message: " + message.ToString());
+ }
+
+ public void OnCreate(SessionID sessionID) { }
+ public void OnLogout(SessionID sessionID) { }
+ public void OnLogon(SessionID sessionID) { }
+ public void ToAdmin(Message message, SessionID sessionID) { }
+ public void ToApp(Message message, SessionID sessionID) { }
+ }
+}
View
2 QuickFIXn/ClientHandlerThread.cs
@@ -11,7 +11,7 @@ namespace QuickFix
/// Each ClientHandlerThread has a SocketReader which reads
/// from the socket.
/// </summary>
- public class ClientHandlerThread : Responder
+ public class ClientHandlerThread : IResponder
{
private Thread thread_ = null;
private volatile bool isShutdownRequested_ = false;
View
0 QuickFIXn/DataDictionary/FieldMapSpec.cs → QuickFIXn/DataDictionary/IFieldMapSpec.cs
File renamed without changes.
View
0 QuickFIXn/DataDictionary/GroupSpec.cs → QuickFIXn/DataDictionary/IGroupSpec.cs
File renamed without changes.
View
2 QuickFIXn/FileLog.cs
@@ -4,7 +4,7 @@ namespace QuickFix
/// <summary>
/// File log implementation
/// </summary>
- public class FileLog : Log, System.IDisposable
+ public class FileLog : ILog, System.IDisposable
{
private object sync_ = new object();
View
4 QuickFIXn/FileLogFactory.cs
@@ -4,7 +4,7 @@ namespace QuickFix
/// <summary>
/// Creates a message store that stores messages in a file
/// </summary>
- public class FileLogFactory : LogFactory
+ public class FileLogFactory : ILogFactory
{
SessionSettings settings_;
@@ -20,7 +20,7 @@ public FileLogFactory(SessionSettings settings)
/// </summary>
/// <param name="sessionID">session ID for the message store</param>
/// <returns></returns>
- public Log Create(SessionID sessionID)
+ public ILog Create(SessionID sessionID)
{
return new FileLog(settings_.Get(sessionID).GetString(SessionSettings.FILE_LOG_PATH), sessionID);
}
View
2 QuickFIXn/FileStore.cs
@@ -7,7 +7,7 @@ namespace QuickFix
/// <summary>
/// File store implementation
/// </summary>
- public class FileStore : MessageStore, IDisposable
+ public class FileStore : IMessageStore, IDisposable
{
private class MsgDef
{
View
68 QuickFIXn/FileStoreFactory.cs
@@ -1,34 +1,34 @@
-
-namespace QuickFix
-{
- /// <summary>
- /// Creates a message store that stores messages in a file
- /// </summary>
- public class FileStoreFactory : MessageStoreFactory
- {
- private SessionSettings settings_;
-
- /// <summary>
- /// Create the factory with configuration in session settings
- /// </summary>
- /// <param name="settings"></param>
- public FileStoreFactory(SessionSettings settings)
- {
- settings_ = settings;
- }
-
- #region MessageStoreFactory Members
-
- /// <summary>
- /// Creates a file-based message store
- /// </summary>
- /// <param name="sessionID">session ID for the message store</param>
- /// <returns></returns>
- public MessageStore Create(SessionID sessionID)
- {
- return new FileStore(settings_.Get(sessionID).GetString(SessionSettings.FILE_STORE_PATH), sessionID);
- }
-
- #endregion
- }
-}
+
+namespace QuickFix
+{
+ /// <summary>
+ /// Creates a message store that stores messages in a file
+ /// </summary>
+ public class FileStoreFactory : IMessageStoreFactory
+ {
+ private SessionSettings settings_;
+
+ /// <summary>
+ /// Create the factory with configuration in session settings
+ /// </summary>
+ /// <param name="settings"></param>
+ public FileStoreFactory(SessionSettings settings)
+ {
+ settings_ = settings;
+ }
+
+ #region MessageStoreFactory Members
+
+ /// <summary>
+ /// Creates a file-based message store
+ /// </summary>
+ /// <param name="sessionID">session ID for the message store</param>
+ /// <returns></returns>
+ public IMessageStore Create(SessionID sessionID)
+ {
+ return new FileStore(settings_.Get(sessionID).GetString(SessionSettings.FILE_STORE_PATH), sessionID);
+ }
+
+ #endregion
+ }
+}
View
3 QuickFIXn/IAcceptor.cs
@@ -44,8 +44,7 @@ public interface IAcceptor
}
/// <summary>
- /// Deprecated due to violation of naming convention; will be removed in next major release.
- /// It is replaced by IAcceptor, from which it directly derives.
+ /// (Renamed per naming convention.)
/// </summary>
[System.Obsolete("Use IAcceptor instead")]
public interface Acceptor : IAcceptor
View
202 QuickFIXn/Application.cs → QuickFIXn/IApplication.cs
@@ -1,98 +1,104 @@
-
-namespace QuickFix
-{
- /// <summary>
- /// This is the primary interface for processing session messages.
- /// </summary>
- public interface Application
- {
- /// <summary>
- /// This callback provides you with a peek at the administrative messages
- /// that are being sent from your FIX engine to the counter party. This is
- /// normally not useful for an application however it is provided for any
- /// logging you may wish to do. You may add fields in an adminstrative
- /// message before it is sent.
- /// </summary>
- /// <param name="message"></param>
- /// <param name="sessionID"></param>
- void ToAdmin(Message message, SessionID sessionID);
-
- /// <summary>
- /// This callback notifies you when an administrative message is sent from a
- /// counterparty to your FIX engine. This can be usefull for doing extra
- /// validation on logon messages such as for checking passwords. Throwing a
- /// RejectLogon exception will disconnect the counterparty.
- /// </summary>
- /// <param name="message"></param>
- /// <param name="sessionID"></param>
- /// <exception cref="RejectLogon">throw this to reject a login</exception>
- void FromAdmin(Message message, SessionID sessionID);
-
- /// <summary>
- /// This is a callback for application messages that you are sending to a
- /// counterparty. If you throw a DoNotSend exception in this function, the
- /// application will not send the message. This is mostly useful if the
- /// application has been asked to resend a message such as an order that is
- /// no longer relevant for the current market. Messages that are being resent
- /// are marked with the PossDupFlag in the header set to true; If a DoNotSend
- /// exception is thrown and the flag is set to true, a sequence reset will be
- /// sent in place of the message. If it is set to false, the message will
- /// simply not be sent. You may add fields before an application message
- /// before it is sent out.
- /// </summary>
- /// <param name="message"></param>
- /// <param name="sessionId"></param>
- /// <exception cref="DoNotSend">throw this to abort sending the message</exception>
- void ToApp(Message message, SessionID sessionId);
-
- /// <summary>
- /// This callback receives messages for the application. This is one of the
- /// core entry points for your FIX application. Every application level
- /// request will come through here. If, for example, your application is a
- /// sell-side OMS, this is where you will get your new order requests. If you
- /// were a buy side, you would get your execution reports here. If a
- /// FieldNotFound exception is thrown, the counterparty will receive a reject
- /// indicating a conditionally required field is missing. The Message class
- /// will throw this exception when trying to retrieve a missing field, so you
- /// will rarely need the throw this explicitly. You can also throw an
- /// UnsupportedMessageType exception. This will result in the counterparty
- /// getting a business reject informing them your application cannot process
- /// those types of messages. An IncorrectTagValue can also be thrown if a
- /// field contains a value that is out of range or you do not support.
- /// </summary>
- /// <param name="message"></param>
- /// <param name="sessionID"></param>
- /// <exception cref="FieldNotFoundException">throw this to notify counterparty is missing a required field</exception>
- /// <exception cref="UnsupportedMessageType">throw this to notify counterparty we can't process this message</exception>
- /// <exception cref="IncorrectTagValue">throw this to notify counterparty that a field contains an incorrect value</exception>
- void FromApp(Message message, SessionID sessionID);
-
- /// <summary>
- /// This method is called when quickfix creates a new session. A session
- /// comes into and remains in existence for the life of the application.
- /// Sessions exist whether or not a counter party is connected to it. As soon
- /// as a session is created, you can begin sending messages to it. If no one
- /// is logged on, the messages will be sent at the time a connection is
- /// established with the counterparty.
- /// </summary>
- /// <param name="sessionID"></param>
- void OnCreate(SessionID sessionID);
-
- /// <summary>
- /// This callback notifies you when an FIX session is no longer online. This
- /// could happen during a normal logout exchange or because of a forced
- /// termination or a loss of network connection.
- /// </summary>
- /// <param name="sessionID"></param>
- void OnLogout(SessionID sessionID);
-
- /// <summary>
- /// This callback notifies you when a valid logon has been established with a
- /// counter party. This is called when a connection has been established and
- /// the FIX logon process has completed with both parties exchanging valid
- /// logon messages.
- /// </summary>
- /// <param name="sessionID"></param>
- void OnLogon(SessionID sessionID);
- }
-}
+
+namespace QuickFix
+{
+ /// <summary>
+ /// (Renamed per naming convention.)
+ /// </summary>
+ [System.Obsolete("Use IApplication instead.")]
+ public interface Application : IApplication { }
+
+ /// <summary>
+ /// This is the primary interface for processing session messages.
+ /// </summary>
+ public interface IApplication
+ {
+ /// <summary>
+ /// This callback provides you with a peek at the administrative messages
+ /// that are being sent from your FIX engine to the counter party. This is
+ /// normally not useful for an application however it is provided for any
+ /// logging you may wish to do. You may add fields in an adminstrative
+ /// message before it is sent.
+ /// </summary>
+ /// <param name="message"></param>
+ /// <param name="sessionID"></param>
+ void ToAdmin(Message message, SessionID sessionID);
+
+ /// <summary>
+ /// This callback notifies you when an administrative message is sent from a
+ /// counterparty to your FIX engine. This can be usefull for doing extra
+ /// validation on logon messages such as for checking passwords. Throwing a
+ /// RejectLogon exception will disconnect the counterparty.
+ /// </summary>
+ /// <param name="message"></param>
+ /// <param name="sessionID"></param>
+ /// <exception cref="RejectLogon">throw this to reject a login</exception>
+ void FromAdmin(Message message, SessionID sessionID);
+
+ /// <summary>
+ /// This is a callback for application messages that you are sending to a
+ /// counterparty. If you throw a DoNotSend exception in this function, the
+ /// application will not send the message. This is mostly useful if the
+ /// application has been asked to resend a message such as an order that is
+ /// no longer relevant for the current market. Messages that are being resent
+ /// are marked with the PossDupFlag in the header set to true; If a DoNotSend
+ /// exception is thrown and the flag is set to true, a sequence reset will be
+ /// sent in place of the message. If it is set to false, the message will
+ /// simply not be sent. You may add fields before an application message
+ /// before it is sent out.
+ /// </summary>
+ /// <param name="message"></param>
+ /// <param name="sessionId"></param>
+ /// <exception cref="DoNotSend">throw this to abort sending the message</exception>
+ void ToApp(Message message, SessionID sessionId);
+
+ /// <summary>
+ /// This callback receives messages for the application. This is one of the
+ /// core entry points for your FIX application. Every application level
+ /// request will come through here. If, for example, your application is a
+ /// sell-side OMS, this is where you will get your new order requests. If you
+ /// were a buy side, you would get your execution reports here. If a
+ /// FieldNotFound exception is thrown, the counterparty will receive a reject
+ /// indicating a conditionally required field is missing. The Message class
+ /// will throw this exception when trying to retrieve a missing field, so you
+ /// will rarely need the throw this explicitly. You can also throw an
+ /// UnsupportedMessageType exception. This will result in the counterparty
+ /// getting a business reject informing them your application cannot process
+ /// those types of messages. An IncorrectTagValue can also be thrown if a
+ /// field contains a value that is out of range or you do not support.
+ /// </summary>
+ /// <param name="message"></param>
+ /// <param name="sessionID"></param>
+ /// <exception cref="FieldNotFoundException">throw this to notify counterparty is missing a required field</exception>
+ /// <exception cref="UnsupportedMessageType">throw this to notify counterparty we can't process this message</exception>
+ /// <exception cref="IncorrectTagValue">throw this to notify counterparty that a field contains an incorrect value</exception>
+ void FromApp(Message message, SessionID sessionID);
+
+ /// <summary>
+ /// This method is called when quickfix creates a new session. A session
+ /// comes into and remains in existence for the life of the application.
+ /// Sessions exist whether or not a counter party is connected to it. As soon
+ /// as a session is created, you can begin sending messages to it. If no one
+ /// is logged on, the messages will be sent at the time a connection is
+ /// established with the counterparty.
+ /// </summary>
+ /// <param name="sessionID"></param>
+ void OnCreate(SessionID sessionID);
+
+ /// <summary>
+ /// This callback notifies you when an FIX session is no longer online. This
+ /// could happen during a normal logout exchange or because of a forced
+ /// termination or a loss of network connection.
+ /// </summary>
+ /// <param name="sessionID"></param>
+ void OnLogout(SessionID sessionID);
+
+ /// <summary>
+ /// This callback notifies you when a valid logon has been established with a
+ /// counter party. This is called when a connection has been established and
+ /// the FIX logon process has completed with both parties exchanging valid
+ /// logon messages.
+ /// </summary>
+ /// <param name="sessionID"></param>
+ void OnLogon(SessionID sessionID);
+ }
+}
View
8 QuickFIXn/Log.cs → QuickFIXn/ILog.cs
@@ -2,9 +2,15 @@
namespace QuickFix
{
/// <summary>
+ /// (Renamed per naming convention.)
+ /// </summary>
+ [System.Obsolete("Use ILog instead.")]
+ public interface Log : ILog { }
+
+ /// <summary>
/// Session log for messages and events
/// </summary>
- public interface Log
+ public interface ILog
{
/// <summary>
/// Clears the log and removes any persistent log data
View
10 QuickFIXn/LogFactory.cs → QuickFIXn/ILogFactory.cs
@@ -2,15 +2,21 @@
namespace QuickFix
{
/// <summary>
+ /// (Renamed per naming convention.)
+ /// </summary>
+ [System.Obsolete("Use ILogFactory instead.")]
+ public interface LogFactory : ILogFactory { }
+
+ /// <summary>
/// Used by a session to create a log implementation
/// </summary>
- public interface LogFactory
+ public interface ILogFactory
{
/// <summary>
/// Create a log implementation
/// </summary>
/// <param name="sessionID">session ID usually used for configuration access</param>
/// <returns></returns>
- Log Create(SessionID sessionID);
+ ILog Create(SessionID sessionID);
}
}
View
8 QuickFIXn/MessageStore.cs → QuickFIXn/IMessageStore.cs
@@ -5,9 +5,15 @@ namespace QuickFix
/// FIXME v2 - property-ize all of these get/set functions
/// <summary>
+ /// (Renamed per naming convention.)
+ /// </summary>
+ [System.Obsolete("Use IMessageStore instead.")]
+ public interface MessageStore : IMessageStore { }
+
+ /// <summary>
/// Used by a Session to store and retrieve messages for resend purposes
/// </summary>
- public interface MessageStore
+ public interface IMessageStore
{
/// <summary>
/// Get messages within sequence number range (inclusive). Used for
View
10 QuickFIXn/MessageStoreFactory.cs → QuickFIXn/IMessageStoreFactory.cs
@@ -2,15 +2,21 @@
namespace QuickFix
{
/// <summary>
+ /// (Renamed per naming convention.)
+ /// </summary>
+ [System.Obsolete("Use IMessageStoreFactory instead.")]
+ public interface MessageStoreFactory : IMessageStoreFactory { }
+
+ /// <summary>
/// Used by a Session to create a message store implementation
/// </summary>
- public interface MessageStoreFactory
+ public interface IMessageStoreFactory
{
/// <summary>
/// Creates a message store implementation
/// </summary>
/// <param name="sessionID">the session ID, often used to access session configurations</param>
/// <returns>the message store implementation</returns>
- MessageStore Create(SessionID sessionID);
+ IMessageStore Create(SessionID sessionID);
}
}
View
8 QuickFIXn/Responder.cs → QuickFIXn/IResponder.cs
@@ -2,10 +2,16 @@
namespace QuickFix
{
/// <summary>
+ /// (Renamed per naming convention.)
+ /// </summary>
+ [System.Obsolete("Use IResponder instead.")]
+ public interface Responder : IResponder { }
+
+ /// <summary>
/// Used by a Session to send raw FIX message data and to disconnect a
/// connection. This interface is used by Acceptor or Initiator implementations.
/// </summary>
- public interface Responder
+ public interface IResponder
{
/// <summary>
/// Sends a raw FIX message
View
2 QuickFIXn/MemoryStore.cs
@@ -6,7 +6,7 @@ namespace QuickFix
/// <summary>
/// In-memory message store implementation
/// </summary>
- public class MemoryStore : MessageStore
+ public class MemoryStore : IMessageStore
{
#region Private Members
View
4 QuickFIXn/MemoryStoreFactory.cs
@@ -4,11 +4,11 @@ namespace QuickFix
/// <summary>
/// Creates a message store that stores all data in memory
/// </summary>
- public class MemoryStoreFactory : MessageStoreFactory
+ public class MemoryStoreFactory : IMessageStoreFactory
{
#region MessageStoreFactory Members
- public MessageStore Create(SessionID sessionID)
+ public IMessageStore Create(SessionID sessionID)
{
return new MemoryStore();
}
View
44 QuickFIXn/NullApplication.cs
@@ -1,22 +1,22 @@
-
-namespace QuickFix
-{
- /// <summary>
- /// Application implementation that does not do anything.
- /// Useful for unit testing.
- /// </summary>
- public class NullApplication : Application
- {
- public void FromAdmin(Message message, SessionID sessionID)
- { }
-
- public void FromApp(Message message, SessionID sessionID)
- { }
-
- public void OnCreate(SessionID sessionID) { }
- public void OnLogout(SessionID sessionID) { }
- public void OnLogon(SessionID sessionID) { }
- public void ToAdmin(Message message, SessionID sessionID) { }
- public void ToApp(Message message, SessionID sessionID) { }
- }
-}
+
+namespace QuickFix
+{
+ /// <summary>
+ /// Application implementation that does not do anything.
+ /// Useful for unit testing.
+ /// </summary>
+ public class NullApplication : IApplication
+ {
+ public void FromAdmin(Message message, SessionID sessionID)
+ { }
+
+ public void FromApp(Message message, SessionID sessionID)
+ { }
+
+ public void OnCreate(SessionID sessionID) { }
+ public void OnLogout(SessionID sessionID) { }
+ public void OnLogon(SessionID sessionID) { }
+ public void ToAdmin(Message message, SessionID sessionID) { }
+ public void ToApp(Message message, SessionID sessionID) { }
+ }
+}
View
50 QuickFIXn/NullLog.cs
@@ -1,25 +1,25 @@
-
-namespace QuickFix
-{
- /// <summary>
- /// Log implementation that does not do anything
- /// </summary>
- public class NullLog : Log
- {
- #region Log Members
-
- public void Clear()
- { }
-
- public void OnIncoming(string msg)
- { }
-
- public void OnOutgoing(string msg)
- { }
-
- public void OnEvent(string s)
- { }
-
- #endregion
- }
-}
+
+namespace QuickFix
+{
+ /// <summary>
+ /// Log implementation that does not do anything
+ /// </summary>
+ public class NullLog : ILog
+ {
+ #region Log Members
+
+ public void Clear()
+ { }
+
+ public void OnIncoming(string msg)
+ { }
+
+ public void OnOutgoing(string msg)
+ { }
+
+ public void OnEvent(string s)
+ { }
+
+ #endregion
+ }
+}
View
16 QuickFIXn/QuickFix.csproj
@@ -47,14 +47,13 @@
</Reference>
</ItemGroup>
<ItemGroup>
+ <Compile Include="DataDictionary\IFieldMapSpec.cs" />
+ <Compile Include="DataDictionary\IGroupSpec.cs" />
<Compile Include="IAcceptor.cs" />
- <Compile Include="Application.cs" />
<Compile Include="Applications\FIX4Application.cs" />
<Compile Include="Applications\FIX5Application.cs" />
<Compile Include="ClientHandlerThread.cs" />
<Compile Include="DataDictionaryProvider.cs" />
- <Compile Include="DataDictionary\FieldMapSpec.cs" />
- <Compile Include="DataDictionary\GroupSpec.cs" />
<Compile Include="DataDictionary\DataDictionary.cs" />
<Compile Include="DataDictionary\DDField.cs" />
<Compile Include="DataDictionary\DDMap.cs" />
@@ -66,16 +65,18 @@
<Compile Include="FileStore.cs" />
<Compile Include="FileStoreFactory.cs" />
<Compile Include="FixValues.cs" />
+ <Compile Include="IApplication.cs" />
<Compile Include="IInitiator.cs" />
+ <Compile Include="ILog.cs" />
+ <Compile Include="ILogFactory.cs" />
<Compile Include="IMessageFactory.cs" />
<Compile Include="AbstractInitiator.cs" />
- <Compile Include="Log.cs" />
- <Compile Include="LogFactory.cs" />
+ <Compile Include="IMessageStore.cs" />
+ <Compile Include="IMessageStoreFactory.cs" />
+ <Compile Include="IResponder.cs" />
<Compile Include="MemoryStore.cs" />
<Compile Include="MemoryStoreFactory.cs" />
<Compile Include="MessageCracker.cs" />
- <Compile Include="MessageStore.cs" />
- <Compile Include="MessageStoreFactory.cs" />
<Compile Include="Config\Config.cs" />
<Compile Include="Config\Settings.cs" />
<Compile Include="DataDictionary\DictionaryParseException.cs" />
@@ -108,7 +109,6 @@
<Compile Include="Parser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResendRange.cs" />
- <Compile Include="Responder.cs" />
<Compile Include="ScreenLog.cs" />
<Compile Include="ScreenLogFactory.cs" />
<Compile Include="Session.cs">
View
126 QuickFIXn/ScreenLog.cs
@@ -1,63 +1,63 @@
-
-namespace QuickFix
-{
- /// <summary>
- /// FIXME - needs to log sessionIDs, timestamps, etc.
- /// </summary>
- public class ScreenLog : Log
- {
- private object sync_ = new object();
- private SessionID sessionID_;
- private bool logIncoming_;
- private bool logOutgoing_;
- private bool logEvent_;
-
- public ScreenLog(SessionID sessionID, bool logIncoming, bool logOutgoing, bool logEvent)
- {
- sessionID_ = sessionID;
- logIncoming_ = logIncoming;
- logOutgoing_ = logOutgoing;
- logEvent_ = logEvent;
- }
-
- #region Log Members
-
- public void Clear()
- { }
-
- public void OnIncoming(string msg)
- {
- if (!logIncoming_)
- return;
-
- lock (sync_)
- {
- System.Console.WriteLine("<incoming> " + msg);
- }
- }
-
- public void OnOutgoing(string msg)
- {
- if (!logOutgoing_)
- return;
-
- lock (sync_)
- {
- System.Console.WriteLine("<outgoing> " + msg);
- }
- }
-
- public void OnEvent(string s)
- {
- if (!logEvent_)
- return;
-
- lock (sync_)
- {
- System.Console.WriteLine("<event> " + s);
- }
- }
-
- #endregion
- }
-}
+
+namespace QuickFix
+{
+ /// <summary>
+ /// FIXME - needs to log sessionIDs, timestamps, etc.
+ /// </summary>
+ public class ScreenLog : ILog
+ {
+ private object sync_ = new object();
+ private SessionID sessionID_;
+ private bool logIncoming_;
+ private bool logOutgoing_;
+ private bool logEvent_;
+
+ public ScreenLog(SessionID sessionID, bool logIncoming, bool logOutgoing, bool logEvent)
+ {
+ sessionID_ = sessionID;
+ logIncoming_ = logIncoming;
+ logOutgoing_ = logOutgoing;
+ logEvent_ = logEvent;
+ }
+
+ #region Log Members
+
+ public void Clear()
+ { }
+
+ public void OnIncoming(string msg)
+ {
+ if (!logIncoming_)
+ return;
+
+ lock (sync_)
+ {
+ System.Console.WriteLine("<incoming> " + msg);
+ }
+ }
+
+ public void OnOutgoing(string msg)
+ {
+ if (!logOutgoing_)
+ return;
+
+ lock (sync_)
+ {
+ System.Console.WriteLine("<outgoing> " + msg);
+ }
+ }
+
+ public void OnEvent(string s)
+ {
+ if (!logEvent_)
+ return;
+
+ lock (sync_)
+ {
+ System.Console.WriteLine("<event> " + s);
+ }
+ }
+
+ #endregion
+ }
+}
View
102 QuickFIXn/ScreenLogFactory.cs
@@ -1,51 +1,51 @@
-
-namespace QuickFix
-{
- public class ScreenLogFactory : LogFactory
- {
- public const string SCREEN_LOG_SHOW_INCOMING = "ScreenLogShowIncoming";
- public const string SCREEN_LOG_SHOW_OUTGOING = "ScreenLogShowOutgoing";
- public const string SCREEN_LOG_SHOW_EVENTS = "ScreenLogShowEvents";
-
- private SessionSettings settings_ = null;
- private bool logIncoming_ = true;
- private bool logOutgoing_ = true;
- private bool logEvent_ = true;
-
- public ScreenLogFactory(SessionSettings settings)
- {
- settings_ = settings;
- }
-
- public ScreenLogFactory(bool logIncoming, bool logOutgoing, bool logEvent)
- {
- logIncoming_ = logIncoming;
- logOutgoing_ = logOutgoing;
- logEvent_ = logEvent;
- }
-
- #region LogFactory Members
-
- public Log Create(SessionID sessionID)
- {
- bool logIncoming = logIncoming_;
- bool logOutgoing = logOutgoing_;
- bool logEvent = logEvent_;
-
- if(settings_ != null && settings_.Has(sessionID))
- {
- Dictionary dict = settings_.Get(sessionID);
- if (dict.Has(SCREEN_LOG_SHOW_INCOMING))
- logIncoming = dict.GetBool(SCREEN_LOG_SHOW_INCOMING);
- if (dict.Has(SCREEN_LOG_SHOW_OUTGOING))
- logOutgoing = dict.GetBool(SCREEN_LOG_SHOW_OUTGOING);
- if (dict.Has(SCREEN_LOG_SHOW_EVENTS))
- logEvent = dict.GetBool(SCREEN_LOG_SHOW_EVENTS);
- }
-
- return new ScreenLog(sessionID, logIncoming, logOutgoing, logEvent);
- }
-
- #endregion
- }
-}
+
+namespace QuickFix
+{
+ public class ScreenLogFactory : ILogFactory
+ {
+ public const string SCREEN_LOG_SHOW_INCOMING = "ScreenLogShowIncoming";
+ public const string SCREEN_LOG_SHOW_OUTGOING = "ScreenLogShowOutgoing";
+ public const string SCREEN_LOG_SHOW_EVENTS = "ScreenLogShowEvents";
+
+ private SessionSettings settings_ = null;
+ private bool logIncoming_ = true;
+ private bool logOutgoing_ = true;
+ private bool logEvent_ = true;
+
+ public ScreenLogFactory(SessionSettings settings)
+ {
+ settings_ = settings;
+ }
+
+ public ScreenLogFactory(bool logIncoming, bool logOutgoing, bool logEvent)
+ {
+ logIncoming_ = logIncoming;
+ logOutgoing_ = logOutgoing;
+ logEvent_ = logEvent;
+ }
+
+ #region LogFactory Members
+
+ public ILog Create(SessionID sessionID)
+ {
+ bool logIncoming = logIncoming_;
+ bool logOutgoing = logOutgoing_;
+ bool logEvent = logEvent_;
+
+ if(settings_ != null && settings_.Has(sessionID))
+ {
+ Dictionary dict = settings_.Get(sessionID);
+ if (dict.Has(SCREEN_LOG_SHOW_INCOMING))
+ logIncoming = dict.GetBool(SCREEN_LOG_SHOW_INCOMING);
+ if (dict.Has(SCREEN_LOG_SHOW_OUTGOING))
+ logOutgoing = dict.GetBool(SCREEN_LOG_SHOW_OUTGOING);
+ if (dict.Has(SCREEN_LOG_SHOW_EVENTS))
+ logEvent = dict.GetBool(SCREEN_LOG_SHOW_EVENTS);
+ }
+
+ return new ScreenLog(sessionID, logIncoming, logOutgoing, logEvent);
+ }
+
+ #endregion
+ }
+}
View
14 QuickFIXn/Session.cs
@@ -18,7 +18,7 @@ public partial class Session
private static Dictionary<SessionID, Session> sessions_ = new Dictionary<SessionID, Session>();
private object sync_ = new object();
- private Responder responder_ = null;
+ private IResponder responder_ = null;
private SessionSchedule schedule_;
private SessionState state_;
private IMessageFactory msgFactory_;
@@ -29,7 +29,7 @@ public partial class Session
#region Properties
// state
- public Log Log { get { return state_.Log; } }
+ public ILog Log { get { return state_.Log; } }
public bool IsInitiator { get { return state_.IsInitiator; } }
public bool IsAcceptor { get { return !state_.IsInitiator; } }
public bool IsEnabled { get { return state_.IsEnabled; } }
@@ -184,7 +184,7 @@ public int LogoutTimeout
public ApplVerID targetDefaultApplVerID { get; set; }
public string SenderDefaultApplVerID { get; set; }
public SessionID SessionID { get; set; }
- public Application Application { get; set; }
+ public IApplication Application { get; set; }
public DataDictionaryProvider DataDictionaryProvider { get; set; }
public DataDictionary.DataDictionary SessionDataDictionary { get; private set; }
public DataDictionary.DataDictionary ApplicationDataDictionary { get; private set; }
@@ -197,8 +197,8 @@ public int LogoutTimeout
#endregion
public Session(
- Application app, MessageStoreFactory storeFactory, SessionID sessID, DataDictionaryProvider dataDictProvider,
- SessionSchedule sessionSchedule, int heartBtInt, LogFactory logFactory, IMessageFactory msgFactory, string senderDefaultApplVerID)
+ IApplication app, IMessageStoreFactory storeFactory, SessionID sessID, DataDictionaryProvider dataDictProvider,
+ SessionSchedule sessionSchedule, int heartBtInt, ILogFactory logFactory, IMessageFactory msgFactory, string senderDefaultApplVerID)
{
this.Application = app;
this.SessionID = sessID;
@@ -214,7 +214,7 @@ public int LogoutTimeout
else
this.ApplicationDataDictionary = this.SessionDataDictionary;
- Log log;
+ ILog log;
if (null != logFactory)
log = logFactory.Create(sessID);
else
@@ -888,7 +888,7 @@ public bool Verify(Message msg, bool checkTooHigh, bool checkTooLow)
return true;
}
- public void SetResponder(Responder responder)
+ public void SetResponder(IResponder responder)
{
if (!IsSessionTime)
Reset("Out of SessionTime at setting responder");
View
12 QuickFIXn/SessionFactory.cs
@@ -7,21 +7,21 @@ namespace QuickFix
/// </summary>
public class SessionFactory
{
- protected Application application_;
- protected MessageStoreFactory messageStoreFactory_;
- protected LogFactory logFactory_;
+ protected IApplication application_;
+ protected IMessageStoreFactory messageStoreFactory_;
+ protected ILogFactory logFactory_;
protected IMessageFactory messageFactory_;
protected Dictionary<string,DataDictionary.DataDictionary> dictionariesByPath_ = new Dictionary<string,DataDictionary.DataDictionary>();
- public SessionFactory(Application app, MessageStoreFactory storeFactory)
+ public SessionFactory(IApplication app, IMessageStoreFactory storeFactory)
: this(app, storeFactory, null, null)
{ }
- public SessionFactory(Application app, MessageStoreFactory storeFactory, LogFactory logFactory)
+ public SessionFactory(IApplication app, IMessageStoreFactory storeFactory, ILogFactory logFactory)
: this(app, storeFactory, logFactory, null)
{ }
- public SessionFactory(Application app, MessageStoreFactory storeFactory, LogFactory logFactory, IMessageFactory messageFactory)
+ public SessionFactory(IApplication app, IMessageStoreFactory storeFactory, ILogFactory logFactory, IMessageFactory messageFactory)
{
application_ = app;
messageStoreFactory_ = storeFactory;
View
8 QuickFIXn/SessionState.cs
@@ -30,13 +30,13 @@ public class SessionState
private ResendRange resendRange_ = new ResendRange(0, 0);
private Dictionary<int, Message> msgQueue = new Dictionary<int, Message>();
- private Log log_;
+ private ILog log_;
#endregion
#region Unsynchronized Properties
- public MessageStore MessageStore
+ public IMessageStore MessageStore
{ get; set; }
public bool IsInitiator
@@ -45,7 +45,7 @@ public bool IsInitiator
public bool ShouldSendLogon
{ get { return IsInitiator && !SentLogon; } }
- public Log Log
+ public ILog Log
{ get { return log_; } }
#endregion
@@ -154,7 +154,7 @@ public long LogoutTimeoutAsMilliSecs
#endregion
- public SessionState(Log log, int heartBtInt)
+ public SessionState(ILog log, int heartBtInt)
{
log_ = log;
this.HeartBtInt = heartBtInt;
View
2 QuickFIXn/SocketInitiatorThread.cs
@@ -7,7 +7,7 @@ namespace QuickFix
/// <summary>
/// Handles a connection with an acceptor.
/// </summary>
- public class SocketInitiatorThread : Responder
+ public class SocketInitiatorThread : IResponder
{
public Session Session { get { return session_; } }
public Transport.SocketInitiator Initiator { get { return initiator_; } }
View
6 QuickFIXn/ThreadedSocketAcceptor.cs
@@ -62,15 +62,15 @@ public void AcceptSession(Session session)
#region Constructors
- public ThreadedSocketAcceptor(Application application, MessageStoreFactory storeFactory, SessionSettings settings)
+ public ThreadedSocketAcceptor(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings)
: this(new SessionFactory(application, storeFactory), settings)
{ }
- public ThreadedSocketAcceptor(Application application, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory)
+ public ThreadedSocketAcceptor(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory)
: this(new SessionFactory(application, storeFactory, logFactory), settings)
{ }
- public ThreadedSocketAcceptor(Application application, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory, IMessageFactory messageFactory)
+ public ThreadedSocketAcceptor(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory, IMessageFactory messageFactory)
: this(new SessionFactory(application, storeFactory, logFactory, messageFactory), settings)
{ }
View
12 QuickFIXn/Transport/SocketInitiator.cs
@@ -36,10 +36,10 @@ public bool Connected
#region Private Members
- private Application app_;
+ private IApplication app_;
private SessionSettings settings_;
- private MessageStoreFactory storeFactory_;
- private LogFactory logFactory_;
+ private IMessageStoreFactory storeFactory_;
+ private ILogFactory logFactory_;
private Socket socket_ = null;
private byte[] _readBuffer = new byte[512];
private volatile bool shutdownRequested_ = false;
@@ -52,11 +52,11 @@ public bool Connected
#endregion
- public SocketInitiator(Application application, MessageStoreFactory storeFactory, SessionSettings settings)
+ public SocketInitiator(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings)
: this(application, storeFactory, settings, null)
{ }
- public SocketInitiator(Application application, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory)
+ public SocketInitiator(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory)
: base(application, storeFactory, settings, logFactory)
{
app_ = application;
@@ -65,7 +65,7 @@ public SocketInitiator(Application application, MessageStoreFactory storeFactory
logFactory_ = logFactory;
}
- public SocketInitiator(Application application, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory, IMessageFactory messageFactory)
+ public SocketInitiator(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory, IMessageFactory messageFactory)
: base(application, storeFactory, settings, logFactory, messageFactory)
{
app_ = application;
View
16 UnitTests/SessionFactoryTest.cs
@@ -10,8 +10,8 @@ public class SessionFactoryTest
[Test]
public void TestPersistMessages()
{
- Application app = new NullApplication();
- MessageStoreFactory storeFactory = new MemoryStoreFactory();
+ IApplication app = new NullApplication();
+ IMessageStoreFactory storeFactory = new MemoryStoreFactory();
SessionFactory factory = new SessionFactory(app, storeFactory);
SessionID sessionID = new SessionID("FIX.4.2", "SENDER", "TARGET");
@@ -34,8 +34,8 @@ public void TestPersistMessages()
[Test]
public void ValidConfiguration()
{
- Application app = new NullApplication();
- MessageStoreFactory storeFactory = new MemoryStoreFactory();
+ IApplication app = new NullApplication();
+ IMessageStoreFactory storeFactory = new MemoryStoreFactory();
SessionFactory factory = new SessionFactory(app, storeFactory);
SessionID sessionID = new SessionID("FIX.4.2", "SENDER", "TARGET");
@@ -52,8 +52,8 @@ public void ValidConfiguration()
[Test]
public void StartDayAndEndDayAreDifferent()
{
- Application app = new NullApplication();
- MessageStoreFactory storeFactory = new MemoryStoreFactory();
+ IApplication app = new NullApplication();
+ IMessageStoreFactory storeFactory = new MemoryStoreFactory();
SessionFactory factory = new SessionFactory(app, storeFactory);
SessionID sessionID = new SessionID("FIX.4.2", "SENDER", "TARGET");
@@ -72,8 +72,8 @@ public void StartDayAndEndDayAreDifferent()
[Test]
public void TestExtendedSettings()
{
- Application app = new NullApplication();
- MessageStoreFactory storeFactory = new MemoryStoreFactory();
+ IApplication app = new NullApplication();
+ IMessageStoreFactory storeFactory = new MemoryStoreFactory();
SessionFactory factory = new SessionFactory(app, storeFactory);
SessionID sessionID = new SessionID("FIX.4.2", "SENDER", "TARGET");
View
4 UnitTests/SessionTest.cs
@@ -8,7 +8,7 @@
namespace UnitTests
{
- class MockResponder : QuickFix.Responder
+ class MockResponder : QuickFix.IResponder
{
#region Responder Members
@@ -55,7 +55,7 @@ public void Disconnect()
#endregion
}
- class MockApplication : QuickFix.Application
+ class MockApplication : QuickFix.IApplication
{
public System.Exception fromAppException = null;
public System.Exception fromAdminException = null;
View
13 tutorial/compatibility.md
@@ -21,15 +21,19 @@ issues:
For example: `Session.logout()` is now
`Session.Logout()` and `Application.fromApp()` is now `Application.FromApp()`
-* Getter and setter methods no longer exist and have been replaced with
- .NET properties.
+* Getter and setter methods no longer exist and have been (or will eventually be)
+ replaced with .NET properties.
Previously, you would call `order.getClOrdID()` to get the
ClOrdID value from a NewOrderSingle message. Now, just use `order.ClOrdID`
For a setter: `exec.setField(order.getClOrdID());` is now
`exec.ClOrdID = order.ClOrdID;`
+* Interface classes now start with *I*, per .NET convention. For instance,
+ where you'd implement an `Application` in QuickFIX/C++, you'll now implement an
+ `IApplication`.
+
* FIX Message classes used to be part of the QuickFix## namespace, where ## is the
FIX version. Now they are part of the QuickFix.FIX## namespace.
@@ -40,14 +44,11 @@ issues:
QuickFIX/n's default initiator is `QuickFix.Transport.SocketInitiator` and the
default acceptor is `QuickFix.ThreadedSocketAcceptor`
- The constructors have changed. A MessageFactory is not passed into the initiator
- and acceptor's constructors in QuickFIX/n.
-
* There may be new or different QuickFIX settings. Please look at the [configuration page][2]
to determine if you need to update your configuration files.
If we missed anything, [let us know][1]
[0]: http://www.quickfixengine.org/quickfix/doc/html/building.html#Windows%20(.NET)
[1]: /help
-[2]: http://quickfixn.org/tutorial/configuration
+[2]: http://quickfixn.org/tutorial/configuration
View
14 tutorial/creating-an-application.md
@@ -1,10 +1,10 @@
Creating an Application
=======================
-Creating a FIX application is easy; simply implement an `Application`:
+Creating a FIX application is easy; simply implement an `IApplication`:
```c#
-public class MyQuickFixApp : Application
+public class MyQuickFixApp : IApplication
{
public void FromApp(Message msg, SessionID sessionID) { }
public void OnCreate(SessionID sessionID) { }
@@ -73,7 +73,7 @@ instantiate an `Acceptor`:
```c#
using QuickFix;
-public class MyQuickFixApp : Application
+public class MyQuickFixApp : IApplication
{
public void FromApp(Message msg, SessionID sessionID) { }
public void OnCreate(SessionID sessionID) { }
@@ -90,8 +90,8 @@ public class MyApp
{
SessionSettings settings = new SessionSettings(args[0]);
Application myApp = new MyQuickFixApp();
- MessageStoreFactory storeFactory = new FileStoreFactory(settings);
- LogFactory logFactory = new FileLogFactory(settings);
+ IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
+ ILogFactory logFactory = new FileLogFactory(settings);
ThreadedSocketAcceptor acceptor = new ThreadedSocketAcceptor(
myApp,
storeFactory,
@@ -116,12 +116,12 @@ highly recommended.**
Switching this to an `Initiator` is as simple as swapping out the
`ThreadedSocketAcceptor` class for the `SocketInitiator` class.
-The `MessageStore` keeps a record of all outgoing messages for FIX
+The `IMessageStore` keeps a record of all outgoing messages for FIX
session level messaging. We could implement our own store by
implementing the `MessageStoreFactory` interface.
There are a few options for logging, with file logger probably being the
most useful. We could also implement our own logger by implementing the
-`LogFactory` interface.
+`ILogFactory` interface.
View
6 tutorial/receiving-messages.md
@@ -23,7 +23,7 @@ inside `FromApp`:
```c#
using QuickFix;
-public class MyApplication : MessageCracker, Application
+public class MyApplication : MessageCracker, IApplication
{
public void FromApp(Message msg, SessionID sessionID)
{
@@ -59,7 +59,7 @@ Putting it all together, a full application with type safe orders
looks like this:
```c#
-public class MyApplication : MessageCracker, Application
+public class MyApplication : MessageCracker, IApplication
{
public void OnMessage(
QuickFix.FIX42.NewOrderSingle ord,
@@ -107,7 +107,7 @@ properties and extra boilerplate logic is required:
```c#
// NOT RECOMMENDED
-public class MyApplication : Application
+public class MyApplication : IApplication
{
public void FromApp(Message msg, SessionID sessionID)
{

0 comments on commit f79bf3d

Please sign in to comment.
Something went wrong with that request. Please try again.