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 7556191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:48:18+00:00 2026-05-30T11:48:18+00:00

Submitted these two classes (along with business logic and data access logic) for code

  • 0

Submitted these two classes (along with business logic and data access logic) for code review. The reviewer laughed looking at the code and advised me to re-do the classes. He told me to do some research and would not give me any clues. I couldn’t find anything wrong. It looks little awkward that “submenu” is base class instead of menu. But my requirement is like that . . . menu is only of two levels (sub-sub-menu will never exist). What’s so funny about them? Would be grateful if somebody shows me the path to improve these classes.

[Serializable]
public class Menu: SubMenu
{
    private List<SubMenu> _subMenu;
    public List<SubMenu> SubMenu
    {
        get
        {
            if (_subMenu == null)
                _subMenu = new List<SubMenu>();
            return _subMenu;
        }
        set
        {
            _subMenu = value;
        }
    }
}

[Serializable]
public class SubMenu
{
    public int ID { get; set; }
    public string MenuText { get; set; }
    public string MenuURL { get; set; }
    public string ImageURL { get; set; }
}
  • 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-30T11:48:19+00:00Added an answer on May 30, 2026 at 11:48 am

    The biggest issue here is the professionalism of whoever did your review – you should ask that they be more constructive and helpful and if they still insist in being so rude that I’d take it to a manager.


    That said, my guess at what they saw in your design was the fact that you are using inheritance at all. Do you need inheritance here? It seems that you would be better served by having a Menu class which contains a list of SubMenus with no parent-child relationship or perhaps just a single MenuItem object which can contain a list of itself.

    I’d prefer the second approach actually, something like this maybe:

    [Serializable] 
    public class MenuItem
    { 
        public MenuItem()
        {
            MenuItems = new List<MenuItem>();
        }
    
        public int ID { get; set; } 
        public string MenuText { get; set; } 
        public string MenuURL { get; set; } 
        public string ImageURL { get; set; } 
    
        // I'm not bothering with the code to protect access to the list
        // in this example but you might want that too...
        public List<MenuItem> MenuItems { get; set; }
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the difference between these two form submission methods? <form method=post action=gert.php onsubmit=return
The last two Apps I have submitted and have had released (they're both Ready
I have two buttons. Both buttons have two attributes – data-from and data-to. When
I built two custom Zend_Form classes: form_1 and form_2.I instanciated both of them in
I often get doubt on these two phases. The following is my understanding: Apply
There is a form ,which is submitted and then the page is redirected to
When viewing submitted changelists in p4v, is there a way to display a particular
I submitted 5 jobs to an ExecutorCompletionService , but it seems like the jobs
I submitted an iPhone application to the app store, but it is failed to
I submitted a form via jquery, but I need the ActionResult to return true

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.