Re: Repositories Global only or contextual?

Jose Fernandez <[email protected]>
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
Caleb, 

The way I see it, your root problem is not in the repository but the "application layer". 

A repository shouldn't be concern about "access and permissions" in your app. A repository simplifies the way we get data from the data source.

By the time you hit the repository it should be already clear if you're going to retrieve all tasks or just user's. That "filtering" decision is made right before you call the repository. 

Does that make sense?

Maybe I'm not picking up your question very well...

Sent from my iPhone

> On Jan 20, 2014, at 11:01 AM, Caleb Cushing <[email protected]> wrote:
> 
> So say I'm implementing a repository for a Todo app. We'll call it Tasks,
> 
> class Tasks implements Set { ... }
> 
> assume that for this a repository is just the set interface, and tasks
> are just strings
> 
> for (Task t : Tasks) {
> System.out.println( t );
> }
> 
> should this code iterate all of the tasks in the system? or
> should/could it simply iterate the tasks of the currently
> authenticated user?
> 
> If it's all tasks how should one go about getting to just the users tasks?
> -- 
> Caleb Cushing
> 
> http://xenoterracide.com
> 
> Calendar:
> https://www.google.com/calendar/embed?src=xenoterracide%40gmail.com&ctz=America/Chicago
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.