© 2008 by peter centgraf; made available under the epl v1.0 | 19 march, 2008 putting lazy tables...

15
© 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

Upload: jocelin-anderson

Post on 20-Jan-2018

213 views

Category:

Documents


0 download

DESCRIPTION

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

TRANSCRIPT

Page 1: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

© 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

Page 2: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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!

Page 3: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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

Page 4: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0

What’s the Solution? Paging!

Page 5: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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?

Page 6: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0

What do users really want? Virtual Tables!

Page 7: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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

Page 8: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0

How does it work? SWT.VIRTUAL

Page 9: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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

Page 10: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

Putting Lazy Tables to Work | © 2008 by Peter Centgraf; made available under the EPL v1.0

How does it work? ILazyContentProvider

Lazy

^

Page 11: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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

Page 12: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables 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

Page 13: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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

Page 14: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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

Page 15: © 2008 by Peter Centgraf; made available under the EPL v1.0 | 19 March, 2008 Putting Lazy Tables to…

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…