Core Code Architectures

Core Code Architectures

No matter what programming language you are using, no matter for what platform and what type of applications, the quality of your programming code is always important, so it could be with less bugs, and easier to read, modify and so on.

The purpose of using some code architecture at all is to separate software modules where every module does only specific type of work.

This makes every module more testable. A lot of testing tools can mimic the other layers and this way could verify the logic of some specific module.

Also when new developer starts working he may know what type of code is located where - without too much diving into the applications domain problem.

Model View Presenter (MVP), Model View ViewModel (MVVM), Model View Controller (MVC).

These methodologies are very similar to one another and have a common approach to structuring the code.

MODEL

In the Model Software Module is defined the structure of the information and how it is saved. It could be unstructured (for example - in file), it could be structured in a database, send to some remote server or it could be held in memory.

This Software Module contains - aside from the information structure - the logic for operating with the data (save, delete, update). This sub-module is called repository layer.

View

Software layer in which the structured information is presented to the user in some way.

  • In case of Android Application - are used the standard controls that are provided by Android OS (or 3rd parties).
  • In case of Web Page - are used the controls that are provided by the browsers
  • In case of Desktop Application - are used the components that the concrete Operating System gives. For Example - Windows Live Tiles, desktop windows with navigation buttons, menus etc,

When using the architectures the right way - this layer contains no business logic - only presentation logic and passing the user actions to the P, C or VM layer.

Presenter, Controller, ViewModel

These software layers are very, very similar.

In them is located the business logic of how and when the user input and interactions with the software is passed to the model layer.

These layers also pull the information (transform it somehow if necessary) from the Model layer and give it to the View for displaying.  

To view or add a comment, sign in

More articles by Toma Velev

Explore content categories