5
votes
3answers
305 views

Is it wrong to write an entire program under one class/method in Java?

I'm new to programming an created a simple rock, paper, scissors game. The entire program is under a single class and the main method, i hear that's probably not the best way to code. How should i ...
2
votes
1answer
112 views

Collision detection implementation

I'm working on a clone of Hunter Story. You shoot monsters with your bow. Recently I implemented collision detection, this is all working correctly, and I don't think the code needs any dramatic ...
0
votes
1answer
68 views

Q&A system model design [closed]

Now I am trying to build a Q&A website by myself.The models below is my model design.I have some questions about this. 1、class Category: public class Category { private String name; } ...
2
votes
1answer
56 views

Merit of a “Search” class similar to a “Builder” class

I have a class something like the following: class ItemManager { List<Item> items; public ItemManager() { items = Database.retrieveItems(); } } An item has several ...
1
vote
2answers
98 views

Oriented-object approach on how to control different classes cleanly

I'm currently creating a client/server application (using Java) and I want to make it fully controllable by an input stream (currently the console). At the moment only one class have to be controlled, ...
-1
votes
1answer
99 views

design classes for a JAVA swing application [closed]

I am very new in making JAVA swing applications.. My problem statement is to make a library management application,for which i designed classes as below. Please tell me whether my design of classes ...
3
votes
3answers
166 views

Beginner to OOP: Do these classes properly represent the objects in Java?

These classes are part of a program I am working on to convert Arabic numerals to Roman numerals and also the reverse. Do these classes look correct for representing objects in Java? public class ...
1
vote
0answers
61 views

Circular Dependencies between Immutable Objects; the Freeze Pattern

Generally, I structure small threadsafe immutable objects like this: public class SmallObject { private final String state; public SmallObject(final String state) { this.state = ...
2
votes
1answer
125 views

Have I implemented the command pattern correctly?

This is my command interface public interface IConverter { void convert(); } This is my Receiver class public class Ogg extends Audio{ private File src; private File trgt; ...
4
votes
2answers
260 views

How is my BlackJack game design?

This is command line BlackJack game created in Java as my final project for advanced programming class... What do you think about it? Have I used OOP correctly? What grade should I get for this? :D ...
1
vote
1answer
104 views

Factory pattern for getting xml data

i am trying to implement factory pattern for getting XML Document from server (using javax.xml.parsers.DocumentBuilder) I have the classes below for now, could you give your opinion ? Does the ...
4
votes
1answer
89 views

Attempt at an implementation of a TextFile class

How can I improve this class that should represent a text file? Im trying to write a simple class to represent a text file - which one would think should be quite easy.. I don't intend to add all ...
6
votes
1answer
225 views

Criticism on OO design (Java)

The domain model of my application revolves around movies. The use case is following: we have a movie for which only one title (in one country) is known and we want to know titles of this movie in ...
2
votes
2answers
135 views

Subclassing or not?

I have a class called Foo public class Foo { private String optionalProperty; private String name; private long uniqueId; // getters/setters for above properties } For some ...
5
votes
3answers
292 views

How can I improve my Java code? Does it follow the java naming conventions? Is it object oriented?

I have written some code in Java that consists of two classes. Now programming is all about writing quality code that others can understand. I have tried my best and I want you guys to tell me if i ...

1 2 3
15 30 50 per page