Captive Imagination
September 10, 2010, 04:03:14 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Hosting change completed. Please send an e-mail to support@captiveimagination.com if you have any problems.
 
   Home   Help Search Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: 2.0 Containers - Indexless?  (Read 575 times)
0 Members and 1 Guest are viewing this topic.
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« on: September 26, 2008, 02:23:25 PM »

I've been thinking about this for a while, and really believe it's the right decision going forward. The thing that makes me the most hesitant to do this is that I've never seen it done before anywhere. Obviously that doesn't necessitate that it's wrong, just innovative. Wink

I am planning to remove indexes entirely from containers in jSeamless 2.0.  What this means is that there will no longer be a get(int index) to get a child, no remove(int index) to remove a specific index, etc. You would have additional features to "addAfter", "addBefore", and others, but you would always reference via Object, not a specific index. I believe this is necessary in order to make a 100% concurrent UI framework. Indexes require synchronization to work properly because you can't have one thread cycling through children via index while another is removing items. You'll inevitably end up with IndexOutOfBoundsExceptions and/or referencing Objects you did not intend to reference.

I'm posting this as though I've thought about this a lot and don't believe there's anything "limiting" about this approach, I want to make sure there's nothing that is left "unable to be done" in we lose indexes in Containers. If anyone can think of any scenario that couldn't be handled please post it.
Logged
syam
Full Member
***
Offline Offline

Posts: 139


View Profile
« Reply #1 on: October 03, 2008, 02:57:42 AM »

I totally agree with you on this.

Swing developers got into this problem and one can make swing applications to throw IndexOutOfBoundExceptions by doing add(index) and remove(index) from complex event handling code.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.173 seconds with 21 queries.