update
1 Software Design Patterns
Software design patterns are best practice solutions
for solving common
problems
in software development.
Design patterns are language-independent and can be implemented in any language that supports object-oriented programming.
Popular design patterns often lead to frameworks that work well with the pattern, Example:
Framework | Language | s/w Design Pattern |
---|---|---|
Django | Python | MVC |
Rails | Python | MVC |
Ruby | Python | MVC |
Spring | Java | MVC |
Backbone.js | Javascript | MVC |
Catalyst | Perl | ? |
Laravel | PHP | |
CakePHP | PHP | |
Phoenix | Elixir | Server side MVC |
Play | Scala | MVC |
Sails.js in Node.js | Javascript | MVC |
2 Common patterns
- Layered or multi-tiered architectural pattern
Event driven
architectural pattern- Microservices architectural pattern
Model-View-Controller
architectural pattern- Space-based architectural pattern
3 Web Frameworks
Developing web applications is made easier within a framework that provides the common tools and constructs typically needed to develop a web application. These are called frameworks and include such features as seamless database creation, default structures for web pages, web services, and scaffolding of views to enable rapid and consistent application development.
The frameworks also lead to consistency by enforcing standards such as JSON or XML for data transfer, HTML, CSS, Javascript for user interfacing.
3.1 MVC Model-View-Controller
Web frameworks often use MVC pattern to organize application programming. A model in a framework maps to a table in a database.? A controller is a server side component that responds to external requests
or even simpler
3.2 MVT Model-View-Template (or MTV)
Model is for data (typcally from the database) View contains the business logic for the web app. Template builds the layout of the web pages.
Model
maps to Model
: i.e. the data
Template
maps to View
: i.e. the layout
View maps to Controller : i.e. the business logic
3.3 Popular Web Frameworks
3.3.1 Ruby on Rails - One of the first frameworks emerging in the early 2000s
Use things called "gems"
3.3.2 Django in Python
Free and open source. Uses
Also uses DTL "Django Template Logic" as in
source: data-flair.training
Django is "loosely coupled."
Django’s architecture consists of three major parts:
- is a set of tools that make working with data and databases much easier
- is a plain-text templating system that can be used by non-programmers; and
- is a framework that handles communication between the user and the database and automates many of the painful parts of managing a complex website.
3.3.3 Catalyst in Perl
Free and open source, written in Perl. Follows MVC architecture. Written in Moose, a modern object system for Perl. inspired by Ruby on Rails, Maypole, and Spring.
3.3.4 Laravel and CakePHP in PHP
Are free and open source, PHP web frameworks. Follows MVC architecture Source code on github, licensed under MIT license. Written in PHP, a general purpose programming language originally designed for web development. PHP is a recursive name: "PHP Hypertext Processor". PHP can be executed with a CLI, or embedded in HTML.
PHP code is processed by a PHP interpreter implememnted as a module in a web server, or as a Common Gateway Interface (CGI) executable.
3.3.5 Phoenix in Elixir
Written in the functional programming language, Elixir. Uses server side MVC architecture.
3.3.6 Play in Scala
Open source, follows MVC architectural pattern. Written in Scala. Scala supports functional programming and static type system. Designers attempt to address the criticisms based on Java. Both Scala and Java are object-oriented languages, as are Python, C++ Ruby Perl, MATLAB, Common LISP, etc… Good for high scale/performance? Aims to increase developer productivity by following philosophy "convention over configuration". From Wikipedia, also known as "sensible defaults" or "principle of least astonishment". (note the opposite philosphy of "explicit is better than implicit" approach of Python.)
3.3.7 Sails.js in Node.js
Free and open source, under MIT license. A MVC web app framework, developed using Node.js environment.
4 Code review
Just what you'd think. Often done by more than one reviewer. Goal is to ensure that the final code has these properties:
- is easy to read
- is easy to understand
- follows coding best practices (and agrees with team/company conventions)
- uses correct formatting
- is free of bugs
- has proper comments and documentations
- is clean
4.1 Benefits of code reviews
Other than meeting the above list, code reviews can teach junior programmers new techniques from more senior reviewers. They also can get fresh ideas on solving a problem, or at least finding a more efficient algorithm to solve the problem.
5 Testing
Software testing is usually split in to two types
5.1 Functional testing
From developer.cisco.com
Functional testing seeks to determine whether software works right
: whether
it behaves as intended
in a logical sense, from the lowest levels of detail
examined with Unit Testing
(for example, do the functions, libraries, and
other small components you write return expected results
and reject known-bad
inputs
?) to higher levels of complexity
explored in Integration Testing
(for
example, do your components talk to one another properly and connect
correctly with the database?). We'll talk about Unit and Integration testing
shortly.
5.1.1 unit testing
See the detail section Unit Tests in python.org
5.1.2 integration testing
After unittesting all works, or as you code and your unittesting is ongoing,
comes the integration testing
5.2 Non-functional testing
examines usability, performance, security, resiliency, compliance
(with
standards and regulations, for example), localization
, and many other issues,
with an eye to finding out if software is fit for purpose, provides intended
value, and minimizes risk.