Showing posts with label Architectures. Show all posts
Showing posts with label Architectures. Show all posts

About Cohesion

2022-05-11

 In computer programming, cohesion refers to the degree to which the elements of a module belong together.  Thus, it is a measure of how strongly related each piece of functionality expressed by the source code of a software module is.

Cohesion is the concept all the variables and methods in the class fitting together under the name and purpose of the class.  A class should have a single responsibility, a single purpose.  If a class has more than one purpose then it should be split up.

MVVM Architecture

2022-05-07

Model–view–viewmodel (MVVM) is a software architectural pattern that facilitates the separation of the development of the graphical user interface from the development of the business logic or back-end logic so that the view is not dependent on any specific model platform.

GUI- view

Business logic/back end - model

This pattern is used in WPF & Silverlight, it’s invented by Microsoft architects in 2005, the year WPF was announced.

MVVM was designed to remove virtually all GUI code ("code-behind") from the view layer, by using data binding functions in WPF (Windows Presentation Foundation) to better facilitate the separation of view layer development from the rest of the pattern. 

This gives advantage for UX(user experience) devs can work on UI aspect w/o touching GUI code and data binding of the View which is developed & maintained by application developers. This is how the separation of concerns b/w View and ViewModel & model gives direct benefit. 

Criticism of MVVM is that MVVM pattern and its application in specific uses, stating that MVVM can be "overkill" when creating simple user interfaces. For larger applications, he believes that generalizing the viewmodel upfront can be difficult, and that large-scale data binding can lead to lower performance.

DRY Principle

The Don't Repeat Yourself (DRY) principle states that duplication in logic should be eliminated via abstraction; duplication in process should be eliminated via automation. Duplication is Waste. Adding additional, unnecessary code to a codebase increases the amount of work required to extend and maintain the software in the future.  Duplicate code adds to technical debt.  Whether the duplication stems from Copy Paste Programming or poor understanding of how to apply abstraction, it decreases the quality of the code.  Duplication in process is also waste if it can be automated.  Manual testing, manual build and integration processes, etc. should all be eliminated whenever possible through the use of automation.

Ref: https://deviq.com/principles/dont-repeat-yourself

REST Model

2012-06-01

REST-style architectures consist of clients and servers. Clients initiate requests to servers; servers process requests and return appropriate responses. Requests and responses are built around the transfer of representations of resources. A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource.

REST was initially described in the context of HTTP, but is not limited to that protocol. RESTful architectures can be based on other Application Layer protocols if they already provide a rich and uniform vocabulary for applications based on the transfer of meaningful representational state. RESTful applications maximize the use of the pre-existing, well-defined interface and other built-in capabilities provided by the chosen network protocol, and minimize the addition of new application-specific features on top of it.

A RESTful web service (also called a RESTful web API) is a simple web service implemented using HTTP and the principles of REST. It is a collection of resources, with four defined aspects:

What Is An API

2008-11-23

API- Application Programming Interface
  • An API (Application Program Interface) is a series of functions that programs can use to make the operating system do their work. Using Windows APIs, for example, a program can open windows, files, and message boxes --as well as perform more complicated tasks-- by passing a single instruction. Windows has several classes of APIs that deal with telephony, messaging, and other issues.
  • The specific method prescribed by a computer operating system, or by another application program, by which a programmer writing an application program can make requests of the operating system or another application. Unlike a GUI (graphical user interface), which is a direct user interface, the API interfaces with an operating system or a program.
  • An application program interface is the software interface to system services or software libraries. An API can consist of classes, function calls, subroutine calls, descriptive tags, etc.