Søren Hilmer wrote:
>
>
> No, I believe we are exactly on the same wavelength, I would
> not really make
> the instance variables protected, just supply
> getters/setters, which amounts
> to the same functional wise, I guess I was not clear on that.

Excellent!

If you happen to use Eclipse, its refactoring tool includes self
encapsulation. This may save some time.

Also, while making this change it might be worth considering adding a prefix
to the variable names, 'field' is typical. So...

    private String name;

    protected String getName()
    {
        return this.name;
    }

    protected void setName(String name)
    {
        this.name = name;
    }

becomes...

    private String fieldName;

    protected String getName()
    {
        return name;
    }

    protected void setName(String name)
    {
        fieldName = name;
    }

This has two advantages. Firstly, it avoids mistaken direct access to the
variable and secondly it makes the class JavaBean compatible. Again, Eclipse
helps out with the rename refactoring tool.

Not a big deal, but if we are tidying up variable access we may as well do
everything that needs to be done in one pass.

-- Steve

- - - - - - - - - - - - - - - - - -

This private and confidential e-mail has been sent to you by Synergy Systems Limited. 
It may not represent the views of Synergy Systems Limited.

If you are not the intended recipient of this e-mail and have received it in error, 
please notify the sender by replying with "received in error" as the subject and then 
delete it from your mailbox.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to