Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Odejava] OO Issues Reloaded (4)  (Read 1138 times)
0 Members and 1 Guest are viewing this topic.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Posted 2004-04-12 00:24:45 »

Hi,

Thanks for your tollerance of the previous changes.

I have another suggestion.  This one will require every Odejava program to be changed - but all you have to change is the package imports.  The rest of the API will be unchanged.

Currently the currect way of creating a geom and adding it to a Space is:

Geom g = new GeomBox (...)
space.addGeom(g);

Which behind the scenes (in the Space method) calls g.addToSpace(this);

BUT - and the big but is that the g.addToSpace method is public.  It must be public because it's in a totally different package.  This means that you can still do some nonsense code (note:  a few changes I made a while back removed _most_ of this ambiguous code but not all).

Geom g = new GeomBox (...)
space1.addGeom(g);
g.removeFromSpace();
space2.addGeom(g);

In this case - both space1 and space2 think they have the Geom when infact only one does.

If these classes were in the same package then the addToSpace method would be protected.  Currently the only protection is in the javadoc comments (this is bad).

You may not think this is a big deal - but all those classes are strongly related to each other, and I believe more problems like this will surface.

In my opinion - Odejava the API should be mainly in the one Package to allow such data encapsulation that is needed.

Merging it is easy (and I've even already done this on my computer to test it).  Upgrading code isn't too hard either.

In conclusion - I am suggesting that all the related Odejava classes be merged.  In other words - all classes from:
org.odejava.geom  and
org.odejava.joint would be moved into
org.odejava.

If you want a comparison - the current setup would be a bit like having the Swing text boxes in a different package to the Swing labels.

Please give your feedback.

Cheers,

Will.

Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #1 - Posted 2004-04-12 01:07:47 »

Will,

As a new user to Odejava with little code to covert, I have no problem with this.

-Tab
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #2 - Posted 2004-04-15 12:13:15 »

thanks Smiley

Anyone else?  I've filed an Issue.  It's actually a very minor change - but I think it's needed.

Will.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jani Laakso

Junior Member




Do it with Java!


« Reply #3 - Posted 2004-04-19 16:48:22 »

Quote
thanks Smiley

Anyone else?  I've filed an Issue.  It's actually a very minor change - but I think it's needed.

Will.


You can move the suggested classes to package org.odejava.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #4 - Posted 2004-04-20 00:15:48 »

Quote


You can move the suggested classes to package org.odejava.


Thanks - I shall do this soon.

Will.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (53 views)
2014-04-15 18:08:23

BurntPizza (51 views)
2014-04-15 03:46:01

UprightPath (65 views)
2014-04-14 17:39:50

UprightPath (48 views)
2014-04-14 17:35:47

Porlus (65 views)
2014-04-14 15:48:38

tom_mai78101 (89 views)
2014-04-10 04:04:31

BurntPizza (149 views)
2014-04-08 23:06:04

tom_mai78101 (245 views)
2014-04-05 13:34:39

trollwarrior1 (203 views)
2014-04-04 12:06:45

CJLetsGame (210 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!