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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:06:02+00:00 2026-06-04T21:06:02+00:00

We’re developing a client and server application for the library of the university. Beside

  • 0

We’re developing a client and server application for the library of the university. Beside all book managing and lending functions the application has to be able to manage users.

We decided on 3 different user types:

  1. Guests (may view basic information)
  2. Logged in users (access basic functions like book borrowing)
  3. Administrators (full access, including managing books and users)

This is my first bigger project and even though I read many Java lectures I cannot decide on a good way of modelling the following requirements *on the client side:

  • The client application has to manage the current login. The current user may change their basic information.
  • Administrators may change all information

Now my problem: Shall every User class have the getters and setters, even though the current user may only be a Guest? What shall happen in the case when a setXY() is called without the rights to change information? Where in the code shall the authorization happen? User class? Server-API class?

A example or a link to an existing model like this would be very helpful. Thanks in advance.

  • 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-06-04T21:06:03+00:00Added an answer on June 4, 2026 at 9:06 pm

    One approach would be to use inheritance, i.e. a base abstract User class and AnonymousUser, GuestUser and AdminUser. Each class extends the capabilities of its parent. That works in simple scenarios but it is not flexible and especially hard to extend afterwards.

    A better solution would be to create a User class that implements all required functionality (~ AdminClass in former example) and wrap it in a proxy that is aware of the different user roles and may restrict access to single methods.

    These checks should always take place at the server, as you can not prevent requests from malicious clients.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
In my XML file chapters tag has more chapter tag.i need to display chapters
I have a text area in my form which accepts all possible characters from

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.