cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Michels <step...@apache.org>
Subject Re: cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl SlideSource.java
Date Thu, 09 Jan 2003 14:54:06 GMT



On 9 Jan 2003 giacomo@apache.org wrote:

> giacomo     2003/01/09 06:35:25
>
>   Modified:    src/scratchpad/src/org/apache/cocoon/components/source/impl
>                         SlideSource.java
>   Log:
>   make some method package protected instead of privat to increase performance by avoiding
'access emulated by a synthetic accessor method' (objected by eclipse)
>


Hmm, do really think that using package protected modifiers instead of
private modifiers make the implementation faster. For some time I read
an article, which says the private modifier make the fastest access
possible.

The assumption that the access is fast is only valid, if have accessor
methods like that

class MyClass
{
 private String text;

 public getText()
 {
   return text;
 }
}

class MyClass2
{
  String text;
}

MyClass2.text ist faster than MyClass.getText

In the case of SlideSource.java, you don't have accessor methods.
And if you are a friend of defensive programming, you will
always working with private member variables, and use
accessor methods instead.

Thank you for your effort, but I doesn't think this is a good idea :-/

Stephan Michels.

_______________________________________________________________________
         Stephan Michels               EMail: stephan@apache.org
         ICQ: 115535699                Tel: +49-030-314-21583
----+----|----+----|----+----|----+----|----+----|----+----|----+----|-|



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message