I've read almost every questions here and a lot of related argument in the www, but still I'm not sure to well understand the point, and probably I miss something that is obvious to everybody else, since I think is quite a common situation...
Please, forgive my terrible english and the mixed up terminology, but I'm not really interested in differences/advantages/caveats of DAO vs Repository, I think this does not change the 'core' of the question, but maybe I'm wrong.
Obviously the example is too simple and every solution is easily overkilling, but think at this as a 'case' for a much bigger system.
Assume you have to build an application to suggest salesmans the people to call.
Each prospect has some 'textual' data (i.e. name, gender, birthdate, address, phone number, email,...), a photo and some history of his/her interactions with other persons and vendors.
Textual data resides on a Mysql table (person), the photo somewhere in the filesystem and someone has already released services that return a list of persons potentialy interested to be contacted given the salesman and a score for every prospect as a buyer.
I'll probably end up with the following:
A Domain Object Person, with name, phone number, address, email and photo. Setters and getters for all the property plus a methods getScore().
Two DAO, one for the mysql table and one for the filesystem.
A service to get the list of the prospect for the given salesman (the user of the application, left out of the scope of this example).
What is not clear to me:
The method getScore() in the Domain Object could directly call the service in the service layer? If not, why?
Do I need separate DTO for data coming from different DAOs?
If so, I need some sort of manager or 'super' DAO that own the logics about how to assemble the two pieces of information (i.e. get the URI from the mysql DAO, retrieve the file, load the picture)? Should this reside in the Data Layer or in the Service Layer? (seems to me should stay in the data layer, as far as it deals with were data are stored).
The output of the manager or 'super DAO' should be another DTO or could be directly the Domain Object?
If DTO, do I need a service who call the manager/super DAO and build up the domain object (in this case I assume the service will 'add' the score to the domain object to).
Is an articulate question, I know, but I'm not able to figure out how to design the solution.