|
|
Subject: Re: TMAPI Future - msg#00077
List: text.xml.xtm.tmapi.general
Hi Lars,
[...]
> | Would you object if a tolog-specific helper object interface for
> | TMAPI outside org.tmapi.* were developed?
> * Kal Ahmed
> |
> | No objection at all!
> In that case, I expect to propose something based on Stefan's earlier
> proposal quite soon.
I'd like to suggest to change the method "next()" of the interface
TologResult to "hasNext()".
It seems unnatural (for Java programmers) to use a method "next()"
where the java.util.Iterator interface declares "hasNext()" for the
same task.
Best regards,
Lars
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost.... http://www.thinkgeek.com/sfshirt
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: TMAPI Future
Hi Kal,
[...]
>> - TopicMapObject getObjectBySourceLocator(Locator subjectLocator)
>> - Topic getTopicBySubjectIdentifier(Locator subjectIdentifier)
>> - Topic getTopicBySubjectLocator(Locator subjectLocator)
>>
>> I think we've already an agreement that we want these methods.
[...]
> -1 I think that the current interfaces make a lot more sense then
> arbitrarily deciding that certain lookup operations should be on an
> object interface. I don't buy the argument that it makes coding harder
> at all - you can hold a reference to the TopicMapObjectsIndex...its not
> like you have to go get it as a helper object every time.
No, but the TopicMapObjectsIndex has all disadvantages of our Index
interface: To be TM processor independent you must assume that the
TopicMapObjectsIndex is not autoupdated resp. ask it if it is
autoupdated.
If it returns "false" (which is a failure IMO), you've to call the
reindex() method regulary .
If we put the above mentioned methods to the TopicMap interface we
force that these methods reflect the actual state of the TopicMap and
the API user must not take care about updating this regular used
index.
Anyway, let's talk about it when the time has come. :)
Best regards,
Lars
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
Next Message by Date:
click to view message preview
tmapi/src/org/tmapi/core/test MergeInTest.java,1.17,1.18
Update of /cvsroot/tmapi/tmapi/src/org/tmapi/core/test
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19426/src/org/tmapi/core/test
Modified Files:
MergeInTest.java
Log Message:
- Removed baseName_XTM_1_1() test
Index: MergeInTest.java
===================================================================
RCS file: /cvsroot/tmapi/tmapi/src/org/tmapi/core/test/MergeInTest.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** MergeInTest.java 7 Jan 2005 16:03:37 -0000 1.17
--- MergeInTest.java 10 Jan 2005 18:24:58 -0000 1.18
***************
*** 55,59 ****
/** Tests if TopicName Merging is provided by this TMAPI Implementation */
public void testBaseName() throws TMAPIException {
! boolean xtm_1_1 =
m_tmSystem.getFeature("http://tmapi.org/features/model/xtm1.1");
Topic t1 = m_topicMap.createTopic();
TopicName bn1= t1.createTopicName( "testbn", null);
--- 55,59 ----
/** Tests if TopicName Merging is provided by this TMAPI Implementation */
public void testBaseName() throws TMAPIException {
! boolean xtm_1_1 =
m_tmSystem.getFeature("http://tmapi.org/features/model/xtm1.1");
Topic t1 = m_topicMap.createTopic();
TopicName bn1= t1.createTopicName( "testbn", null);
***************
*** 82,121 ****
}
- public void testBaseName_XTM_1_1() throws TMAPIException {
- boolean xtm_1_1 =
m_tmSystem.getFeature("http://tmapi.org/features/model/xtm1.1");
- if (!xtm_1_1) {
- return;
- }
- String reference = "http://tmapi.org/test/subjectIdentifier";
- Locator subjectIdentType1 = m_topicMap.createLocator(reference);
- Topic type1 = m_topicMap.createTopic();
- type1.addSubjectIdentifier(subjectIdentType1);
- Topic t1 = m_topicMap.createTopic();
- TopicName tn1= t1.createTopicName("testTN", type1, null);
-
- TopicMap tm2 = createTopicMap("test2");
- Locator subjectIdentType2 = tm2.createLocator(reference);
- Topic type2 = tm2.createTopic();
- type2.addSubjectIdentifier(subjectIdentType2);
- Topic t2 = tm2.createTopic();
- TopicName tn2= t2.createTopicName("testTN", type2, null);
- TopicName tn22= t2.createTopicName("testTN2", null);
-
- // Goal here:
- // type1 and type2 must be merged because of equal subject identifiers
- // After merging type1 and type2 the topicnames tn1 and tn2 have the
same
- // type and the parents of tn1 and tn2 must be merged (t1 and t2)
- m_topicMap.mergeIn(tm2);
-
- assertEquals("Topic with same TopicNames are not merged", 2,
m_topicMap.getTopics().size());
- assertEquals("TopicNames are not merged (added) or are not the
union", 2, t1.getTopicNames().size());
-
- TopicMap tm3 = createTopicMap("test3");
- Topic t3 = tm3.createTopic();
- TopicName tn3= t3.createTopicName("testbn500", null);
- m_topicMap.mergeIn(tm3);
- assertEquals("Topic with different TopicNames are not inserted", 3,
m_topicMap.getTopics().size());
- }
-
/** Test if matching is done when 2 Topics have the same SubjectIndicator
*/
--- 82,85 ----
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
Previous Message by Thread:
click to view message preview
Re: TMAPI Future
* Lars Marius Garshol
|
| Would you object if a tolog-specific helper object interface for
| TMAPI outside org.tmapi.* were developed?
* Kal Ahmed
|
| No objection at all!
In that case, I expect to propose something based on Stefan's earlier
proposal quite soon.
--
Lars Marius Garshol, Ontopian <URL: http://www.ontopia.net >
GSM: +47 98 21 55 50 <URL: http://www.garshol.priv.no >
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
Next Message by Thread:
click to view message preview
Re: TMAPI Future
On Mon, 10 Jan 2005 17:47:37 +0100, Lars Heuer
<heuer-0vbsL0CoYrBBDgjK7y7TUQ@xxxxxxxxxxxxxxxx> wrote:
Hi Lars,
[...]
| Would you object if a tolog-specific helper object interface for
| TMAPI outside org.tmapi.* were developed?
* Kal Ahmed
|
| No objection at all!
In that case, I expect to propose something based on Stefan's earlier
proposal quite soon.
I'd like to suggest to change the method "next()" of the interface
TologResult to "hasNext()".
It seems unnatural (for Java programmers) to use a method "next()"
where the java.util.Iterator interface declares "hasNext()" for the
same task.
The next() method is taken from java.sql.ResultSet.next(), so I would
not call it unnatural. And the query result interface is more like a
result set than an iterator anyway. :)
--
Geir O.
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
|
|