I have an application that basically has to execute a chain of processes. These processes act on different UNIX hosts and different Databases. So I came up with the following architecture in 3 layers. May question is basically about how I use the service layer.Process layer: each process gets split up in atomic units and I put each unit in a Command, using the command pattern. This means that for example if I have to create a file, upload it to a host and execute a unix command on this host, I have three commands to do this.Service layer: the service layer basically translates a database query or a unix command into it's proper form, setting the parameters and then sends it to the DAO. Remark: Sometimes I have to wait for a command to be executed by checking a state in the DB after the execution. I do this in the command, using a service function to execute the unix command and anothe service function to query the database for the update. DAO layer, which basically does queries, uodates, etc. But I consider SSHClients classes also as DAO.I have split the service layer into a service for each database or host. Is this a good idea or would it be better to unite them? Would it be better to have all this logic in the service layer? I did not do it, because the the commands would actually just be one call to the services each, and since I have them split up per DB or host, more than one service is needed for a command.Thanks for any hints on how to improve such a structure, where you deal with multiple databases.
Architecture with Commands, Service Layer and DAOs
object oriented design