Skip to main content

Posts

Showing posts with the label Design Patterns

model view presenter from a gurus point of view

Here is a link to an article about the model view presenter design pattern . The article was created by one of the gurus in the field , Rod Cerrada . The article is very informative and easy to understand . It contains practical scenarios where MVP can be applied in the design process. The article contains a downloadable solution file which can be opened by the users to actually see how the code works. A very good and helpful article for those trying to study MVP . Read the article at this link. Goodluck Rod , it was a great honor working with you.

thread safe singleton and parametized threadstart

perhaps the most commonly discussed design pattern in OOP is singleton . just recently , we had a "design pattern" atmosphere in our office (some sort of an atmosphere relating to "resign patterns" lol) . singleton was in the limelight once again and one issue that made it more interesting is dealing with thread safe singleton . questions like : what is two or three threads starts at the same time and realizes that the singleton class is not yet existing , each of the threads will create a new instance of the singleton , thus breaking the main reason why singleton exist in the first place . i kinda got curious of all the solutions that was discussed so i made a little code to test it . using the singleton design pattern allows the developer to work with only one instance of a class . this avoids the disadvantages of having too many instances of a single class in the memory together with the side effects it may cause in the application . to start , i created a si...