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

The Archive Base Latest Questions

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

I was trying to write a user authentication system in Java. So I wrote

  • 0

I was trying to write a user authentication system in Java. So I wrote some DAO class. First I did write a class named Persistence which is abstract. It is responsible for holding some common attributes. And wrote a class named User extending Persistence class. Those classes are –

  public abstract class Persistance {

     private Date createdDate;
     private Date lastUpdatedDate;
     private long version;
     private boolean  isDeleted;


    //getter and setters
 }

and the user class

 public class User extends  Persistance{
   private String username;
   private String password;
   private String passwordConfired;

  // getters and setters

 }

My questions are- what is the best way to write variable name, which one is good, createdDate or dateCreated, deleted or isDeleted etc.

And is this approach is okay or is there more good approach ?
And how to implement data versioning?

  • 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:59:57+00:00Added an answer on May 25, 2026 at 7:59 pm

    You are mixing a DAO (data access object) and a VO (value object) – also known as a DTO (data transfer object) – in the same class.

    Example using an interface for DAO behavior (blammy and kpow might be webservice, oracle database, mysql database, hibernate, or anything meaningful):

    public interface UserDTO
    {
        boolean deleteUser(String userId);
        UserVO readUser(String userId);
        void updateUser(String userId, UserVO newValues);
    }
    
    package blah.blammy;
    public class UserDTOImpl implements UserDTO
    {
      ... implement it based on blammy.
    }
    
    package blah.kpow;
    public class UserDTOImpl implements UserDTO
    {
      ... implement it based on kpow.
    }

    Example VO:

    
    public class UserVO
    {
        String firstName;
        String lastName;
        String middleInitial;
    
        ... getters and setters.
    }

    I prefer to identify the target of the delete using an ID instead of a VO object. Also, it is possible that an update will change the target identified by user ID “smackdown” to have user ID “smackup”, so I generally pass an id and a VO.

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

Sidebar

Related Questions

I am trying to write a CSS in which when the user writes text
I'm trying to write a C# program, where when a user enters some data
I'm trying to write a simple HTTP remember me authentication system for users. My
I'm trying to write a faster user switching app for Windows. Win+L and selecting
I'm trying to write a script that informs the user when someone has logged
I'm trying write a query to find records which don't have a matching record
I'm trying to write a blog post which includes a code segment inside a
I'm trying to write some PHP to upload a file to a folder on
So I'm trying to write a php SOAP client that requires the user to
I 'm trying to implement user authentication and authorization using roles table, user table

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.