Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Situation:
I've some scripts that simulate user-activity on desktop. Therefore I've defined a few cases (workflows) and implemented them in Python. I've also written some classes for interacting with the users' software (e.g. web browser etc.).

Problem:
I'm a total beginner in software design / architecture (coding isn't a problem). How could I structure what I described above?

Providing a library which contains all the workflows as functions, or a separate class/module etc. for each workflow?

I want to keep the the workflows simple. The complexity should be hidden in the classes for interacting with the users' software.

Are there any papers / books I could read about this, or could you provide some tips?

share|improve this question
2  
It's difficult to say, but imagine you have to edit the code in half a year –  superM Aug 6 '12 at 19:18
add comment

1 Answer 1

up vote 1 down vote accepted

I tend to prefer to represent series of actions as series of statements, which would equate to actual code. That would mean a function with the steps to simulate the activity as method calls on the objects that represent the interface to be interacted with. This seems to be what you describe as having already.

However, if the actions are something that need to be editable by the user or some other part of the system, then you need to have a representation for the steps of the scripts. That sounds very familiar so I'm pretty sure there is a design pattern to do just that. I would suggest looking at the Command, Strategy and Template Method design patterns, as one or more of them might be what you are looking for. If you need a book, those I mentioned are described in the "Gang of Four" book, Design Patterns: Elements of Reusable Object-Oriented Software, which is the book that introduced the concept of design patterns.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.