View Poll Results: What do you do when you encounter the problem I described?

Voters
4. You may not vote on this poll
  • Make sure all methods are only call-able from the right modules, at all cost

    0 0%
  • Just make the methods public for the sake of simplicity

    4 100.00%
Results 1 to 8 of 8

Thread: Hiding methods that shouldn't be call-able.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Hiding methods that shouldn't be call-able.

    Hey guys,

    I have a question for you.

    Lets say you've made program containing to modules A and B. There is an object of type X that is known in both modules. X has 4 methods:

    > P and Q that should only be called from the code inside module A.
    > R and S that should only be called from the code inside module B.

    How would you fix this? Just make all methods public and write proper documentation on how to use them, or make a strict separation by using interfaces or something else?

    I feel that creating a strict separation makes my program overly complex, while just making everything public feels dirty.

    Any ideas?

    Thanks
    Last edited by chronozphere; 21-01-2011 at 11:21 AM.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •