Expose by Beyond code to share your local sites and applications with others on the internet

Expose is a tunnel application that allows you to share your local sites and applications with others on the internet. It is open source, written in PHP and the best alternative to ngrok for PHP…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Object oriented basics along with programming in Python

Consider python programming as a movie. Here an object is the “lead actor” of that movie. Now we all know that an object is an instance of the class or like a blue print of the class. The class definition typically specifies instance variables, also known as data members, that the object contains, as well as the methods, also known as member functions, that the object can execute.

Now the question is what do we need to achieve from object oriented programming ?

We want software to be robust, that is, capable of handling unexpected inputs that are not explicitly defined for its application. For example, if a program is expecting a positive integer (perhaps representing the price of an item) and instead is given a negative integer, then the program should be able to recover gracefully from this error. More importantly, in life-critical applications, where a software error can lead to injury or loss of life, software that is not robust could be deadly.

Modern software applications, such as Web browsers and Internet search engines, typically involve large programs that are used for many years. Software, therefore, needs to be able to evolve over time in response to changing conditions in its environment. Thus, another important goal of quality software is that it achieves adaptability (also called evolvability). Related to this concept is portability, which is the ability of software to run with minimal change on different hardware and operating system platforms. An advantage of writing software in Python is the portability provided by the language itself.

We would in most cases want that the same code should be usable as a component of different systems in various applications. Developing quality software can be an expensive enterprise, and its cost can be offset somewhat if the software is designed in a way that makes it easily reusable in future applications.

Modern software systems typically consist of several different components that must interact correctly in order for the entire system to work properly. Keeping these interactions straight requires that these different components be well organised. Modularity refers to an organising principle in which different components of a software system are divided into separate functional units. As a real-world analogy, a house or apartment can be viewed as consisting of several interacting units: electrical, heating and cooling, plumbing, and structural. Rather than viewing these systems as one giant jumble of wires, vents, pipes, and boards, the organizes architect designing a house or apartment will view them as separate modules that interact in well-defined ways. In so doing, he or she is using modularity to bring a clarity of thought that provides a natural way of organising functions into distinct manageable units.

The notion of abstraction is to distill a complicated system down to its most fundamental parts. Typically, describing the parts of a system involves naming them and explaining their functionality. Applying the abstraction paradigm to the design of data structures gives rise to abstract data types (ADTs). An ADT is a mathematical model of a data structure that specifies the type of data stored, the operations supported on them, and the types of parameters of the operations. An ADT specifies what each operation does, but not how it does it. We will typically refer to the collective set of behaviours supported by an ADT as its public interface.

More formally, Python supports abstract data types using a mechanism known as an abstract base class (ABC). An abstract base class cannot be instantiated (i.e., you cannot directly create an instance of that class), but it defines one or more common methods that all implementations of the abstraction must have. An ABC is realised by one or more concrete classes that inherit from the abstract base class while providing implementations for those method declared by the ABC.

Another important principle of object-oriented design is encapsulation. Different components of a software system should not reveal the internal details of their respective implementations. One of the main advantages of encapsulation is that it gives one programmer freedom to implement the details of a component, without concern that other programmers will be writing code that intricately depends on those internal decisions.

The only constraint on the programmer of a component is to maintain the public interface for the component, as other programmers will be writing code that depends on that interface. Encapsulation yields robustness and adaptability, for it allows the implementation details of parts of a program to change without adversely affecting other parts, thereby making it easier to fix bugs or add new functionality with relatively local changes to a component.

All of these can be achieved with the help of various design patterns. Computing researchers and practitioners have developed a variety of organisational concepts and methodologies for designing quality object-oriented software that is concise, correct, and reusable. Such as Iterator, adapter, Composition and much more.

Add a comment

Related posts:

Principais documentos de uma empresa

Os documentos de uma empresa requerem registro, organização e direcionamento para os departamentos certos como forma de garantir um processo gestor de qualidade e menos burocrático possível…

What is the Cost of Creating a Delivery App and How Can You Optimize It?

The increasing demand for online goods and services has ultimately led to the shift of the worldwide market towards the path of digitalization. This ultimate change has led to hikes since the…

The Start of a New Great Beginning

Hi my name is Dave Chappell and in 2020 our family is about to embark on a new adventure. The business will be called Chappell Cosmetics and this my journey into a female dominated industry. In 2014…