兩道與移動開發相關的英文設計模式題

Liuwei-Sunny發表於2013-02-01

(1) Instagram

 

Instagram is a free photo sharing program and social network that was launched in 2010 and had a tremendous success since then. On  April 2012, Facebook has acquired Instagram for approximately $1 billion dollars in cash and stock. This was a big acquisition price: contrast this to the $35 mil dollars that Yahoo paid for Flickr in 2005.  

 

The principle of Instagram is quite simple: the app allow you to take a picture, apply a digital filter to it, and then share it with other Instagram users or upload the picture to your favorite social networking service.  The picture below illustrates how different filters can be applied to a picture taken with a mobile phone.

You snap a picture then choose a filter from the bottom of your screen: you can scroll left and right to see different filters. Once you apply a  filter on the picture the picture will change its visual appearance. 


A)  How you would implement the filter functionality in Instagram? Which design pattern shall we use to make the application of different filters on the picture possible in the app? Give a short explanation.  In particular, show an appropriate class diagram(s) and enough code fragments to illustrate your use of the pattern to solve the problem.

 

Once you have taken a picture and applied a filter on it you have also the option to share it on your favorite social network. The user interface below illustrates this:

You can click any of the social networks from the list presented in the “Sharing” window of the application  that you want to post your photo on. Enter the username and password associated with your account to link it with your Instagram account. Your photo will appear in your “Feed” and also the feed of other Instagram users that are following you. It will also be posted to any of the social networks you selected.


B)  How you would implement this functionality? Which design pattern would you use for sharing your Instagram picture with your favourite social network? Give a short explanation. In particular, show an appropriate class diagram(s) and enough code fragments to illustrate your use of the pattern to solve the problem.

 

(2) iPhone Airplane Settings

 

The iPhone’s Airplane mode lets you take advantage of the iPhone’s built-in iPod (among other capabilities) while temporarily turning off its phone, e-mail, and Internet functions when flying. To do so, merely tap Airplane Mode on the Settings screen to display On (rather than Off). This disables each of the iPhone’s wireless radios: Wi-Fi, Carrier, 3G and Bluetooth. In the figure below on the left the “Airplane Mode“ is switched off which means that Wi-Fi and the Carrier is active. The figure on right depicts the scenario when the “Airplane Mode” is switched off. The result of this operation is that the Wi-Fi is automatically switched Off and the Carrier selection is inactivated. 

A)  How you would implement with the help of a design pattern the functionality of the iPhone  Airplane Mode  described above? Which Design Pattern would you use?  In particular, show an appropriate class diagram(s) and/or enough code fragments to illustrate your use of the pattern to solve the problem.

 

Now if we can dive deeper into the Wi-Fi selection functionality. Wi-Fi is typically the fastest wireless network you can use to surf the Web, send e-mail, and perform other Internet tricks on the iPhone. You use the Wi-Fi setting to determine which Wi-Fi networks are available to you and which one to use based on its signal.  Tap Wi-Fi, and all Wi-Fi networks in range are displayed. A signal strength indicator can help you choose the network to connect to if more than one is listed; tap the appropriate Wi-Fi network when  you’ve reached a decision. If a network is password-protected, you’ll see a lock icon.  

B)  How you would implement with the help of a design pattern the Wi-Fi functionality of the iPhone described above? Which Design Pattern would you use? In particular, show an appropriate class diagram(s) and/or enough code fragments to illustrate your use of the pattern to solve the problem.

 

The solution is coming soon, please wait!

 

【Sunny http://blog.csdn.net/lovelion

相關文章