Skip to content

39. Conclusion

Let’s review the work done in this document:

Chapter
File
Contents
   
 
Course Overview
 
Setting Up a Work Environment
[bases]
The basics of the Python language – language structures – data types – functions – console output – format strings – type conversion – lists – dictionaries – regular expressions
[strings]
String notation – methods of the <str> class – encoding/decoding strings in UTF-8
[exceptions]
Exception handling
[fonctions]
Scope of variables – parameter passing – using modules – Python Path – named parameters – recursive functions
[fichiers]
Reading/writing a text file – handling UTF-8 encoded files – file management jSON
[impots/v01]
Version 1 of the application exercise: an income tax calculation. The application is available in 18 versions – version 1 implements a procedural solution
[imports]
Managing application dependencies by importing modules – a dependency management method is presented – it is used throughout the document – Python management Path
[impots/v02]
The version 2 of the application builds on version 1 by gathering all configuration constants into a configuration file
[impots/v03]
The version 3 of the application builds on version 2 by using functions encapsulated in a module—dependency management is handled via configuration – introduction of the jSON file to read the data needed to calculate the tax and write the calculation results
[classes/01]
Classes – inheritance – methods and properties – getters / setters – constructor – [__dict__] property
[classes/02]
Overview of the [BaseEntity] and [MyException] classes used in the rest of the document – [BaseEntity] facilitates object/dictionary conversions
[troiscouches]
Layered architecture and interface-based programming. This chapter presents the programming methods used in the rest of the document
[impots/v04]
Version 4 of the application – this version implements a solution with a layered architecture, interface-based programming, and the use of classes derived from [BaseEntity] and [MyException]
[databases/mysql]
Installing SGBD MySQL – connecting to the database – creating a table – executing commands SQL SELECT, UPDATE, DELETE, INSERT – transaction – configured queries SQL
[databases/postgresql]
Installation of SGBD PostgreSQL – database connection – table creation – execution of commands SQL SELECT, UPDATE, DELETE, INSERT – transaction – configured queries SQL
[databases/anysgbd]
Writing code independent of SGBD
[databases/sqlalchemy]
The ORM (Object Relational Mapper) SqlAlchemy – a ORM allows for unified work with different SGBD - mapping classes / tables SQL – operations on table image classes SQL
[impots/v05]
Version 5 of the tax calculation application – Using the layered architecture of version 04 andORM SqlAlchemy to work with the SGBD MySQL and PostgreSQL
[inet]
Internet Programming – TCP / IP Protocol (Transfer Control Protocol / Internet Protocol) – HTTP Protocols (HyperText Transfer Protocol) – SMTP (Simple Mail Transfer Protocol) – POP (Post Office Protocol) – IMAP (Internet Message Access Protocol)
[flask]
Web services with the Flask web framework – displaying a page HTML – web service jSON – requests GET and POST – managing a web session
[impots/http-servers/01]
[impots/http-clients/01]
Version 6 of the application exercise - Creating a web service jSON for tax calculation with a multi-tier architecture - Writing a web client for this server with a multi-tier architecture – client/server programming – using the [requests] module
[impots/http-servers/02]
[impots/http-clients/02]
Version 7 of the application release – version 6 has been improved: the client and server are multithreaded – utilities [Logger] to log client/server exchanges – [SendMail] to send an email to the application administrator
[impots/http-servers/03]
[impots/http-clients/03]
Version 8 of the application exercise – version 7 is improved by using a session
[xml]
Management XML with the [xmltodict] module
[impots/http-servers/04]
[impots/http-clients/04]
Version 9 of the application exercise – version 8 is modified to have client/server exchanges in XML;
[impots/http-servers/05]
[impots/http-clients/05]
Version 10 of the application exercise – instead of processing N taxpayers via N GET requests, a single request POST is used with the N taxpayers in the body of POST
[impots/http-servers/06]
[impots/http-clients/06]
Version 11 of the application year – the application’s client/server architecture is modified: the [métier] layer moves from the server to the client
[impots/http-servers/07]
Version 12 of the application exercise – this version implements a MVC server (Model – View – Controller) that delivers, at the client’s request, either jSON, XML, or HTML. This chapter implements the jSON and XML versions of the server
[impots/http-clients/07]
Implementation of clients, jSON, and XML of the MVC server from version 12
[impots/http-servers/07]
Implementation of the HTML server from the version 12 – using the CSS Bootstrap framework –
[impots/http-servers/08]
Version 13 of the application exercise - Refactoring the code from version 12 – session management with the [flask_session] module and a Redis server – using encrypted passwords
[impots/http-servers/09]
[impots/http-clients/09]
Version 14 of the application exercise – implementation of URL with a token CSRF (Cross-Site Request Forgery)
[impots/http-servers/10]
Version 15 of the application exercise – refactoring the code from version 14 to handle two types of actions: ASV (Action Show View), which are used only to display a view without modifying the server state, ADS (Do Something Action) which performs an action that changes the server’s state – these actions all end with a redirect to a ASV action – this allows for proper handling of client browser page refreshes
[impots/http-servers/11]
Version 16 of the application – management of URL with prefix
[impots/http-servers/12]
Version 17 of the application – porting version 16 to an Apache / Windows server
[impots/http-servers/13]
Version 18 of the application – fixes a bug in version 17

The client/server tax calculation applications have implemented the following architecture:

Image

The [web] layer above was implemented using a MVC architecture:

Image

The document’s content is dense. Readers who make it to the end will gain a solid understanding of MVC web programming in Python/Flask and, beyond that, a solid understanding of MVC web programming in other languages.

Additional information on the Flask framework can be found in the document [https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world] by author Miguel Grinberg. I have read some sections of his course, and they struck me as very educational. The author covers many concepts not addressed in this document.