Solid Architecture is the first five object oriented design pattern forwarded by Robert C. Martin also known by the name Uncle bob. This design pattern helps developer to maintain, extend their code base in more agile way during software development process.

Their exist quite references for solid architecture principle in different languages. But I am quiet interested in how this principle can be implemented in pythonic way. (Here, pythonic means idiomatic python . it refers to the style, as well as architecture and design of the code)

The architecture is not complex. It is pretty simple to grasp.

S = Single Repository Principle.

O = Open/Closed Principle.

L = Liskov Substitution Principle

I = Inversion segragration Principle

D = Dependency Inversion Principle


Must of the programmers, must have knowledge of Object Oriented Programming Concept. Here, we extensively used classed based view to create our programs. Its hard to move from classed based view to function based view in java. However, it is possible in python. In functional programming, Unlike object, the function provides the main logic in the program.

Lambda

In python, we can use lambda to mimic the use of function with out defining def: function in our code. It is usually used to create the small anonymous function. i.e. function with out the name.

syntax : lambda argument_list: expression

Here…


Python Decorators

Example 1:

In python, decorators are callable python object that is used to modify python function, method or class definition. Here, the object that are going to get modified is passed as argument to the decorators. Here I have provided the simple decorators with only one arguments.

def our_deocorator(func):
def function_wrapper(x):
print("Before calling " + func.__name__)
s = func(x)
print(s)
print("After calling " + func.__name__)
return function_wrapper

@our_deocorator
def succ(n):
return n+1

succ(3)

Output:

Before calling succ
4
After calling succ

In above code snippet, What we did is used additional code to run before executing the function…


Hello and Namaste from the top of the World. I will be sharing new knowledge regarding how you can install and configure conky scripts in linux machine. At the end of the tutorial you will be able to configure my custom made conky scripts. Further more, you will be able to customize the scripts as your will.

I will be attaching github link and complete youtube video regarding the tutorials.

Do ping the link above for complete guide.

Do feel free to comment for any problems that gets encounter. Any feedback is welcome. Do Subscribe my youtube channel, follow my github link. So, you will get notified whenever i shared the new contents.

In future , I am planning to write my own custom gmail , weather scripts and addition features in conky. So, stay tuned..

suman astani

Techno geek graduated from ascol campus CSIT | System Analyst| familiar with SDLC | web design Android app developer| Microsoft Student Partner FY 2016 | Certif

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store