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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:21:13+00:00 2026-05-12T06:21:13+00:00

Possible Duplicate: Relational UML Diagram inspired by SO I have developed my homework from

  • 0

Possible Duplicate:
Relational UML Diagram inspired by SO

I have developed my homework from the post.

Problem: to do posts similarly as in SO so that the first post is the question and the other posts are replies after the question.

Question: How would you improve the interfaces? Would some simpler data structure make things easier?

  • 1 1 Answer
  • 2 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-12T06:21:13+00:00Added an answer on May 12, 2026 at 6:21 am

    Your first question confuses me. UML makes me think of objects and “Posts-table” makes me think of relational databases. Which one do you mean? I’ll assume that you want objects.

    You need an interface or abstraction that represents both questions and answers – maybe that’s the Post interface. It’ll have attributes like text and author and a timestamp when it was posted.

    Since the question will never come before an answer, if you have a collection of Post instances it’ll be in the proper order if you sort it by timestamp.

    UPDATE: UML means object-oriented programming. Python is both an object-oriented and a functional language. So that means you’ll be thinking about the problem in terms of objects first.

    Thinking in terms of objects means setting aside concerns about user interface and database. You design the objects to provide the kind of behavior that you need. You can have a simple text interface at first, and object serialization will do for persistence. But get the objects right first.

    When you say “interface”, I think of Java interfaces. They declare the signature of the class, but say nothing about implementation. So your Post interface might have Question and Answer implementations.

    What contains all the Post instances? What owns them? I’d have another object called KnowledgeExchange to own the collection of Posts. Let it hide all the implementation details and provide methods to getQuestion and getAnswers. Don’t force your clients to have to know all those details or even whether or not you implement it as a stack or list.

    Like I said, don’t worry about tables or persistence just yet. Think about objects. Best to make the whole problem in terms of objects instead of just Post, Question, and Answer.

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

Sidebar

Related Questions

Possible Duplicate: Can I have a Django model that has a foreign key reference
Possible Duplicate: Subtract days from a date in javascript I have got a JavaScript
Possible Duplicate: Variable doesn’t get returned from AJAX function I have this function: function
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: SQL left join vs multiple tables on FROM line? SELECT messages.message_title, messages.message_content,
Possible Duplicate: Bidirectional multi-valued map in Java I need a data structure that implements
Possible Duplicate: Plotting 4 curves in a single plot, with 3 y-axes I have
Possible Duplicate: Firefox body margin bug? I have previously gotten stuck with vertical padding
Possible Duplicate: RegEx match open tags except XHTML self-contained tags I have a HTML
Possible Duplicate: Relational database design question - Surrogate-key or Natural-key? When I create relational

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.