why is IAtomContainerSet not an implementation of List<IAtomContainer>?

View: New views
12 Messages — Rating Filter:   Alert me  

why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Rajarshi Guha-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, while looking at IRingSet and IAtomContainerSet, it seems that  
that they are basically performing the function of a List. Is there a  
reason they don't implement the List interface?

-------------------------------------------------------------------
Rajarshi Guha  <rguha@...>
GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
-------------------------------------------------------------------
So the Zen master asked the hot-dog vendor,
"Can you make me one with everything?"
         - TauZero on Slashdot





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by gilleain torrance :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, for starters, I would be concerned if I saw a class like "XYSet
implements List"...

gilleain

On Tue, Sep 9, 2008 at 6:37 AM, Rajarshi Guha <rguha@...> wrote:

> Hi, while looking at IRingSet and IAtomContainerSet, it seems that
> that they are basically performing the function of a List. Is there a
> reason they don't implement the List interface?
>
> -------------------------------------------------------------------
> Rajarshi Guha  <rguha@...>
> GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
> -------------------------------------------------------------------
> So the Zen master asked the hot-dog vendor,
> "Can you make me one with everything?"
>         - TauZero on Slashdot
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Cdk-devel mailing list
> Cdk-devel@...
> https://lists.sourceforge.net/lists/listinfo/cdk-devel
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Rajarshi Guha-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 9, 2008, at 2:56 AM, gilleain torrance wrote:
> Well, for starters, I would be concerned if I saw a class like "XYSet
> implements List"...

Hmm, OK - one could always rename it to XYList. But more importantly,  
the class behaves like a list and not a set

-------------------------------------------------------------------
Rajarshi Guha  <rguha@...>
GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
-------------------------------------------------------------------
So the Zen master asked the hot-dog vendor,
"Can you make me one with everything?"
         - TauZero on Slashdot





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Egon Willighagen-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Sep 9, 2008 at 2:45 PM, Rajarshi Guha <rguha@...> wrote:
> On Sep 9, 2008, at 2:56 AM, gilleain torrance wrote:
>> Well, for starters, I would be concerned if I saw a class like "XYSet
>> implements List"...
>
> Hmm, OK - one could always rename it to XYList. But more importantly,
> the class behaves like a list and not a set

Can one do "implements List<IAtomContainer>" ?

Egon


--
----
http://chem-bla-ics.blogspot.com/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by gilleain torrance :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, all I meant is that the name should reflect the operations that
the class provides.

So, my suggestion would be either a) if it is a set, make it behave as
a set, or b) change its name to IRingList.

gilleain

On Tue, Sep 9, 2008 at 1:45 PM, Rajarshi Guha <rguha@...> wrote:

>
> On Sep 9, 2008, at 2:56 AM, gilleain torrance wrote:
>>
>> Well, for starters, I would be concerned if I saw a class like "XYSet
>> implements List"...
>
> Hmm, OK - one could always rename it to XYList. But more importantly, the
> class behaves like a list and not a set
>
> -------------------------------------------------------------------
> Rajarshi Guha  <rguha@...>
> GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
> -------------------------------------------------------------------
> So the Zen master asked the hot-dog vendor,
> "Can you make me one with everything?"
>        - TauZero on Slashdot
>
>
>
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Rajarshi Guha-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 9, 2008, at 8:52 AM, gilleain torrance wrote:
> Well, all I meant is that the name should reflect the operations that
> the class provides.
>
> So, my suggestion would be either a) if it is a set, make it behave as
> a set, or b) change its name to IRingList.


If at all it does get changed (there may be reasons for not  
implementing List) then I'd got for b).

a) is actually problematic since the current behavior of  
IAtomContainerSet allows duplicates and provdes indexed access, which  
the Set interface does not provide

-------------------------------------------------------------------
Rajarshi Guha  <rguha@...>
GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
-------------------------------------------------------------------
So the Zen master asked the hot-dog vendor,
"Can you make me one with everything?"
         - TauZero on Slashdot





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Rajarshi Guha-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 9, 2008, at 8:50 AM, Egon Willighagen wrote:

> On Tue, Sep 9, 2008 at 2:45 PM, Rajarshi Guha <rguha@...>  
> wrote:
>> On Sep 9, 2008, at 2:56 AM, gilleain torrance wrote:
>>> Well, for starters, I would be concerned if I saw a class like  
>>> "XYSet
>>> implements List"...
>>
>> Hmm, OK - one could always rename it to XYList. But more importantly,
>> the class behaves like a list and not a set
>
> Can one do "implements List<IAtomContainer>" ?

Yes - that's what ConformerContainer does

-------------------------------------------------------------------
Rajarshi Guha  <rguha@...>
GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
-------------------------------------------------------------------
So the Zen master asked the hot-dog vendor,
"Can you make me one with everything?"
         - TauZero on Slashdot





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by gilleain torrance :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, if it allows duplicates, may I humbly suggest that it is not a
set! It is a bag.

