views:

130

answers:

2

"An architectural pattern expresses a fundamental structural organization schema for a software system".

There are software systems that can be described as finite-state machines (specially many real-time systems and embedded systems), if we consider the previous description given in the first paragraph for an "architectural pattern", don't you think that in specific cases the "state design pattern" can be also an "architectural pattern"?

I received this question when discussing a design document with a junior developer that involved the "state design pattern". I answered YES to this question, that the "state design pattern" could be considered an "architectural design pattern" since the application is mainly a finite-state machine. Anyway, looking in Google I don't find a specific discussion related to this question, so I'm not sure if my answer was correct.

What is the correct answer (if it's possible to give one)? What is the rationale for your answer?

Best regards.

+1  A: 

It is a very subjective question and no right answer can be given.

Right now, at this morning hour, with rainy weather outside, I'm inclined to propose that a state machine is being not much of an architectural pattern. State machine rather defines the dynamics of application operation, the prerequisites and conditions for the application being in one state and going to another.

A structural organization mainly deals with static components, what are they, how they are interconnected and what their roles are. State machine may be regarded as simply one of the components.

Or it can be considered the one and only component of the system that is worth considering. In that case it might be regarded as an architectural pattern.

As I said, there is no right answer and no wrong answers.

Developer Art
The point about "static components" helped me to clear my mind. Yes, an architecture is about structure, and in that regard State hardly can be an architectural pattern. Thanks!
Abel Morelos
+1  A: 

"Design" usually refers to things on a smaller scale than "Architecture", and state machines are usually a small component, so in my opinion design pattern is the right classification.

Now if you have some pattern of interacting state machines which covers the whole system, then it might be a different story.

(It's sunny here, BTW, after a rather cloudy week.)

starblue