Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

Why is Document final?

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


steven.pannell at zooplus

Dec 23, 2005, 2:00 AM

Post #1 of 4 (1552 views)
Permalink
Why is Document final?

Hi,

Can someone please tell my why the Document class has no interface and is
final?

I want to create some documents that have some standard fields (eg: creation
date), and I don't want to keep repeating my code. This way I ensure some
standard conventions in all my documents.

What's the reason behind this? What's the argument against making an
interface and not having the document final?

look forward to some replies.
thanks
Steve.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


erik at ehatchersolutions

Dec 23, 2005, 2:31 AM

Post #2 of 4 (1438 views)
Permalink
Re: Why is Document final? [In reply to]

On Dec 23, 2005, at 5:00 AM, Steven Pannell wrote:
> Can someone please tell my why the Document class has no interface
> and is
> final?

Primarily because Lucene controls the construction of Document
instances returned from Hits.

> I want to create some documents that have some standard fields (eg:
> creation
> date), and I don't want to keep repeating my code. This way I
> ensure some
> standard conventions in all my documents.

You could ensure this by writing a wrapping method or class that
creates Documents for you.

> What's the reason behind this? What's the argument against making an
> interface and not having the document final?

How would Lucene reconstruct the Document instance from Hits using
your own implementation?

Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


steven.pannell at zooplus

Dec 23, 2005, 2:53 AM

Post #3 of 4 (1422 views)
Permalink
RE: Why is Document final? [In reply to]

Hi,

Yes, I can see why in this implementation it will not work. However, what
about using the XMLEncoder instead of Serializable? Using this method we
have both platform and class object independence. That would solve it.

Steve.


-----Original Message-----
From: Erik Hatcher [mailto:erik [at] ehatchersolutions]
Sent: 23 December 2005 11:31
To: java-dev [at] lucene
Subject: Re: Why is Document final?



On Dec 23, 2005, at 5:00 AM, Steven Pannell wrote:
> Can someone please tell my why the Document class has no interface
> and is
> final?

Primarily because Lucene controls the construction of Document
instances returned from Hits.

> I want to create some documents that have some standard fields (eg:
> creation
> date), and I don't want to keep repeating my code. This way I
> ensure some
> standard conventions in all my documents.

You could ensure this by writing a wrapping method or class that
creates Documents for you.

> What's the reason behind this? What's the argument against making an
> interface and not having the document final?

How would Lucene reconstruct the Document instance from Hits using
your own implementation?

Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


aruna.rawat at patni

Dec 23, 2005, 3:08 AM

Post #4 of 4 (1448 views)
Permalink
RE: Why is Document final? [In reply to]

Hi
Can u plz tell me if i have to ask any doubt so where should i mail.....

Regards,
Aruna Rawat
(Software Engineer)
Patni Computer Systems,
Millennium Business Park,
Mahape, Navi Mumbai 400 710
Phone: 022-27783600, Ext: 1708



-----Original Message-----
From: Steven Pannell [mailto:steven.pannell [at] zooplus]
Sent: Friday, December 23, 2005 4:23 PM
To: 'java-dev [at] lucene'
Subject: RE: Why is Document final?


Hi,

Yes, I can see why in this implementation it will not work. However, what
about using the XMLEncoder instead of Serializable? Using this method we
have both platform and class object independence. That would solve it.

Steve.


-----Original Message-----
From: Erik Hatcher [mailto:erik [at] ehatchersolutions]
Sent: 23 December 2005 11:31
To: java-dev [at] lucene
Subject: Re: Why is Document final?



On Dec 23, 2005, at 5:00 AM, Steven Pannell wrote:
> Can someone please tell my why the Document class has no interface
> and is
> final?

Primarily because Lucene controls the construction of Document
instances returned from Hits.

> I want to create some documents that have some standard fields (eg:
> creation
> date), and I don't want to keep repeating my code. This way I
> ensure some
> standard conventions in all my documents.

You could ensure this by writing a wrapping method or class that
creates Documents for you.

> What's the reason behind this? What's the argument against making an
> interface and not having the document final?

How would Lucene reconstruct the Document instance from Hits using
your own implementation?

Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene



http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at netadmin [at] patni and delete this mail.
_____________________________________________________________________

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.