GithubHelp home page GithubHelp logo

commondesignpattern's Introduction

Common Design Patterns In Android

Common Design Patterns In Android

alt text

  • Builder Pattern
  • Observer Pattern
  • Strategy Pattern
  • Adapter Pattern

✅ What is the definition of Design Pattern?

Design patterns are used to represent some of the best practices adapted by experienced object-oriented software developers. In software development, a design pattern is a general reusable solution to a commonly occurring problem or task in software design.

✅ Benefits of using Design Patterns in Android ?

1.Design Patterns use object-oriented concepts such as decomposition, inheritance, and polymorphism.

2.They can improve the re-usability and extensibility of Android apps. It means you do not need to write the same code again at various places, and also you can be able to add other features to your app much more easier than general coding. Therefore, Design Patterns can increase speed in application development in Android.

  1. They can make your codes cleaner by decoupling the code. In addition, Design Patterns can enhance the understanding of codes in Android apps.

4.Design Patterns are proved and testified solutions because they have been built upon the knowledge and experience of expert application developers.

5.They make communication between developers more efficiently.

✅ Types of Design Patterns ?

1.Creational Design Pattern (Builder,Singleton,DI Patterns)

They are concerned with the way of creating objects such as Builder, Singleton, and Dependency Injection.

  1. Structural Design Pattern (Adapter pattern)

They are discussed how classes and objects can be composed, to form larger structures such as Adapter, Facade, and Proxy.

  1. Behavioral Design Pattern (Observer,Mediator, and Interpreter and strategy )

They are considered the interaction and responsibility of objects such as Observer, Mediator, and Interpreter.


✔ Builder Pattern : ex AllertDialog.Build()

indicates that you should construct a complex object from simple objects

by using step-by-step approach. It is mainly used when object cannot

be implemented in single step like in the deserialization of a complicated object.

adv: 1-you do not need to have all the data to pass it to your object.

2-implements a clear separation between the construction and representation of an object.

3-It handles the changes in the internal representation of objects.

4-It can improve the flexibility and readability of source codes.

✔Adapter Pattern

used for class and object composition. This pattern is useful in situation

when we have two different interfaces, we want to combine them and we can’t change them

✔Observer Pattern

gives us the way to communicate between different classes and objects.

This pattern is the best approach if we have one-to-many relation

and we’d like to inform other objects about some changes or actions.

✔Strategy Pattern

Strategy design pattern takes place when you need to implement behaviour or plan. in android using this pattern for aset of data like filteration data or doing actions on data without writle complex code or more if .. else.

commondesignpattern's People

Contributors

basemnasr avatar

Stargazers

 avatar Sreejin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.