We didn’t find a solution over there, so what are the other options? Code which starts out attempting to build a solution around a specific pattern frequently ends up spending more time solving problems with the pattern itself than actually solving the original problem; this is when you know that the pattern you're using is not suited for the problem (Which would have been more obvious if you'd already had some working code before trying to fit a pattern).Start out by writing code which just works; use a minimum sub-set of behaviour (e.g.

Now we are working on supporting a file transport feature.

The main problem is that two new commands are required in a certain sequence to support the transportation of files.

Those are: FILE FILE-CHUNK At first, the FILE Command is being used to send some basic information about the file – Name, Size, Content-Type etc.

– and then the FILE-CHUNK command is being used to send chunks of the file. We’ve thought about certain Design Patterns that could help us solve this problem – it was more about the principles behind it that we could incorporate with our current implementation.

For a school assignment we need to implement a homebrewed protocol.

We make usage of plaintext commands to send and receive messages.

The commands underneath are currently supported by the messaging protocol: START MSG END So this is a really basic implementation of a chat application.

We’ve implemented this by using a map between the commands and a certain handler – you could see this as an implementation of the Command Pattern.

For example - once you have a basic working app which just connects to another client, you might only extend it with just one additional feature such as sending a simple text message; this is better than trying to throw all the extra features on top at once.

Approach your problem incrementally - building a solution to a complex problem is an iterative process; the code will evolve, which is why the use of design patterns are nearly always a result of refactoring.

A publisher/subscriber model seems like a good choice for your messaging protocol.