Skip to content

Need of architecture in application

Devrath edited this page May 29, 2021 · 1 revision

Why we need an architecture

  • When you start to build complicated applications the way in which you structure your code becomes very important.
  • When people start to build applications, people start to add more and more code to fragment/activity.
  • New developers keep joining the team, they start building the applications in a similar way.

What is the problem with having all the code in one place

  • This is a problematic situation because the Application doesn't follow the separation of concerns.
  • Separation of concerns states that each classes stay focused in as many small number of tasks.
  • You can consider the activity/fragment to be a layer responding to the life cycle events from the operating system.
  • Adding your business logic to the activity/fragment breaks separation of concerns
  • It is very difficult to test this business logic here because you always need to run device/emulator to test your business logic which you could have done without and just could have used a JVM to unit test the business logic.

Clone this wiki locally