Tag Archives: Design pattern

Book review: Refactoring: Improving the design of existing code

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...Loading...

I’ve read this book when I started my PhD thesis. It helped me laying down the basis of software conception.

It was the first book where I found the code smell concept. And my former code really smelt…
Continue reading Book review: Refactoring: Improving the design of existing code

Book review: Design patterns: Elements of Reusable Object-Oriented Software

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...Loading...

As I’ve said before, I’ve done several book reviews in the past. I will start with a small serie on design patterns books.

This book is one of the “must-have” in your library. If you write some code or if you manage some IT or Computer Science projects, you will have this book to lay down the basic software architecture.
Continue reading Book review: Design patterns: Elements of Reusable Object-Oriented Software

Book review: Patterns for Parallel Programming

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...Loading...

Like other programming models, there are some patterns in selecting the right parallel solution when it comes to designing a parallel application. This is what this book is about. The solutions may be obvious, but patterns aften are.
Continue reading Book review: Patterns for Parallel Programming

How to promote High Performance Computing ?

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...Loading...

I had this discussion with one of my Ph.D. advisors some months ago when we talked about correctly using the computers we had then (dual cores), and I had almost the same one in my new job here: applied maths (finite differences, signal processing, …) graduate students are not taught how to use current computers, so how could they develop an HPC program correctly?

I think it goes even further than that, and it will be a part of this post. What I see is that trainees and newly-hired people (to some extent myself included) lack a lot of basic Computer Science knowledge, and even IT knowledge.
Continue reading How to promote High Performance Computing ?

My favorite design pattern in Python

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...Loading...

I’ve noticed some days ago that I mainly used one design pattern in my scientific (but not only) code, the registry. How does it work? A registry is a list/dictionary/… of objects, applications add a new entry if it is needed, and then a user can tap into the registry to find the most adequate object for one’s purpose.

Continue reading My favorite design pattern in Python

Wrapping a C++ container in Python

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...Loading...

When moving to Python, the real big problem that arises is the transformation of a Python array into the C++ container the team used for years.

Let’s set some hypothesis :

  • there is a separation between the class containing the data and the class that uses the data (iterators, …)
  • the containing class can be changed (policy or strategy pattern)

The first hypothesis is derived from the responsibility principle, the two classes have two distinct responsibilities, the first allocates the data space and allows simple access to it, the second allows usual operations (assignation, comparison tests or iterations for instance).

The second one will be the heart of the wrapper. It allows to change the way data is stored and accessed in a simple way.
Continue reading Wrapping a C++ container in Python