3. Software solution
● One or more applications (programs) working together to provide a
functionality
4. Stand alone application
● Examples: Calculator, word processor, photo editing...
● Everything happens locally inside the application: external applications,
computers, or devices are not involved
● Uses only the resources available on the local machine
○ Limited by available computing power
○ Limited by battery
○ Limited by access to information
○ … screen size, camera, hardware...
5. Multiple applications
● Interaction between different software programs
● Work is distributed, each software program takes care of a task
● Together they provide the solution
● Communication channel needed, often internet or a local network
6. Client / Server Architecture
Two parts: client and server. Designed to work together
● Client: asks to be served by the server
● Server: performs the task and return a result to the client
11. Client has access to the server capabilities
● Client is not limited by resources available on the device and can access
resources and capabilities provided by the server
○ Computing power
○ Access to information
○ Storage capabilities
○ Special hardware or configuration
○ ...
12. How do client and server communicate?
● The server exposes a series of commands that the client can use to
interact with the server to make something happen
● This are called APIs (Application Programming Interface)
● By calling the APIs in a proper order the client and server are able to
communicate
● The set of rules that describe the order of API calls needed to obtain a
result or a successful communication is called protocol
13. Bath Protocol
● Close bath hole
● Rotate cold water tap by 90°
● Rotate hot water tap by 180°
● [Wait 10 minutes]
● Rotate cold water tap by -90°
● Rotate hot water tap by -180°
Bath tub APIs
● Open bath hole
● Close bath hole
● Rotate cold water tap
● Rotate hot water tap
14. Public APIs
● If a server uses a set of public APIs and protocols anyone can write a client
that interacts with the server.
○ Authentication and security are available
● E.g.: Web browsers (client application) can talk to all the websites
(servers) because the web browsers and all the web servers talk using the
same protocol (HTTP)
15. Web Services
● There are multiple servers that expose public apis providing any kind of
information
○ Weather conditions and forecasts
○ Marvel superheroes information
○ Star Wars API
○ …
●
16. A client can contact different servers for
different reasons
● We may think of an application that given a list of ingredients suggests a
recipe for dinner using those ingredients, and the proper wine pairing.
● The client application may need to contact a server to find the proper
recipe, and a different server to find the proper wine
17. A device can be a server and a client for
different services - 1
1. Arya writes a Whatsapp message to the group "Stark Family"
2. WA application on Arya’s phone asks to the Whatsapp messaging center
to send the message
○ Client: application on Arya's phone
○ Server: messaging center
18. A device can be a server and a client for
different services - 2
3. Whatsapp messaging center asks the database server for the list of
members in the group "Stark Family"
○ Client: messaging server
○ Server: database server
4. Whatsapp messaging center sends the message to all the members
19. Different kinds of servers
● Game server
● Web server
● Mail server
● Print server
● Database server
● ....
20. What is a Database?
● Organized data
● Think about it as a set of tables with rules and relations
● Optimized to be searched, modified, processed
Databases are often a key component of modern software solutions.
21. Example: GOT Database
NAME GENDER HOUSE_NAME
John Snow m Stark
Cersei Lannister f Lannister
Arya Stark f Stark
Sansa Stark f Stark
NAME SYMBOL
Stark Wolf
Lannister Lion
Character
House
22. Dear database...
● Tell me all the houses that have both male and female characters
● Tell me all the female characters
● Tell me all the members of house Stark
● Tell me the house symbol of John Snow
23. Real world examples
● When you search on google the results are taken from a database
● When you open facebook the posts are taken from a database
● Same for Instagram, Twitter, Airbnb, PokemonGo...
24. Peer-to-Peer (P2P) Architecture
● No central server
● Nodes are both clients and server for
the same service
● Distributed storage, computing power,
search etc.
26. Peer to peer social impact
P2P networks provide disruptive technologies that stimulate important social
debates
● Who's to blame when copyrighted / illegal material is shared on a p2p
network?
● Net Neutrality debate
○ "all bits are created equals"
○ open internet: content should be treated equally
● Decentralized currencies regulation debate
27. Recap
● Single app
● Multiple applications
● Client / Server relationship
○ Client asks for a service, server delivers the service
■ The client can access resources (data, computation power, information) on the
server
○ Multiple clients for each server
○ Various kinds of servers
○ Database server
■ Organized data
■ Optimized to be searched, modified, processed
● Peer 2 Peer
29. Computers: they speak machine language
● it's awful! :(
● they want to be instructed with this language
● depends on how their processor is designed
● machine language varies between different machines
32. Alternatives to machine language?
There are other programming languages, closer to human language, that are
easier to write and understand.
● Formal languages to instruct a machine
● Different purposes, different level of abstractions, different philosophies
33. They are a bit better
public class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}
34. How do we go from here to the machine
language?
● Compiling
○ Human: writes the source code
○ Compiler program: translate source code in numerical machine language (compilation
phase) creating the final program file in machine language. This is the program that will
run.
○ Computer: execute the program file
● Interpreting
○ Human: writes the source code
○ Instead of being compiled, the source code is translated into "something else"
○ Later, an Interpreter program looks into "something else" and execute it translating it in
machine instructions
35. Source code
● Source code is the “recipe” for the application
● It is valuable for developers, as recipes are for chefs
public class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}
38. Open Source or Closed Source?
● There is no right answer
● Depends a lot on the business model and strategy of the company
● There are multiple licenses in between that describe how you can use
source code of an application
● The debate on software licenses is very interesting but out of the scope of
this course :)
39. Developers and platforms
Developers usually have experience of one or more programming languages
that they have used on one or more platforms.
Each platform supports one or more programming languages, so for example
you should know the Java programming language to develop on Android.
Each platform has different APIs and functionalities, so experience on the
platform is important as well.
40. What language is used for…
● Dynamic Website - Javascript
○ scripting language, client side, web oriented
● Video Game with lots of graphic - C++
○ Closer to machine, allows more optimization
● iOS app - Objective C / Swift
● Android app - Java
● Server side app - Java
NOTE: this is an inaccurate and oversimplified list. Do not consider it any
differently
41. So java works for both android and server...
● Android app - Java
● Server side app - Java
42. Same language, different problems
● Client vs Server
● limited resources vs large resources
● UI vs no UI
● Unstable connection vs stable connection
● Variable context vs fixed context
● human interaction vs no human interaction
43. So iOS and Android have similar problems
Same problems, different platforms
● Mobile teams are usually able to find a shared design
○ it works quite welI
○ (there are exception depending on the platform)
● Different Platforms have different APIs
○ Can I delete user data?
○ Can I access pictures?
○ Where are contacts stored?
○ How can I do something in the background?
● Different Platforms have different guidelines
○ When in Rome, do what romans do
46. Software development recap
● Programming Languages
● Source code
○ Closed Source (Coca-cola)
○ Open Source (Apple pie)
● Client developers / Server developers
● Different platforms have different APIs and guidelines.
○ Follow the guidelines!
49. Big differences
between countries
Mobile platform units sold in 3 months ending Feb 2017, taken from
https://www.kantarworldpanel.com/global/smartphone-os-market-share/
50. Android
● Open source OS - Google is a key contributor
● Runs on device built by different manufacturers
● wide range of devices
● fragmentation
● Slow upgrades rollout
51. iOS
● Proprietary OS built by Apple (closed source)
● Runs on devices built by apple
● High end devices
● control on hw, sw
● Less fragmentation
52. Google
● sells ads
● wider market as possible
● does not build hw directly
● Cloud is strategy
● Android is tactic
53. Strategy VS Tactic
● Strategy: long term plan and objective
● Tactic: actions taken to achieve what defined in the strategy
Strategy: “Get users to use our services and platforms as much as possible so
we can gather informations on what they like and provide them interesting and
personalized advertisement”
Tactic: “Promote Android adoption as much as possible and position google as
the primary provider of services for Android” (and multiple other tactical steps!)
54. Apple
● Sells products to end users
● Premium segment
● Device is strategy
● Cloud is tactic
55. Different Mobile Users
● Apple
○ Higher income
○ Propension to spend money
■ Credit cards often linked
■ “Apple Tax” (urbandictionary)
■ Payed application are the norm
○ Power users
○ Smaller user base
● Android
○ Lower average income
○ Less willing to spend money
■ Less credit cards linked
■ Minor average cost of device
■ Different developers approach
○ Wider user profiles (me & my
mother)
○ Larger user base
56. Mobile First: which platform?
● What is the best platform to start from when developing an application?
● As always, it depends on
○ What is the target market?
○ What is the target user?
○ What is the business plan?
58. Providing a Client / Server solution
We are launching a new application that allows user to take a picture of any
beer, provide the review and see other user’s reviews. Client will run on the user
device
● What about the server?
We need to provide the servers to our users.
Should we buy a server?
59. Servers are expensive
● Upfront costs
● How many clients should you be able to support in the next year?
● Reliable, high-speed connection
● Servers should be kept in a safe and secure place
○ Climatization
○ Security
60. Servers require maintenance
● By someone you have to pay
● Parts that need to be replaced
● Software that needs to be upgraded
● As business grows, upgrade or addition of new server is needed
61. Servers are a point of failure
● Any issue on the server breaks the entire service
● You need mechanisms to avoid data loss
○ Backup / Replication / Mirror
○ Note: sometimes it's not even your data, but your user's data!
○ Multiple distant physical location to be safe
62. Cloud computing
● The alternative to in-house servers.
● Cloud computing provides computer processing resources, data, storage
and common services on demand.
● You can rent a cloud server and set it up as you want
● And / or you can access commonly used services as needed
63. Cloud computing
● Servers and services are provided by third party
○ Amazon
○ Google
○ Microsoft
○ ...
● Remote computing power and services delivered on a pay per use basis
● No need to think about maintenance, security, uptime etc.
64.
65. Cloud server
● You do not get a real machine but a section of a huge center that behaves
like a real machine
● Can be copied easily
● Can be reconfigured easily
○ change memory, cpu, storage size
● Can be configured to have elastic behavior
○ Can handle spikes
○ Can prevent some kind of malicious attacks
66. Elastic behavior
● Server is able to change its configuration to satisfy the incoming requests
● You have a server that grows and shrinks as needed
● Can handle unexpected (or expected) traffic peaks
● Can protect the service from DDOS attacks
○ Distributed Denial Of Service
67. Elastic behavior example
Between T1 and T2 the server
increases automatically his
capabilities to handle the increased
load.
Without an elastic behavior the server
would have not been able to handle
all the requests in the spike
69. Cloud computing - Recap
● Setting up and maintaining a server is difficult and expensive
● Cloud computing can help
○ Offered by large players
○ Provides virtual servers
○ Provides additional services
○ Pay per use