
This video gives an overview of the entire course.
Architecture is the fundamental organization of a system embodied in its components, their relationships to each other, and to the environment, and the principles guiding its design and evolution.
An architecture of a system is best represented as structural details of the system and here we will see some of the characteristics of software architecture.
The term quality attribute has been used to loosely define some of these aspects that an architecture makes trade-offs for.
The readability of a software system is closely tied to its modifiability. Well-written, well-documented code, keeping up with standard or adopted practices for the programming language, tends to produce simple, concise code that is easy to read and modify.
Cohesion and coupling are the main fundamentals of modifiability.
Now that we have seen some examples of good and bad coupling and also cohesion, let us get to the strategies and approaches that a software architect can adopt to improve the modifiability of the software system.
Static code analysis tools can provide a rich summary of information on the static properties of your code, which can provide insights into aspects like complexity and modifiability/readability of the code.
Now that we have seen how static checkers can be used to report a wide range of errors and issues in our Python code, let us do a simple exercise of refactoring our code. We will take our poorly defined metric test module as the use case (the first version of it), and perform a few refactoring steps.
A software system with a high level of testability provides a high degree of exposure of its faults through testing, thereby giving the developers higher accessibility to the system's issues, and allowing them to find and fix bugs faster.
Hence, it follows that a system which is tested early and tested often has a higher likelihood to produce a testable and robust system, which provides the required functionality to the end user in a satisfactory manner.
From a software architecture perspective, one of the most important steps of testing is at the time the software is developed. The behavior or functionality of a software, which is apparent only to its end users, is an artifact of the implementation details of the software.
Hence, it follows that a system which is tested early and tested often has a higher likelihood to produce a testable and robust system, which provides the required functionality to the end user in a satisfactory manner.
Code coverage is measured as the degree to which the source code under test is covered by a specific test suite. Ideally, test suites should aim for higher code coverage, as this would expose a larger percentage of the source code to tests, and help to uncover bugs.
TDD is an agile practice of software development, which uses a very short development cycle, where code is defined to satisfy an incremental test case.
The degree to which the system is able to meet its throughput and/or latency requirements in terms of the number of transactions per second or time taken for a single transaction.
Now that we've had an overview of what performance complexity is and also of performance testing and measurement tools, let us take an actual look at the various ways of measuring performance complexity with Python.
Modules in the Python standard library, which provides support for deterministic profiling. The third-party libraries provide support for profiling such as line_profiler and memory_profiler.
Extend tools that will aid the programmer in debugging memory leaks and also enable him to visualize his objects and their relations.
We saw a couple of examples of program optimization to improve the time performance of the code.
Here, we will take a look at common Python data structures and see what their best and worst performance scenarios are and also discuss some situations of where they are an ideal fit and where they may not be the best choice.
This video gives an overview of the entire course.
How do we measure the scalability of a system? This would be answered in this section.
Multi-threading in Python is used to generate thumbnails of image URLs.
In Python there is, a global lock that prevents multiple threads from executing native bytecode at once. This lock is required, since the memory management of CPython (the native implementation of Python) is not thread-safe.
After understanding Multi-processing, it is a good time to compare and contrast the scenarios where one needs to choose between scaling using threads in a single process or using multiple processes in Python.
The concurrent.futures module provides high-level concurrent processing using either threads or processes, while asynchronously returning data using future objects. It provides an executor interface which exposes mainly two methods, submit and map.
Celery is a distributed task queue written in Python, which works using distributed messages. Each execution unit in celery is called a task. A task can be executed concurrently on one or more servers using processes called workers. By default, celery achieves this using multiprocessing, but it can also use other backend such as gevent.
Secure coding is the practice of software development that guards programs against security vulnerabilities, and makes it resistant to malicious attacks right from program design to implementation. It is about writing code that is inherently secure as opposed to thinking of security as a layer which is added on later.
Python is a very readable language with simple syntax, and typically, one clearly stated way to do things. It comes with a set of well-tested and compact standard library modules. All of this seems to indicate that Python should be a very secure language.
It is likely that python is exposed to security issues in applications such as Django, Flask, Pyramid, and others due to interaction with web applications on a daily basis.
Tips and techniques that a security architect can use so that their team can apply secure coding principles to mitigate security issues right from the stage of program design and development.
It is a good time to summarize the strategies that one should try and impart to a software development team from a security architect's point of view.
A design pattern attempts to record those aspects of a recurring design in object-oriented systems that solve a problem or a class of problems.
Design patterns can be categorized in different ways according to the criteria chosen.
A class must provide a way for all its instances to share the same initial state.
Structural patterns concern themselves with the intricacies of combining classes or objects to form larger structures, which are more than the sum of their parts.
Behavioral patterns are the last stage in the complexity and functionality of patterns. They also come last chronologically in object life cycle in a system since objects are first created, then built into larger structures, before they interact with each other.
Software Architecture is the process of taking operational and technical requirements and designing a solution that optimizes things deemed important to the system like quality, performance, security, and maintainability. If you're a Python developer aspiring to become the architects of enterprise-grade applications or software architects who would like to leverage Python to create effective blueprints of applications, then go for this Learning Path.
Packt’s Video Learning Path is a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.
The highlights of this Learning Path are:
● Understand the characteristics and importance of software architecture
● Solve security issues with web applications
● Explore different design patterns in Python
Let's take a quick look at your learning journey. This Learning Path starts off by explaining how Python fits into an application architecture. You’ll get a complete understanding of the different architectural quality requirements such as maintainability, reusability, testability, scalability, performance, usability, and security to build a product that satisfies business needs. Next, you’ll learn what is scalability and concurrency and the relationship between the two that affects the performance attributes. Further, you’ll learn security aspects of Python. Finally, you’ll learn the creational, structural, and behavioral patterns in Python.
By the end of this Learning Path, you’ll have all the knowledge to become a successful software architect.
Meet Your Expert:
We have the best works of the following esteemed author to ensure that your learning journey is smooth:
Anand Balachandran Pillai is an engineering and technology professional with over 18 years of experience in the software industry in product engineering, software design, and architecture and research. He has worked with companies such as Yahoo!, McAfee, and Infosys in the roles of lead engineer and architect in product development teams, to build new products. He is the founder of the Bangalore Python Users Group and a fellow member of the Python Software Foundation (PSF). Anand is currently working as senior architect in Yegii Inc.