© 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to Work Peter Centgraf Wednesday, 10:40am | Room 203/204
Jan 20, 2018
© 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008
Putting Lazy Tables to Work
Peter CentgrafWednesday, 10:40am | Room 203/204
Putting Lazy Tables to Work19 March, 2008
Introductions – or – Who is this guy?
• Peter Centgraf, Technical Lead,Master of Human-Computer Interaction
• RJ Lee Group, Inc.Materials Characterization Specialists
• Now back to your regularly scheduled purple....
Howdy!
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
What’s the Problem? …Slow…ness…
• Businesses generate lots of data(Especially successful ones…) Customers, Products, Orders, Invoices, etc.
• Good decisions require lots of data Browsing, finding trends, searching, investigating…
• Networks can’t keep up with people data requests
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
What’s the Solution? Paging!
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
Why do I hate paging?
• It’s not a solution!• Forces a tech problem onto the user
• Okay for the first page, terrible for the rest• The data does not have “pages”
Which page? Page what?
• Users want a fast visual scan Scroll wheels are awesome!
• What am I sorting? …searching?
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
What do users really want? Virtual Tables!
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
Why is this better?
• Users don’t want excuses – just lots of data• We can pretend to have it for them…
… and they won’t know the difference!
• Provides a transparent, low-latency user experience Compute on the server Cache locally Hide paging in the protocol!
• Don’t worry – it’s not difficult
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
How does it work? SWT.VIRTUAL
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
What is a Virtual Table?
• Demand-driven GUI widget!
• Table notifies when it needs to draw a row SWT.SetData event
• Listener fills in the data
• Getting the data is our problem
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
How does it work? ILazyContentProvider
Lazy
^
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
What is the API?• public void inputChanged(Viewer, Object, Object)
Kick start the process Call TableViewer.setItemCount(int)
• public void updateElement(int) The pulse of the user Call TableViewer.replace(Object, int)
• public void dispose() Take out your garbage, etc.
• protected void loadPage(…) The secret sauce
… when you want to
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
What does the client do?
• Capture user intentions – what do they want to see? Sorting, Filtering, and Scrolling
• Consolidate data requests Do more with less RPC
• Manage the local cache Local and remote invalidation
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
What does the server do? As much as it can!
• Minimum: Element Count Paging (first item, max items)
• Preferred: Dynamic Sorting Dynamic Filtering Dynamic Page Size Tuning
• Awesome: Real-time Change Notifications
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
What have you learned?• Optimize latency, not bandwidth
• Be clever with heuristics Handle “page up” gracefully Load data in the background Respond to network conditions, if possible
• Selection handling can be strange Restoring after refresh Selection change events
• Refresh early, refresh often
Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0
Did you really put a question in every title?
• Yes. Yes, I did.
• Find me: [email protected] http://www.centgraf.net
[email protected] http://www.rjlg.com
• Sample code under EPL coming soon…