Mobile application architecture

  • View
    1.105

  • Download
    0

  • Category

    Mobile

Preview:

Citation preview

Is there such a thing as architecture design for mobile applications?

Christos Matskas

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

New Era

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

HelloI’m Christos

christosmatskas cmatskas https://cmatskas.com

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Side Projects

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

architectureˈɑːkɪtɛktʃə/noun: architecture1.the art or practice of designing and constructing buildings."schools of architecture and design“

• the style in which a building is designed and constructed, especially with regard to a specific period, place, or culture.plural noun: architectures"Georgian architecture" 2. the complex or carefully designed structure of something."the chemical architecture of the human brain"• the conceptual structure and logical organization of a computer or computer-based system.

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

What is Software Architecture?

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Refactoring?

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Refactoring?

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Big Ball Of Mud ™

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Confident?

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Why does it matter?

• Quality• Performance• Maintainability

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Refactoring

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Speed

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Cost

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Mob App Development Platforms

3 MADPs for building apps:• Native• Web• Hybrid

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Native DropBox

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Hybrid

Uber

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Mobile Web

Google Maps

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Native Apps - Assessment

Pros• Best performance• Fast, fluid UI • Full access to the platform's capabilities• Monetization – App StoreCons• High cost of development• Updates require full deployment on each platform

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Hybrid Apps - Assessment

Pros• Good performance but not as good as hybrid• Fast development cycle as it's easy to create cross platform

apps• Allows monetization as they can be deployed in the app storeCons• Occasionally connected Internet access is required• Updates require deployment on each platform• Mostly full compatibility through the use of plugins (not

100%)

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Web Apps - AssessmentPros• Good performance - it's a web page• Very fast development cycle• Consistent UI across all platforms• Easy to deployCons• Very hard to monetize - no app store option• Requires internet access• Web browsers may have different behaviour and performance• No access to the underlying hardware issues

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Development Tools

Native• xCode, Android Studio, Eclipse, Visual Studio etc

Native & Hybrid• Ionic, AppBuilder, Cordova, Silver, FuseTools,

Xamarin Studio etc

Platform agnostic tools• Sublime, Visual Studio Code, Web Developer tools

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Architecture principles

Sound familiar?

• Meet best practices• Minimize costs• Minimize maintenance requirements• Usability• Extensibility

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Separation of Concerns

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Single Responsibility

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Principle of Least Knoweldge

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Don’t Repeat Yourself

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

No Bid Design Upfront (BDUF)

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Composition over Inheritance

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Suggestions

• Logical layers• No mixing of components in same layer• Strict vs relaxed layering• Abstraction for loose coupling• Don’t overload component functionality• Consistency of data formats• Abstract Cross-cutting code• Consistent naming conventions• Exception handling standards

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Composition over Inheritance

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Composition over Inheritance

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Composition over Inheritance

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Mobile Architecture Design

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Authentication & Authorization• Occasionally connected scenarios • 3rd party authentication services• Authentication and authorization over a

virtual private network (VPN) • Security Model Differences

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Caching

• Caching unnecessary data• Cached data in occasionally connected scenarios • Inappropriate cache locations and formats • Caching sensitive data in unencrypted form • Failing to choose an appropriate caching

technology• Failing to implement caching alltogether

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Communications• Failing to protect sensitive data over the air (HTTPS anyone?)• Failing to secure web service communication• Failing to secure communication over a VPN • Performance impact of communication security on limited-bandwidth

connections (https compression)• Not managing limited-bandwidth connections efficiently • Not managing connections to multiple network services efficiently • Not designing to work with intermittent connectivity • Not considering connection costs or allowing users to manage

connections WiFi / 3-4G• Not designing to minimize power usage when running on battery power

(this relates to managing background tasks efficiently)• Failing to use the appropriate communication protocol

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Configuration Management• Failing to restore configuration state after a reset. • Failing to consider configuration management synchronization

over the air (e.g. Windows has roaming settings)• Failing to consider configuration management synchronization

with the host PC (is the application truly x-plat?)• Choosing an inappropriate format for configuration information

(using a local db file when you could be using a simple json file to store the settings)

• Failing to protect sensitive configuration information (encrypting sensitive data is of major importance)

• Failing to consider the platform differences when using configuration settings

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Data Access

• Data-access mechanisms that work with intermittent connectivity

• Database access performance (especially if the data is large)

• Navigating through large datasets when not required • Failing to consider appropriate replication technologies

and techniques • Failing to consider access to device database services• Failing to consider different authentication mechanisms• Failing to consider data integrity and consistency

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Hardware - Devices

• Failing to consider device heterogeneity, such as screen size, CPU power and RAM

• Not presenting user-friendly error messages consistent with the platform

• Failure to consider the processing power of the device

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Exception Management

• Not recovering application state after an exception • Revealing sensitive information to the end user • Not logging sufficient details about the exception • Using exceptions to control application flow

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Logging

• Not considering remote logging instead of logging on the device (plenty of 3rd party services)

• Not considering how to access device logs • Not considering resource constraints when logging

(connectivity, service down etc)• Failing to protect sensitive information in the log files

(common error both in desktop/web and mobile apps)

• Not considering logging for monitoring user engagement and proactive bug fixing

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Synchronization

• Failing to secure synchronization when communicating

• Failing to manage synchronization options over the air (wifi, 4g, both)

• Failing to manage synchronization interruptions • Failing to handle synchronization conflicts • Failing to consider merge replication where

appropriate • Failing to consider 3rd party services for managing

data synchronization

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Testing

• Failing to implement comprehensive tests• Failing to appreciate debugging costs when

choosing to support multiple device types • Failing to design with debugging in mind; for

example, using emulators instead of the actual devices

• Failing to debug in all connection scenarios • Failing to consider automated testing frameworks

and associated costs

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

UI/UX

• Not considering the restricted UI form factor • Not considering the single window environment • Not considering that only one application can be running • Not designing a touch-screen or stylus-driven UI for

usability • Not including support for multiple screen sizes and

orientations • Not managing device reset and resume • Not considering the limited API and reduced range of UI

controls compared to the desktop

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Security

• Failure to understand the exact security requirements

• Failure to adequately secure persisted application data

• Failure to secure all communications with 3rd party services

• Failure to capture and log what constitutes unusual or suspicious activity on a device

• Failure to protect against reverse engineering

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Mobile Application?

Join the conversation on Twitter:@SoftArchConf #SoftwareArchitect2015

Architecture Design?

Recommended