Gang-of-Four Design Patterns in MATLAB

50 views (last 30 days)
am.torrinha on 6 Jul 2021
Commented: am.torrinha on 29 Jul 2021
In the context of my master thesis at FCT NOVA, titled "Assessing MATLAB's OO features through the GoF patterns", I intend to implement a full collection of the Gang-of-Four design patterns[1] in MATLAB, based on two existing Java collections of these patterns.
I wonder though if a full or partial MATLAB collection of this nature was already implemented in the past. It would be helpful to know that was the case. This far, I have found among several websites such as this one, some old posts about single implementations of patterns, namely Singleton[2], Iterator[3], Observer[4] and Strategy[5].
I will use a Github repository to share my implementations:
Any help or recommendations would be appreciated.
Thank you.
[1] Gamma, E., Helm, R., Johnson, R. and Vlissides, J. Design Patterns : Elements of Reusable Object-Oriented Software. Boston: Addison-Wesley, 1995.
[2] Bobby Nedelkovski (2021). Design Pattern: Singleton (Creational) (, MATLAB Central File Exchange. Retrieved June 17, 2021.
[3] Bobby Nedelkovski (2021). Design Pattern: Iterator (Behavioural) (, MATLAB Central File Exchange. Retrieved June 17, 2021.
[4] Arne Jenssen (2021). Observer pattern (, MATLAB Central File Exchange. Retrieved June 17, 2021.
[5] Paul Williamson (2021). Strategy Design Pattern in Matlab 2008b (, MATLAB Central File Exchange. Retrieved June 17, 2021.
am.torrinha on 29 Jul 2021
No, I did not know about that post. Although the main goal of the thesis is not to compare MATLAB with other languages, that could be a good reference for a brief comparison, if needed. Thank you once again.

Sign in to comment.

Answers (1)

per isakson
per isakson on 26 Jul 2021
I'm not aware of any "full or partial MATLAB collection" and I've search for it more than once.
Googling for "design patterns python book" returns a numbers of books with "design patterns" in the title. "design patterns matlab book" returns next to nothing.
Not all GOF-patterns are relevant in Matlab, see Design Patterns in Dynamic Programming by Peter Norvig. (This is a set of slides - without text.)
  1 Comment
am.torrinha on 27 Jul 2021
Thank you for the answer.
Yes, the goal of this thesis is to try to implement all the patterns in MATLAB, but some of them may not be relevant as you said. If MATLAB does not provide appropriate mechanisms for a certain pattern implementation, that may be the case.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!