两道与移动开发相关的英文设计模式题

(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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值