Mohamed, what about that old example with FNH ? have you some news ?

--
Fabio Maulo


El 27/04/2011, a las 00:49, Mohamed Meligy <[email protected]> escribió:

You might be looking for something like:

>
> session.CreateFilter(entity.YourCollection).SetMaxResults(x).SetFirstResult(y)

This is quoted from one of Fabio's latest emails to this list. Thanks
Fabio!

You mihgt also have some kind of view model or whatever, that has the
project entity and the Tasks collection and maybe the pagining parameters
(like total count, etc...).
You can use features like Futures and ADO.NET batch size to optimize
querying for this.



*Mohamed Meligy
*Readify | Senior Developer

M:+61 451 835006 | W: readify.net
[image: Description: Description: Description: Description:
rss_16]<http://gurustop.net>
[image: Description: Description: Description: Description:
cid:[email protected]]
<http://www.linkedin.com/in/meligy>  [image:
Description: Description: Description: Description:
cid:[email protected]] <http://twitter.com/meligy>
 
<http://www.greatplacetowork.com.au/best/best-companies-australia.php><http://www.readify.net/AboutUs/NewsItem.aspx?id=10>



On Wed, Apr 27, 2011 at 7:10 AM, Stephen Hardie <[email protected]>wrote:

> Ok let's use another example (I only used customer/order objects because
> everyone is on the same page regarding them, or so I thought)...
>
> Say I have a project and a task object. the project has many tasks (10,000)
> and I wan't to go through all 10,000 tasks and invoke them all. As it stands
> now if I wanted to do this, I'd have to go through IQuery and page the tasks
> directly. Instead I would prefer the following..
>
> 1. Get the project (by id)
> 2. Enumeration project.Tasks  (this step is where nhibernate should offer
> the ability to page the Tasks collection automatically.)
> (Note: I've seen and used another ORM framework that actually did provide
> this functionality, unfortunately it's proprietary and very old,
> before nhibernate existed).
> 3. Invoke the task.
>
>
> The point isn't about what two parent/child objects I have, the point is I
> want to be able to page a parent's child collection without breaking up the
> domain model or turning lazy loading off.
>
>
> Thank you José for listening and discussing this with me. It's very
> helpful!
>
>
>
> On Tue, Apr 26, 2011 at 11:07 AM, José F. Romaniello <
> [email protected]> wrote:
>
>> You are mixing concepts here.
>> Aggregate roots has nothing to do with hierarchies structures.
>> The domain you are showing is the -hello world- of learning what is an
>> aggregate and what it is not.
>> Order and Customer are *usually* two different aggregates, while OrderLine
>> belongs to the Order aggregate.
>> You have to think what does make more sense for your application and what
>> thing deserve to be an aggregate root. If you have customers with 10.000
>> orders Id say; without any doubt, that an "order" is an important thing in
>> your system *per-se*.
>>
>> A worse example of what you are doing will be to nest everything like;
>> Country => Provinces => Cities => Customer => Orders..
>> Then if you need to add an order to your system, you use a
>> CountryRepository to get the country of the customer, find the province of
>> your customer, find the city, find the customer, and add the order to his
>> order collection. This does not make sense.
>>
>> 2011/4/26 Stephen Hardie <[email protected]>
>>
>>> Because making it into it's own aggregate root breaks the domains
>>> hierarchy structure, which in turn causes the domain model to be that much
>>> more difficult to understand and follow.
>>>
>>>
>>>  On Tue, Apr 26, 2011 at 4:14 AM, José F. Romaniello <
>>> [email protected]> wrote:
>>>
>>>>  Order is almost always an aggregate root in that example.
>>>>
>>>> Why do you think that having Customer -> Orders (10000) is less uglier
>>>> than having Order as aggregate root?
>>>>
>>>>
>>>>
>>>>
>>>> 2011/4/26 Kinstephen <[email protected]>
>>>>
>>>>> as Customer ->
>>>>> Orders (10,000 or more records/entities)
>>>>>
>>>> ...
>>>>
>>>> And the only work around architecturally is to make Orders into an
>>>>> aggregate root of it's own and then use IQuery to setup paging. To me
>>>>> this seems rather ugly as it breaks the domain hierarchy up into an
>>>>> unnatural object model.
>>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "nhusers" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/nhusers?hl=en.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "nhusers" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/nhusers?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "nhusers" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

 --
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to