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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:45:06+00:00 2026-06-16T14:45:06+00:00

I am building a site based completely off REST services with a Java backend.

  • 0

I am building a site based completely off REST services with a Java backend. I have moderate experience in both Java and PHP, but very little with JavaScript (outside some basic Jquery stuff). My question is do all JavaScript objects have to be defined in a single file, or can they be created in their own class files (like in Java or PHP)? Basically, I want to define a bunch of objects (such as user, product, cart, etc) and then instantiate those objects through REST services on my server, but I am not sure if I have to define all of the objects and the implementation of those objects in one giant file or if I can split them up into several files (like I am used to working with in other OOP languages).

I know you define an object like:

function Car(model, year)
{
    this.model = model;
    this.year = year;
}
  • 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-16T14:45:07+00:00Added an answer on June 16, 2026 at 2:45 pm

    You can split classes to separated files and include them when needed. But the order you include your javascript files is very important. For a large scale system you need a framework to manage them. I recommend using Requirejs

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

Sidebar

Related Questions

I'm part of a team building an ADO.NET based web-site. We sometimes have several
I have a test site where I am building a d3-based force-directed network graph
I'm building my first site based on backbone.js and I have a bit of
I'm building a community-based site in Rails for the members of a real-world organization.
I am working on a user based social network. I am building the site
building a site using PHP and MySQL that needs to store a lot of
I'm building a site to display my comics- but I've read some tutorials (
I am building a site that will (obvisouly) have a front end public portion
I'm building a site that runs fine for a few hours, but then *.asmx
I'm starting off building a site which should be responsive to different screen sizes.

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.