Have you ever use HTTP-proxy or some other proxy? When you’re in a relatively isolated environment, such as the LAN in your company, maybe you’ll need it. Actually, when I was an intern in an IT company, I always used the HTTP-proxy to login the MSN and surf on the internet. When I used MSN or surf on the net, I can’t feel the existence of the proxy. And this is the role of a proxy. And this can be express as follows.
Archive for the ‘Design Patterns’ Category
Design Patterns in ActionScript-Proxy
January 25th, 2009
Ntt.cc Design Patterns in Action Script-State
January 25th, 2009
Ntt.cc
Yesterday, when I was on my way home, I suddenly met an old friend. I haven’t met him since I began to write these articles.
We stop at a little cafe, and began to talk.
“I’ve just changed my job”, he said, “and now I join the Orange”.
“WOW, Orange, you mean the biggest MP3 manufacturer company,” I answered.
“Yeah, and I join the new product team, we want to surprise the whole world by our new product.” He said proudly.
……. (The rest of our conversation is very boring, so, let’s stop here)
Design Patterns in ActionScript-Builder
January 22nd, 2009
Ntt.cc
Have you ever buy a computer online, maybe from dell? In dell’s website, we just need to follow its process to order the accessories you need, then you can get your own computer configuration. Of course, you can’t get the real computer until you pay it
Here, you direct the producer to produce your own computer through the dell website. Ok, three roles here, you, dell website and the real producer.
Design Patterns in ActionScript-Prototype
January 21st, 2009
Ntt.cc
When I want to write the Prototype pattern, I firstly look up the ActionScript 3.0 manual. I want to find out whether there is a clone method in Object class. If so, I will use this as an example. But, unfortunately, I can’t find this method in the Object class. Then I found the prototype attribute, but the explanation confused me. So, I decide to show you this pattern in my own way without using the Object class.
Firstly, you need to know the intent of this pattern. You can read the following text.
Design Patterns in ActionScript-Iterator
January 18th, 2009
Ntt.cc
There is a famous saying in computer science, “Program = Data Structure + Algorithm”. It figures out the importance of how to organize the data and how to deal with the data.
Maybe, in your applications, you care more about how to show the data, because this has much to do with the user experience. However, how to organize the data and deal with the data is also or much more important, because this has much to do with the performance.
Design Patterns in Action Script-Template Method
January 16th, 2009
Ntt.cc
Do you like playing cards? If your had ever played, you may noticed that everyone has their own way arranging the cards. And in most cases, people will put the cards in order, maybe from the biggest one to the smallest one. Eh, this is a way of sorting.
We can write down the following code to mimic this action.
Design Patterns in ActionScript-Observer
January 13th, 2009
Ntt.cc
In GUI programming, event-driven is an important concept. Such as, when you programming in Flex, you may put a button on the stage, then you’ll add a callback function to the button. The function will be called when there is some action play on the button, such as click. This is almost the same with the observer pattern.
Design Patterns in ActionScript-Singleton
January 12th, 2009
Ntt.cc
In our real world, many things are one and only. For example, there is only one god in our world, and only one president in the USA, eh, I mean the current president. One and only is very important to our world, and so does to our program.
Design Patterns in Action Script-Bridge
January 11th, 2009
Ntt.cc
I think many of you are the fans of Diablo. I’m one of you
In Diablo series, you can choose different characters to begin your Diablo journey. As a programmer, maybe you’ll write a base class, named Character. Suppose there are only two characters, named FatCharacter and ThinCharacter.
And we will define some common operations in the base class Character, define special skills in the derived classes.
You can see the sample source code first.
Download Full Project
Design Patterns in ActionScript–Facade
January 10th, 2009
Ntt.cc
Have you ever heard Xerox PARC (Palo Alto Research Center, @see http://en.wikipedia.org/wiki/PARC_(company) )? This research center has many great innovations. GUI (Graphical User Interface) is one of them.
(more…)

Posted in
Tags: