are java extensions fully oop?

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

are java extensions fully oop?

Postby mhdside » 03 Nov 2008, 12:27

are java extensions fully oop?, can I split my extension into classes and pakages?, how would the architecture look like... should I prepare the classes and use them in the extension? any example? did I miss some post about this?, also I think the docs should include advanced java extension game that can help better understanding java extensions.

thanks,
Mahmoud Badri
Senior actionscript developer
http://www.el3ab.com
User avatar
thomers1
Posts: 125
Joined: 13 Aug 2008, 07:36
Contact:

Postby thomers1 » 03 Nov 2008, 15:40

hi mhdside,

your javaextensions are as much as OOP as you design them to be. :-)

yes, you can split them into several packages, if you see the need to.

for example, i have an abstract base class MyExt extending AbstractExtension, defining some common initialization code etc.

All my extensions then extend MyExt.

cheers,
thomers
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

Postby mhdside » 03 Nov 2008, 15:49

mmm, interesting. Thanks thomers1, I have no java experience yet but I want to start writing my extensions in java.

One more question, is it better to have the game extension at the zone level or room level?

The idea is if I want to keep the game state at the server, I have to attach the extension at the room level but this way I`ll consume more resources. While if I attach the extension at the zone level, I'll save resources but I`ll have to save the game state at the clientside.

Which apprach is more common, better?
Mahmoud Badri

Senior actionscript developer

http://www.el3ab.com
User avatar
thomers1
Posts: 125
Joined: 13 Aug 2008, 07:36
Contact:

Postby thomers1 » 04 Nov 2008, 07:34

The idea is if I want to keep the game state at the server, I have to attach the extension at the room level but this way I`ll consume more resources. While if I attach the extension at the zone level, I'll save resources but I`ll have to save the game state at the clientside.


i'm not an expert, but i would avoid storing the game state on the client side.

if its simple enough, you could store the game state in room variables, that are broadcasted to the clients on change.

cu
t
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

Postby mhdside » 04 Nov 2008, 08:25

so that means it is more appropriate to attach the extension at room level for turn-based games for example?
Mahmoud Badri

Senior actionscript developer

http://www.el3ab.com
Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

Postby Menser » 06 Nov 2008, 05:43

Hello-

Quick question. Why do you think you will need to keep the game state on the client side if your logic is handled at the zone level?

_-Menser-_
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

Postby mhdside » 06 Nov 2008, 06:25

I think to put the game state at the server. I need 1 extension per game so each extension variables will save the state of the game they are attached to.

If the extension is at the zone level, how am I going to save state for all the games in this 1 extension? It doesn't make sense to, does it?

correct me if I'm wrong.
Mahmoud Badri

Senior actionscript developer

http://www.el3ab.com
Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

Postby Menser » 06 Nov 2008, 09:49

Hello-

Im assuming if i understand your previous posts that each room is its own game.

If that is the case, instead of having the properties of the game be properties of the extension you would have them be stored in the rooms properties. This way when the extension needs to access the properties for that particular game you simply access the room in question to get the information.

Another option would be to have a custom class that stores the games properties, then create an array/hash table of your custom class in the extension so as to be able to reference them as needed.

Hope that helps
_-Menser-_
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

Postby mhdside » 06 Nov 2008, 10:02

Personally, I want to minimize the use of room variables as possible. I don't feel comfortable working with them, I think sending extension messages is more flexible.

Yet your second suggestion seems interesting. Actually working with only 1 extension at the zone level would make things more easy, for example it will be easy for a lobby user to send xt msg to the game extension to update his view of this running game...etc, I`ll go for it and see how things go. Thanks a lot for your help.

But as you can see there is lotta possibilities, there should be a best practise or templates for differnet kinds of applications in the docs.

although using zone ext. saves resources and would be more flexible especially after your second suggestion. Why are all the examples in the docs use room level ext. for game apps!!
Mahmoud Badri

Senior actionscript developer

http://www.el3ab.com

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 31 guests