Tag Info

New answers tagged

4

Good for you for factoring out the platform specific bits from the bulk of the code. I bet this helps keep the overall project manageable. I think your organization based on platform is the way to go. Platform-specific files go in platform-specific directories, and the files themselves can have names that match what they do. This keeps things very clear, ...


1

If don't want to use the observer pattern, there could be another way. While I was reading your question, it became to me the idea to use the Decorator pattern. You've said that you don't want to give to the class ConnectionFactory the responsibility to set a user-defined variable in the MySQL session. Then, why don't you decorate the Connection object ...


7

You can: Use the features of Observer that you need, and ignore the other features; or Use some other software pattern that more closely matches what you need, or Don't use a pattern at all, and simply write code that solves the problem. Just because the Wikipedia article says that the Observer pattern is designed to notify the observer of state changes ...


3

Since no one else has answered and I've now had a full day to remember all my old comp sci courses, I'll try writing a proper answer this time. To the best of my knowledge, all asynchronous behavior in computers is at some level implemented by putting things in a queue and coming back to that queue later to process the things when it's more convenient. When ...


0

It sounds like you want to resolve event actions based on more than just the e.KeyChar. I have seen this problem solved by passing in a second argument to the Resolve function which could be named something like KeyPressContext. Basically you would want to supply an extra object with metadata about the context in which the key was pressed and use that ...



Top 50 recent answers are included