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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:55:02+00:00 2026-06-03T22:55:02+00:00

I’m writing an application which aims to centralize all data related to project management

  • 0

I’m writing an application which aims to centralize all data related to project management produced in a mysql database. The application can be divided in 3 parts/projects as it follows:

  • Server Layer :

Act as a layer between several clients and keeps connected to the database (mysql). It listens to the protocol class and then perform operations like INSERT, UPDATE, DELETE, SELECT and such. It’s written in plain java 2SE instead of 2EE since it’s a very simple class and can be independent from a server.

  • Communication Protocol:

A class which extends java.util.EventObject and implements the Serializable interface. It works to store the information related to a common protocol between client and server. This is the class which actually “travels” through the socket since it works kind like a protocol.

  • Client Application:

Basicaly the gui. It’s written in javafx 2.1 and aims to provide a nice and beauty interface to collect information.

My question is, to improve readability through code I’ve created some static final fields on the Communication Protocol class and declared then as int and I would like to know if using byte can improve the code since (again) it will travel through a socket. I understand that the JVM will separate equivalent space to a word to bytes, shorts and ints variables but does this behavior occurs when sending data through a socket? So, in this context, which one is better:

/**
 * 
 */
private static final long serialVersionUID = 7530533341506425480L;


public static final int CLIENT_DISCONNECTED = -1;
public static final int NEW_INFO_INSERTED = 0;
public static final int SHUTDOWN_ORDER = 1;

public static final int INFO_NOT_INSERTED = 100;

public static final int CLIENT_CONNECT = 10000;
public static final int CLIENT_LOGIN = 10001;

public static final int SERVER_LOGIN_OK = 20001;
public static final int SERVER_LOGIN_FAILED = 20002;
public static final int SERVER_SAYS = 20003;
public static final int SERVER_IMAGE_INSERTED = 20004;

public final static int DB_WORKERS = 1001;
public final static int DB_PROJECTS = 1002;
public final static int DB_SECTORS = 1003;
public final static int DB_ACTIVITIES = 1004;
public final static int DB_SUBACTIVITIES = 1005;
public final static int DB_INSERTION = 1006;
public final static int DB_REL_COST = 1007;
public final static int DB_FUNCTIONS = 1008;
public final static int DB_INSERTION_ID = 1009;
public final static int DB_INSERTION_IMG = 1010;

public final static int DB_WORKER_INSERTED = 4010;
public final static int DB_ACTIVITY_INSERTED = 4011;
public final static int DB_SECTOR_INSERTED = 4012;
public final static int DB_SUBACTIVITY_INSERTED = 4013;
public final static int DB_FUNCTION_INSERTED = 4014;
public final static int DB_IMAGE_INSERTED = 4015;
public final static int DB_PARENTS_INSERTED = 4016;

or using bytes? Cheers

  • 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-03T22:55:04+00:00Added an answer on June 3, 2026 at 10:55 pm

    As ColeJohnson says, bytes are smaller than ints, so technically faster to send. however, unless you are sending 100 thousands or millions of these values at a time, the size difference will not matter.

    • 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 have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I want to construct a data frame in an Rcpp function, but when I

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.