Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Design pattern in python
#1
Hi,

What is the use of design patterns in python? Why people go for it?
Reply
#2
Many patterns are not used in Python, because of the good features in the language itself.
On the other side, we're using some patterns everyday without knowing it.

In other languages this design patterns are very important. For example in Java you need for everything getters and setters.
In Python we can make properties. The getter and setter pattern is not pythonic.
Example:
The use of design patterns is, that you can name a thing.
The source of design patterns came from an architect.

If you want to read a book about design patterns: https://www.packtpub.com/application-dev...n-patterns
But there is more material available.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#3
As mention bye @DeaD_EyE many patterns get used in Python without of thinking of it or talking about it.
@Brandon Rhodes Python Patterns has good write up about this.
You see stuff like this when talking about verdict/usage of pattern in Python.
Quote:The “Factory Method” pattern is a poor fit for Python.
It was designed for underpowered programming languages where classes and functions can’t be passed as parameters or stored as attributes.
In those languages, the Factory Method serves as an awkward but necessary escape route.
But it’s not a good design for Python applications
Reply
#4
By the way, you should subscribe here: https://www.pythonweekly.com/
Issue 342: https://pycoders.com/issues/342

There is one link to: https://python-patterns.guide/
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  High level Python program architectural design question - decoration for multiple ent yahbai 0 1,784 Jan-16-2020, 08:30 PM
Last Post: yahbai
  Should Python 3 become multi-threaded by design? uc1 4 3,705 Jul-30-2017, 04:31 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020