You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gerhard Froehlich <g-...@gmx.de> on 2002/01/19 16:41:20 UTC

[simplestore] changing the interface

Hi Juozas,

>Agree, then I will move the StoreJanitor in a different package. Maybe we
>can forget it totally.
>
>I will change the interface today. But I think (as you) the most important
>things are Test classes and benchmarks.

I (try) think about the interface. What is better to implement the Map interface
+ our own interface or defining only our own interface. What do you think? In
the moment I implement the Map interface too. But then we are forced to use
in the most of the methods like put or somethink else their Exception!

In our interface there is only too method remaining:
Store getNextStore() and
void free()

free(), because that's the method which throws out the not needed object depending
on the alghorithm!

  Gerhard



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [simplestore] changing the interface

Posted by Juozas Baliuka <ba...@mwm.lt>.
>
>In our interface there is only too method remaining:
>Store getNextStore() and
>void free()
>
>free(), because that's the method which throws out the not needed object 
>depending
>on the alghorithm!

Yes "free()" can be useful for some  stores, in some cases service can 
recover itself,
in some cases throw something like "NotAvailableException" ,
it is kind of tree  from single directories ( List ) :

Service1
      ========> Servise2
                         =======> Service3
                                            ==========>
                                                  .............................

There are a lot ways to handle "NotAvailableException", in some cases it is 
possible to log failure (send SMS,email ...) and
remove some service from list.


Service1
      ========>[ Servise2    ]
                        [ === Dead ==]
                        Service3
                        ==========>
                                                  .............................



It can be some database, remote service .... (ARMI can be used, but its 
portabilty and transparensy is not clear for me at this time)

BTW don't think I think ARMI  is bad, I must know everything "bad", before 
I use it, "good" I can read myself. It is kind of missunderstanding, I have 
some communication problems, english is not my native language, I lean it 
myself and I don't know
diplomatic words. The same is about Cocoon,DCOM,CORBA, JAVA .... . It is 
about code and frameworks, not about persons,  organizations, companies 
..... .

  Next we can do easy to remove SoftMemoryStore it has nothing "good" it 
dublicates ideas from
  org.apache.commons.collections.SoftRefHashMap, but this class must be 
fixed, it will not work
  or we must use "free()" it will iterate all entries in map it is no need 
to do it for memory stores. "Bad" :). The same is about MRUMemoryStore 
(MRUMap).
We don't need a lot of implementations for memory store, we can have a 
single  class MemoryStore it
depends only on map implementation, look at 
org.apache.commons.collections.LRUMap (I must work good).
it can be implemented like this :
class MyMemoryStore extends MemoryStore{
   public MyMemoryStore(int param){
       super(new org.apache.commons.collections.SoftRefHashMap(param));// 
purge method must be fixed.
  }
  // no need to implement Store methods they are implemented in MemoryStore
// any map implementation can be used, there are some in java.util.*, some 
in org.apache.commons.collections.*
}
Simple solution. isn't it ? Work on maps for memory Store, it will be more 
useful for all in commons.

I believe you like code reuse and don't afraid to remove "bad" code. I am 
newer afraid to do it, it is very usual
for "good" projects.

It is very possible I will not write emails for you














>   Gerhard
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [simplestore] changing the interface

Posted by Gerhard Froehlich <g-...@gmx.de>.
Hi Juozas,
I changed the Store Interface. Checkout a fresh version. I also 
changed you SoftRefMemoryStore. But I don't know if I did every
thing right. Could you please cross-check this!

  Gerhard
 
"God put me on this Earth to accomplish a certain number of things. 
Right now, I am so far behind I shall never die."


>-----Original Message-----
>From: Gerhard Froehlich [mailto:g-froehlich@gmx.de]
>Sent: Saturday, January 19, 2002 4:41 PM
>To: Jakarta Commons Developers List
>Subject: [simplestore] changing the interface
>
>
>Hi Juozas,
>
>>Agree, then I will move the StoreJanitor in a different package. Maybe we
>>can forget it totally.
>>
>>I will change the interface today. But I think (as you) the most important
>>things are Test classes and benchmarks.
>
>I (try) think about the interface. What is better to implement the Map interface
>+ our own interface or defining only our own interface. What do you think? In
>the moment I implement the Map interface too. But then we are forced to use
>in the most of the methods like put or somethink else their Exception!
>
>In our interface there is only too method remaining:
>Store getNextStore() and
>void free()
>
>free(), because that's the method which throws out the not needed object depending
>on the alghorithm!
>
>  Gerhard
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>