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.

Actually I'm going to build an Client Server Application, at the Login I recive the User Object from the Server. An user has a List of tasks, but I don't want to load them at the Login. So what would be an good style to recive the Tasks of an user. Should my user have an "GetTasks()" function which will access the server and will return the Tasks, which would be an strongly object orientated method. Or should I Use an Service, which has a function that takes the user as parameter and returns the task.

share|improve this question
    
what kind of client server application are you developing? Is the client web browser and the server an HTTP server? or are you using TCP based custom networking? or is it RMI? –  Jit B Mar 10 at 14:28
    
The communication is based on WebSockets using the socket.io libary with node.js –  kedritsch Mar 10 at 14:42

1 Answer 1

Should my user have an "GetTasks()" function which will access the server and will return the Tasks, which would be an strongly object orientated method.

I am not sure it's something strongly object-oriented.

Or should I Use an Service, which has a function that takes the user as parameter and returns the task.

Of course it would be better to use Service for that. Follow SoC here.

share|improve this answer

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.