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

  • Home
  • SEARCH
  • 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 6869093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:30:55+00:00 2026-05-27T03:30:55+00:00

Say an application in ruby when started has two modes : commandline mode and

  • 0

Say an application in ruby when started has two modes : commandline mode and filemode

When given a parameter ruby myprogram input.txt output.txt, it generates an output based on some commands in input file. also when not provided with any parameter it presents us with a command prompt. with following commands.

create_class_with_capacity 40

create_student_with_marks Alex 70

create_student_with_marks Mathew 30

create_student_with_marks John 55

..

create_student_with_marks Sylvia 70 etc...


fail_student_roll_no 12

=> Student with roll number 12 #{student} failed


give_marks_to_roll_no 70 1

=>Student with roll number 1 Alex got 70 marks


find_all_students_with_marks 70

=> Alex, Peter , Russell , Mark etc...

How to design such an application keeping RSpec,TDD , Cucumber , SOLID and Patterns in Mind.
What i am directly asking is What should be Objects here to design what should be a module if applicable etc.. ? and how to gauge what needs to be tested here and what not ? Designing the most Appropriate Mechanism in terms of Object Oriented design.

Also Please Refer To some books or blogs to learn these kind of object oriented design principles and practices for ruby.

  • 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-27T03:30:55+00:00Added an answer on May 27, 2026 at 3:30 am

    Are you saying that you have to write this application? Is this homework?

    Sounds to me like you’re suffering from analysis paralysis. There are far too many buzzwords zooming around in your head.

    Stop worrying about patterns and what not. Decompose the problem into pieces and start writing some code.

    The one recommendation I’d make is to keep I/O out of our classes. Put all the logic that has nothing to do with interacting with users in the base classes. That way they’ll still work if you’re asked to create a web-based UI to replace your text version.

    What has to be tested? All the code that you think might break.

    The most appropriate method of object-oriented design? Do the obvious thing: nouns are potential objects in your problem statement, verbs are potential methods.

    Here are some potential objects that I see: Student, Course, Roll.

    Here are some potential methods: CRUD operations for Student and Course; setting grades and marking a Student as failing.

    It’s not that complicated. Think “simple” and get something working, then refine it.

    UPDATE:

    It’d be easier to answer you if you could describe what you did.

    If it’s the homework problem that I think it is, I doubt that it would make much difference. Rather than make us guess, why don’t you read SOLID and start looking at the classes you created ask yourself if it conforms to those principles.

    Patterns? Overrated. Don’t worry about them.

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

Sidebar

Related Questions

I have a Ruby on Rails application that has two active environments, Stage and
Say my application has a list of items of some kind, and users can
How to open file in its default application using Ruby scripts? Let us say,
So, I have Ruby on Rails application. Blank for now. And let me say
In fairly large Ruby application, we have a situation where a given object is
Let's say I have a Ruby on Rails blogging application with a Post model.
Lets say an application is broken into modules, each module exposing functionality via EJBs.
When I say installed application, I basically mean any application visible in [Control Panel]->[Add/Remove
Section 7.1.6 of the Modeshape docs say 'Your application can now create and remove
How can I guarantee that floating point calculations in a .NET application (say in

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.