Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6610499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:50:55+00:00 2026-05-25T19:50:55+00:00

Im a newish Ruby/Rails developer with years of Java experience. This security question is

  • 0

I”m a newish Ruby/Rails developer with years of Java experience. This “security” question is specific to ruby – not rails – which is why it was hard to find an answer as most rails security questions deal with web stuff.

As a Java developer I’ve read Effective Java several times. One of the key points made in that book is to protect your data and methods in your classes from malicious users. By that I mean : make as much of your code private as possible, use immutable classes and use defensive copying when returning references to immutable objects. You can use the final keyword too.

But in Ruby, everything is open. Sure you can make a method / data private, but but as a consumer of a Ruby API, is there anything stopping me from writing my own version of the method then simply (dynamically at run time or in code) attaching it to a class in the API? Seems like all the security discussed in Effective Java doesn’t apply to Ruby at all. Is this just a mindset shift from Java? Isn’t this a “flaw” in Ruby or other similar languages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:50:55+00:00Added an answer on May 25, 2026 at 7:50 pm

    The defense is against bad design, not intruders

    Encapsulation, class-private functionality, and other recommended OO design patterns are not there to defend again malicious foreign functions and enemy classes.

    Rather, the idea is simply to structure the program in a way that makes it less fragile and easier to modify.

    Think of each class as a separate building. We could build a new office so that it’s leaning on the next building to the north and perhaps extend some steel from the building to the west to help hold up our new structure.

    The obvious result would be damage to the structural integrity of the N and W neighbors, and questionable support for the new construction. With software, bad ideas like these are not always so obvious, so we read books full of principles and recommendations to remind us.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sorry for this very newbish question, I'm not much given into web development.
I'm newish to rails, and I started with rails 3 and ruby 1.8.7 I'm
Magento is a newish (past 5 years) PHP based Ecommerce system with an architecture
I'm newish to the python ecosystem, and have a question about module editing. I
I'm newish to Objective-C and my memory management skills are not great. However, I
Newish to mysql. I have a query and it is not showing the value
I'm extremly newish to Mac (now is the first time I see this operating
This is no doubt a newbish question, but I have looked for an answer
I know this is probably a very newbish question, so I apologize. I am
This is a very simple question, and I apologize for being so noobish :/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.