lazy-loading

Javascript: Lazy Load Images In Horizontal Div?

I have a div that has a bunch of thumbnails showing horizontally (with a horizontal scrollbar). Is there a way to lazy load these thumbnails and only show them once the user horizontally scrolls to their position? All the examples I've seen check the browser window, not a div. This is for contest entries so sometimes there are hundreds ...

Struts2 JSON Plugin not working with "lazy" data

I have an Entity with a OneToOne relation that is fetched lazily: @Entity public class Person { @Id private Integer id; @Column(length=60) private String address; @OneToOne(fetch=FetchType.LAZY) @JoinColumn(name="idProvince") private Province province; } This is the test I do, trying to get all the entiti...

Linq to Sql Deferred Loading

If you do not plan to use lazy loading, should deferred loading be explicity set to false within a "using" block? It seems to me that child objects are being loaded by dataContext within the block. ...

Repository Pattern: how to Lazy Load? or, Should I split this Aggregate?

I have a domain model that has the concept of an Editor and a Project. An Editor owns a number of Projects, and a Project has not only an Editor owner, but also a number of Editor members. Therefore, an Editor also has a number of "joined" Projects. I am taking a DDD approach to modelling this and using the Repository pattern for pers...

NHibernate: can't successfully set lazy loading

I have a table Parent and a table Child. Child contains a foreign-key to the Parent table, creating a one-to-many relationship. Here is a part of my mapping that I define with fluent NHibernate: public class ParentMap : ClassMap<Parent> { public ParentMap() { WithTable("Parents"); Id(x => x.Id, "ParentID") ...

Is there a conflict when using Data Caching and Lazy loading?

If I plan to use data caching do I have to worry about conflicts when also using deferred loading? It seems that with linq i am losing control of my data. ...

Lazy Loading DTO fields in Spring

I have a project that is using Spring and is broken down into a couple dozen DAOs and associated DTOs. I'm using JdbcTemplate, but not much else, as it's exactly the level of abstraction I'm happy with. I'm currently performing lazy loading on my DTOs by placing some rather hairy code in their getters. Basic boilerplate logic is: 1....

How to delay loading aproperty with linq to sql external mapping?

I have a table that contains some blob fields that I don't want to load by default. In a dbml file it is possible to set the delay loaded property for such fields. Is there a similar option for external mapping files? ...

Lazy loading - what's the best approach?

I have seen numerous examples of lazy loading - what's your choice? Given a model class for example: public class Person { private IList<Child> _children; public IList<Child> Children { get { if (_children == null) LoadChildren(); return _children; } } } The Pers...

Lazy load images in UITableViewCell

Hi I have some 50 custom cells in my UITableView. I want to display an image and a label in the cells where I get the images from URLs. I want to do a lazy load of images so the UI does not freeze up while the images are being loaded. I tried getting the images in separate threads but I have to load each image every time a cell becomes...

Designing a lazy vector: problem with const

I wrote a little "lazy vector" class (or, delayed vector) which is supposed to look like a std::vector and usable wherever a std::vector is used, but it loads its elements "lazily", i.e. it will load element n (and possibly a few more) from disk whenever someone accesses element n. (The reason is that in my app, not all elements fit into...

Does linq to sql automatically lazy load associated entities?

Does linq to sql automatically lazy load associated entities? I would think it would but I can't find an article stating it as such. ...

Asp.Net MVC - Rob Conery's LazyList - Count() or Count

I'm trying to create an html table for order logs for customers. A customer is defined as (I've left out a lot of stuff): public class Customer { public LazyList<Order> Orders { get; set; } } The LazyList is set when fetching a Customer: public Customer GetCustomer(int custID) { Customer c = ... c.Orders = new LazyList<O...

Lazy loading not working for many-to-one relationship when mapping to a non-key field using property-ref

I have a legacy database that I am mapping using NHibernate. The objects of concern are an Account and a list of Notification objects. The objects look like: public class Notification { public virtual int Id { get; set; } public virtual DateTime BatchDate { get; set; } /* other properties */ public virtual Account Acco...

What is the impact of lazy="false" on class element of NHibernate mapping?

I'm working with a legacy system that I'm experimenting with adding NHibernate to. I have class that I need to be mapped to a table, but it has lots of existing methods that are not virtual. I discovered that I can get NHibernate to load the mapping successfully even with the non-virtual methods present if I set the "lazy" attribute on...

Is a lock required with a lazy initialization on a deeply immutable type?

If I have a deeply immutable type (all members are readonly and if they are reference type members, then they also refer to objects that are deeply immutable). I would like to implement a lazy initialized property on the type, like this: private ReadOnlyCollection<SomeImmutableType> m_PropName = null; public ReadOnlyCollection<SomeImmu...

Determine the number of items to fetch

I'm writing a lazy list to retrieve items from a database with a given criteria and a given paging (start index and number of items desired). At the instantiation of the list I count the total number of items in the mapped table, so that I have an initial size of the list (initial, because the list permits the addition and removal of it...

Calling a getter without assigning it to anything (lazy loading)

I have a DTO which can be fully loaded or lazy loaded using Lazy Load Pattern. How it is loaded depends on what the Flex Application needs. However, this DTO will be sent to a Flex application (swf). Normally, a collection for instance, will only be loaded when called. In my case however, the collection will only be called in Flex, so my...

Another Linq2Sql Lazy loading question

Hi I have a read-only database, so I am turning off ObjectTracking (thus implicitly turning off DeferredLoading). I wish to do lazy loading and not use LoadWith<>. What is the simplest way to explicitly tell Linq to go and lazy fetch a relation just before I need the data itself. For example: a simple dbml If I have the following co...

Data Transfer Objects and transactional service methods

Is there any truly practical way to avoid using DTOs, when passing data through Hibernate-backed transactional service methods? In other words, are DTOs the only non-hacky solution to avoiding lazy initialization problems? I think the two popular alternatives to DTOs and the reasons I don't really like them are: Open Session in View p...