Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design Pattern for Data Processing? (MVC alternative)

As a PHP/Web Developer, I'm a huge fan of MVC (Model-View-Controller). I love building an app on a solid foundation which definitely separates business logic, presentation logic, and flow of control.

However, I do a lot of work as well on server-side-only apps, which merely process data and log the process and any relevant results (such as import scripts, data migration scripts, web services, TCP socket servers, etc). There is no need for a big fancy MVC framework in these cases.

I realize that MVC can still be applied here, but it seems like overkill. Besides a raw procedural approach or a random mash-up of class objects, are there any specific Architectural Design Patterns out there especially suited to data-processing, run-once, and server daemon type applications?

like image 619
Brian Lacy Avatar asked Feb 10 '10 01:02

Brian Lacy


2 Answers

If I understand correctly, the applications you're talking about don't have a user interface beyond the shell command line. If that's the case, you can still use MVC at the software architecture level - your View will simply be trivial. Your Controller will similarly be trivial, since there are very few actions to propagate between the Model and the View.

Of course, with a trivial View and Controller it might as well not be any pattern at all. I don't see an issue with that (at the level you're talking about). The key is to take an interface-based approach (much as you would with MVC) and this will tend to give a better design in the end; one which may easily be adapted to a different user interface or means of invocation if required in the future.

like image 166
Steven Mackenzie Avatar answered Nov 06 '22 08:11

Steven Mackenzie


I guess you need to start by asking yourself what's the problem you want to solve (with these patterns you're looking for)

Once you know this, you might find something useful here:

http://martinfowler.com/eaaCatalog/

like image 1
Aivar Avatar answered Nov 06 '22 10:11

Aivar