Loading ...
Sorry, an error occurred while loading the content.

VS: [XP] RE: Testing Leftover - Visibility?

Expand Messages
  • lasse.koskela@accenture.com
    ... I regard method visibility important, but I have a hunch that this won t be the case for too long since I seem to be unable to convince myself
    Message 1 of 2 , May 31, 2004
    View Source
    • 0 Attachment
      > - What value or weight do you put on decisions of visibility for methods
      > or variables?
      > - Has that value or weight changed over time and is it more or less now
      > than in the past?

      I regard method visibility important, but I have a hunch that this won't be the case for too long since I seem to be unable to convince myself convincingly... Variable visibility used to be a no-brainer for me -- all variables should be private. At some point, I realized that it doesn't make any sense to create a dozen getters and setters for data-only classes being used near the "edges" of a system/component/whatever (think data transfer objects), and that it doesn't hurt to have "package private" (default visibility in Java) members except from a cosmetic point of view (syntax highlighting in Eclipse becomes less clear:)

      I believe these "weights" are strongly influenced by the Java textbooks and "best practices" I encountered while learning Java.
      I don't feel akward at all when using foo.Bar in C# (I've been reading up on .NET lately) simply because that's what I see all around me in books and articles... The VB code examples do give me the creeps, though ;)

      > - Has XP or TDD influenced your thinking on visibility? How? Why do
      > you think that is?

      TDD has definitely influenced my thoughts about method visibility. These days, the first thought I get from seeing a private method is "should this be here?"

      - Lasse -



      This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.


      [Non-text portions of this message have been removed]
    • Michael Campbell
      On Mon, 31 May 2004 21:54:09 +0200, lasse.koskela@accenture.com ... Are you accessing members there, or simply using C# s syntax sugar for properties? If the
      Message 2 of 2 , May 31, 2004
      View Source
      • 0 Attachment
        On Mon, 31 May 2004 21:54:09 +0200, lasse.koskela@...
        <lasse.koskela@...> wrote:
        >
        > > - What value or weight do you put on decisions of visibility for methods
        > > or variables?
        > > - Has that value or weight changed over time and is it more or less now
        > > than in the past?
        >
        > I don't feel akward at all when using foo.Bar in C# (I've been reading up on .NET lately)

        Are you accessing members there, or simply using C#'s syntax sugar for
        properties? If the latter, then that's the same as getters/setters,
        no?
      Your message has been successfully submitted and would be delivered to recipients shortly.