The index methods are strange in a way as they are only partly there.
If it were a list, then you could add and remove from particular
positions, and also get AtomContainers from those positions. If it was
truly a bag or a set, then you couldn't.

Perhaps I'm being too dogmatic about the naming, but since this is in
the interface package, then it is the 'clients' of the CDK who use
these classes, and they should be as clear as possible, I think.

gilleain

On Tue, Sep 9, 2008 at 2:02 PM, Rajarshi Guha <rguha@...> wrote:

>
> On Sep 9, 2008, at 8:52 AM, gilleain torrance wrote:
>>
>> Well, all I meant is that the name should reflect the operations that
>> the class provides.
>>
>> So, my suggestion would be either a) if it is a set, make it behave as
>> a set, or b) change its name to IRingList.
>
>
> If at all it does get changed (there may be reasons for not implementing
> List) then I'd got for b).
>
> a) is actually problematic since the current behavior of IAtomContainerSet
> allows duplicates and provdes indexed access, which the Set interface does
> not provide
>
> -------------------------------------------------------------------
> Rajarshi Guha  <rguha@...>
> GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
> -------------------------------------------------------------------
> So the Zen master asked the hot-dog vendor,
> "Can you make me one with everything?"
>        - TauZero on Slashdot
>
>
>
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Egon Willighagen-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Sep 9, 2008 at 3:14 PM, gilleain torrance
<gilleain.torrance@...> wrote:
> Perhaps I'm being too dogmatic about the naming, but since this is in
> the interface package, then it is the 'clients' of the CDK who use
> these classes, and they should be as clear as possible, I think.

No worries about that. Trunk is open for new stuff, including API changes.

Egon

--
----
http://chem-bla-ics.blogspot.com/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Rajarshi Guha-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 9, 2008, at 9:14 AM, gilleain torrance wrote:
> Well, if it allows duplicates, may I humbly suggest that it is not a
> set! It is a bag.

Agreed, though there is no Bag interface in Collections.

More importantly, the behavior of IAtomContainerSet and IRingSet are  
inconsistent between as well as inconsistent within IRingSet itself. See

https://sourceforge.net/tracker/?
func=detail&atid=120024&aid=2101109&group_id=20024

I think this needs to be addressed before renaming etc

> The index methods are strange in a way as they are only partly there.
> If it were a list, then you could add and remove from particular
> positions, and also get AtomContainers from those positions. If it was
> truly a bag or a set, then you couldn't.
>
> Perhaps I'm being too dogmatic about the naming, but since this is in
> the interface package, then it is the 'clients' of the CDK who use
> these classes, and they should be as clear as possible, I think.

I agree with this - yesterday, I tripped up over the add() method in  
IRingSet. It makes sense to have add(IRingSet) and add(IRing) but  
after a while I realized that the latter is actually implemented as  
addAtomContainer(IAtomContainer) in the superclass. But as the above  
bug notes, add(IRingSet) and addAtomContainer(IAtomContainer) exhibit  
contradictory behavior (I think it's a bug, but may just be  
undocumented)

This is definitely not intuitive - whereas if it implemented List (or  
Set) it would have been much more natural

-------------------------------------------------------------------
Rajarshi Guha  <rguha@...>
GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
-------------------------------------------------------------------
So the Zen master asked the hot-dog vendor,
"Can you make me one with everything?"
         - TauZero on Slashdot





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Egon Willighagen-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Sep 9, 2008 at 3:15 PM, Egon Willighagen
<egon.willighagen@...> wrote:
> On Tue, Sep 9, 2008 at 3:14 PM, gilleain torrance
> <gilleain.torrance@...> wrote:
>> Perhaps I'm being too dogmatic about the naming, but since this is in
>> the interface package, then it is the 'clients' of the CDK who use
>> these classes, and they should be as clear as possible, I think.
>
> No worries about that. Trunk is open for new stuff, including API changes.

There are likely other things we want to change in the API, such as
split up of the interfaces into modifiable and unmodifiable, making
event listeners an addon, making atom type, isotope, element fields
instead of using inheritance, etc, etc...

Let's take our time for this, and do this properly and head to CDK 2.0
based on those new interfaces...

Egon

--
----
http://chem-bla-ics.blogspot.com/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: why is IAtomContainerSet not an implementation of List<IAtomContainer>?

by Jonathan Alvarsson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Sep 9, 2008 at 3:14 PM, gilleain torrance
<gilleain.torrance@...> wrote:
> Well, if it allows duplicates, may I humbly suggest that it is not a
> set! It is a bag.

Well there are no bags in the collection framework but you might wanna
have it implement the Collection interface...

There are benefits with that.

--
// jonalv

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel
LightInTheBox - Buy quality products at wholesale price!