After having developed a set of use cases for a project, we'll typically want to start designing the systems that our use cases require. The designs here will typically consist of a variety of diagrams, ranging from sequence to static. The idea is to obtain an idea as to how the systems, and their …
Design
Here's something you should do.
Typically, when I'm going to start a project I work out a document that details the goal of the project. This gives me something to work with initially. If this project is for a client, we'll go over the document, and make changes as needed so that it will refle…
Here's something you should do.
Typically, when I'm going to start a project I work out a document that details the goal of the project. This gives me something to work with initially. If this project is for a client, we'll go over the document, and make changes as needed so that it will refle…
Yeah, so I know you are all expecting another one of my long posts right here, but...you won't find one.
On the other hand, if you would like a preview of what I'm working on for you guys, then you can view it here: Concurrency [PDF]
On the other hand, if you would like a preview of what I'm working on for you guys, then you can view it here: Concurrency [PDF]
Now, I don't know about you, my readers, but I happen to know quite a few programming languages. I've spent many years learning them. Why? Because I've found that no language is perfect, no language is better than any of the others. Each has its domain of applicability.
So, it is quite consternating…
So, it is quite consternating…
Quote:Original post by stormrunner
I realize this may be ignorant, but I just have to ask - what would be a case for a singleton ? You have - in brutal fashion - destroyed the basis for almost all uses of the singleton pattern as it relates to game developement. The last bastion of defence, per se, …
The Singleton Pattern's intent is to "ensure a class only has one instance, and provide a global point of access to it." [DP, p. 127]
It would seem that many people forget that the pattern embodies the whole definition there. Many "Singletons" are Singletons for no other reason than to take advantag…
It would seem that many people forget that the pattern embodies the whole definition there. Many "Singletons" are Singletons for no other reason than to take advantag…
Why are you infected with Singletonitis?
Now, this isn't a recent topic, and it's actually been on my mind for a long time now. But, I think that I should probably clarify my feelings towards this particularly virulent infection that seems to spread like wildfire amongst lesser beings (that would be…
Now, this isn't a recent topic, and it's actually been on my mind for a long time now. But, I think that I should probably clarify my feelings towards this particularly virulent infection that seems to spread like wildfire amongst lesser beings (that would be…
Alright, so far most of our refactorings have been done to simplify the code, or to remove duplication. However these next two refactorings will target some of our customer's requirements.
The first refactoring we'll do involves the Protocol enumeration. We will be replacing this enumeration with a …
The first refactoring we'll do involves the Protocol enumeration. We will be replacing this enumeration with a …
After my brief hiatus, I'm back...and eviler than ever.
Now, we have managed to refactor the code to a point where further refactorings will end up changing the public interface. In this case that isn't such a bad thing, as we have complete control over the whole source. In a larger project, however…
Now, we have managed to refactor the code to a point where further refactorings will end up changing the public interface. In this case that isn't such a bad thing, as we have complete control over the whole source. In a larger project, however…
Alright, well, before we get started on doing some more work on our little access list project, I've got some code to discuss... something so horrible that it nearly...well, I'll just show it to you.
void C_Map::save(char *filename) {
ofstream saver (filename,ios::binary);
saver<<_xsize;…
Alright, well, this entry will continue from where the last one left off.
Now that you've had a few days to look over the code, and get a feel for it, lets start refactorings it. Now, one of the big things about refactoring is that there are so many different ways of refactoring code. In fact, one c…
Now that you've had a few days to look over the code, and get a feel for it, lets start refactorings it. Now, one of the big things about refactoring is that there are so many different ways of refactoring code. In fact, one c…
More often than not, you won't have the luxury of writing code from scratch. Instead you will have inherited a code base. Perhaps you have even been hired on to make changes to an existing application. For the purposes of our discussion, we will assume the latter.
One of the biggest problems with in…
One of the biggest problems with in…
You may notice, if you've read through my code at all, that I like short concise methods. The names are also fairly descriptive, generally telling the exact purpose of the method. Yet, I encounter code quite frequently that make me want to do harm unto some people. Recently I encountered one such b…
This is probably the final entry I shall make on the topic of this particular serializer, so... here's a zip of all of the code, minus project files: Kent.Serialization.Network Enjoy!
And by popular demand, the entire series in text format: On .Net Serialization
And by popular demand, the entire series in text format: On .Net Serialization
Well, if you ran your tests yesterday, after all of that work, then you will have recieved a nasty shock, one of them is failing! In fact, it's failing with a serialization exception, reading: TestCase 'Kent.Serialization.Network.Tests.NetworkFormatterTests.TestSerialization' failed: System.Runtime…
At this point we have enough done to write begin writing up the code required to serialize an object graph. Looking over our NetworkFormatter class however, we note that it really isn't in the domain of responsibility for it to write the objects out to the stream. So we're going to introduce a new …
I want some feedback, and don't be afraid to ask questions. I'm considering taking slightly larger steps now, considering that you should be getting the idea of how to properly use refactoring and testing. What I was thinking (and we'll try it out in this journal entry) is that I would move on to d…
Listing 1public class NetworkFormatter {
public NetworkFormatter(Assembly sharedAssembly);
public void Serialize(Stream destinationStream, object graph);
internal Type[] GetSerializableTypes();
internal Dictionary GetTypeIdMap();
internal Type GetTypeFromId(int id);
internal int GetIdFromType(Type …
Well, I wanted to start off by mentioning a few things. First of all, in case you hadn't noticed, quotes changed a bit! This is actually a side effect of another change that is taking place, specifically in how I am going to deal with the code in my journal. This isn't going to be a big change real…
Why can't people be polite with each other on these forums? I mean, I see responses all the time now which are basically disguised flames. Is there some reason you can't just say what needs saying and be done? Do you really have to call each other names? Now, that's not to say you can't insult each…
On testing and refactoring: I've always been a strong believer in TDD and refactoring. Thus you will often find that my code will change appearance as it grows. You will also find that the number of tests that I perform will also grow rather quickly. Quite simply, testing and refactoring keeps thin…
Having decomposed a sample output from the BinaryFormatter class, we can now move on to writing our own version, keeping in mind that we are going for optimum size. So, lets first think about what all we need to send for our JoinRequest. Looking over the class, we know that we will need to send the…
Last time I was decomposing the format of the serialized data that BinaryFormatter would emit for a simple type. Starting from where we left off, we are at offset 87 in the hex dump.
Quote:
00000000 00 01 00 00 00 FF FF FF FF 01 00 00 00 00 00 00 ................
00000010 00 0C 02 00 00 00 44 53 …
Well, having noticed a couple of recent posts on sending data across a network connection, I've decided to cover serialization, and how you can use it to send and receive network packets across a stream based, or even datagram based, protocol. Firstly I'm going to cover a bit about the BinaryFormat…
Advertisement
Popular Blogs
Advertisement