Introduction
Software development is key in every aspect of life, be it social, economic or political. Through thorough analysis of the existing systems, software developers have designed and developed solutions to aid and improve operations in these disciplines of life. With the advent of social network sites such as Facebook, Cyworld, MySpace, Twitter and Bebo millions of people have integrated these sites as a common platform where they converge and engage all aspects of life. As much as we appreciate the benefits of social network sites, it is important for us to understand some of the design patterns which have been employed in the development of these sites, narrowing our study to Facebook.
A design pattern is a solution which is general with a reusability attribute which has been tested over time and proven to work in its implementation on certain platforms. These patterns are developed to solve commonly occurring or emergent problems in the field of software development. The advantage of these patterns is a speedy solution to a software project through provision of proven, tested development paradigms. Some of the design patterns used in design and development of Facebook are; iterator, adaptor and façade.
Iterator Pattern
The iterator pattern shields the user from the underlying technicality while accessing elements such as photos, groups or class schedule. This can be through shielding the user from sort and search classes. A Facebook user has the ability to search a certain group, picture and without the need of knowing the operations of the underlying structure. The iterator also has the advantage of providing a common interface to the user through the technique of returning only the elements of importance to the client. This actually makes the online experience very enjoyable with the ability of the user customizing the page according to preference. Facebook implements SLATE (Search, Links, Authoring, Tags, Extensions, and Signals) concept to make web experience as seamless as possible. The figure below shows a class diagram of the iterator design pattern.
The participants in the above structure are iterator providing an interface for traversing and elements access, concrete iterator implementing iterator interface for keeping track of current position when traversing the aggregate, aggregate providing interface definition for iterator object creation and concrete aggregate for proper instantiation of the creation interface of the concrete iterator. (Shabir 1)
Adaptor pattern
The adaptor pattern fulfils the expectations of the client. For example in Facebook if a client clicks to open a photo that is exactly what he/she gets and not a group. Irrespective of the group, photo or class schedule classes being a little bit different they are able to coordinate together ensuring the client gets the expected presentation irrespective of the browser or server platform. Also two unrelated social pages on the internet can be shared through Facebook for profile viewing. Adaptors make this possible by linking different profiles from different platforms forming a cohesive web platform. The figure below shows a class diagram of the adaptor design pattern.
Façade pattern
Façade pattern is implemented in Facebook to provide an interface which simplifies the use of the system. This is through the collection of the existing sub interfaces into one integrated simplified user friendly interface. Furthermore appealing themes inside the integrated interface masks the data connections of the user’s profile as evidenced in the menu of Facebook.com. The figure below shows a class diagram of façade design pattern.
Conclusion
Due to the nature of problems not having a similar solution, design patterns cannot be said to provide solutions for all occurring problems. “This simply means we can obtain core solutions from design patterns and not exact solutions just as database normalization can be a pattern, but the extent of normalization is dependent on the problem at hand” (Shabir 1).
Reference
Shabir, Shakir. Design Patterns in Simple Examples. Go4Expert.com, 2007. Web.