LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 639 users online 211543 members 1333 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
BVPISTHEBEST
Movies: 1. Godfather 1 2. Godfather 2 3. Godfa...
Mood: Happy
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
4 online / 42 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Access Levels -- protected... !protected enough
think their should be more, etc?  (hopefully a discussion)
Replies: 4Last Post May 29, 2006 5:42pm by Whuppee
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( Whuppee )


Dairy Product Addict

Ad Free
Reply
This is specifically in regard to Java.  Of course, access levels are present in many languages... but possibly with different uses.  I believe C# may suffer from the same issue I feel that Java is, but I'm not yet familar enough with it to say.

As stated in the title / description.. this isn't so much a question, as an opinion I'd like feedback on.  If anything, I'd love to hear other opinions on this topic.


I'm going to temporarily assume I'm safe in skipping over public and private, believing them to be rather self-explanatory--do let me know if I'm wrong.  I'll be happy to talk about them as well, at request.

Anyway:

I always used protected to mean, "Only this class and/or subclasses of it will have access."

Given the practices I follow, that it worked in the bounds I expected it to, and that I was never informed otherwise.... well, it worked as expected.

At least, until I read that protected also meant, "Anything in the same package."


So, if I don't want something to be public...

But I want subclasses to be able to use it: protected.

Except that I ONLY want subclasses to be able to use it.

I dislike being "forced" to package things in regard to this, rather than in regard to their function.

I would personally love to see two versions of protected.  One that excludes all but subclasses... another that operates as the current one does.


Thoughts?

-------
Unbelievably awesomesauce to the absurd degree that I wet myself.
Who else has created a LW/magnets
so explicit the mods deleted a screencap of it? =P


10:36 pm on May 28, 2006 | Joined: May 2002 | Days Active: 362
Join to learn more about Whuppee Oregon, United States | Lesbian Male | Posts: 1,506 | Points: 7,147
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
telomere13


Dairy Product Addict

Patron
Tech Support Leader
Reply
Actually, there used to be a "private protected" keyword in Java which worked the same way as the C++ "protected" keyword (accessible to inheritors, but not others in a package), but it hasn't existed for quite some time now, presumeably because people didn't find it useful enough.

And for all the people telling the original poster not to post here because it has "crossed the line" and "no one will understand what the hell [he's] talking about," please leave.  Just because you happen to not know something doesn't mean that other people your age aren't allowed to know it, too.

-------
http://www.golivewire.com/forums/peer-yatapys-support-a.html


10:55 am on May 29, 2006 | Joined: April 2005 | Days Active: 1,190
Join to learn more about telomere13 Wisconsin, United States | Label Free Male | Posts: 5,352 | Points: 29,166
( Whuppee )


Dairy Product Addict

Ad Free
Reply
Ah, thanks for the response.

It's too bad they removed support for that feature... I, at least, would have considered it to have value.

I've come up with a few ways that still somewhat enforce this functionality, but I'm not wild about them.


Also, I've no idea what specific comments were made against myself / my subject matter... and it's entirely possible that those that made them won't even check this thread again, but I'd like to respond to both of them as well as anyone else who might happen to read this:


I love programming.  I love talking about and teaching programming related things.

I partially alluded to this (or meant my statement to, anyway) in my original post when I said that if anyone wasn't clear on what I was going on about that I'd be happy to explain.

Seriously.  Anyone wants me to explain intro programming material, classes, "best practices", encapsulating construction, design patterns, analysis mechanisms, inheritance / abstractions, etc... I'd be quite happy to.

One note, though =P ... I'm not wild about having 500 pages of code mailed to me, asking why it doesn't work.

In any case, if anyone doesn't understand what I'm talking about... or would like me to explain something else... I'll at least attempt to.

I feel I have a lot of valuable things to share, but I have far more still to learn myself.  On some topics, I'm certain this process could be easily reversed... and I would like to see that.

I'd love to be part of turning this community into one where we're all participating in learning and teaching each other.

-------
Unbelievably awesomesauce to the absurd degree that I wet myself.
Who else has created a LW/magnets
so explicit the mods deleted a screencap of it? =P


5:42 pm on May 29, 2006 | Joined: May 2002 | Days Active: 362
Join to learn more about Whuppee Oregon, United States | Lesbian Male | Posts: 1,506 | Points: 7,147
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic