Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (498)
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  
  Data Oriented or Object Oriented?  (Read 683 times)
0 Members and 1 Guest are viewing this topic.
Offline wessles

JGO Ninja


Medals: 49
Projects: 4
Exp: 3 years


Coding with bad posture since 2011... Nonstop.


« Posted 2013-09-01 03:41:50 »

Which one?! I really want to use something different than Object oriented, but is it worth the learning curve?

You don't know nerdiness yet; you haven't even met me!
www.wessles.com
Offline opiop65

JGO Kernel


Medals: 123
Projects: 7
Exp: 3 years


Team Alluminum


« Reply #1 - Posted 2013-09-01 04:01:43 »

What do you mean by data orientated? You do know Java is an OO language primarily, and that's how it should be used.

Edit: Data orientated is more for non-unique objects. For instance, a map of the the same type of tile that all do the same thing.

Offline Troncoso

JGO Coder


Medals: 20



« Reply #2 - Posted 2013-09-01 04:17:22 »

Maybe you should look up what it is before you decide you want to do it...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline opiop65

JGO Kernel


Medals: 123
Projects: 7
Exp: 3 years


Team Alluminum


« Reply #3 - Posted 2013-09-01 04:34:08 »

I second this, data orientated design, from what I've gathered from a few Google searches, is a bad way to organize your objects unless the order doesn't really matter. That's really not a good way to code.

Offline wessles

JGO Ninja


Medals: 49
Projects: 4
Exp: 3 years


Coding with bad posture since 2011... Nonstop.


« Reply #4 - Posted 2013-09-01 07:54:22 »

So no Artemis Framework?

You don't know nerdiness yet; you haven't even met me!
www.wessles.com
Offline relminator
« Reply #5 - Posted 2013-09-01 08:35:59 »

Maybe you should look up what it is before you decide you want to do it...

This.
Offline Jeremy
« Reply #6 - Posted 2013-09-01 09:38:57 »

Data Orientated doesn't always directly conflict with Object Orientated code design. The difference is the two aim to solve different problems.

Data Orientated is organizing your data such that is very quickly and easily accessible without much indirection. If you were sorting on-screen particles, this is the way you'd do it.

Object Orientated is organizing them in an OO manner for code design and maintainability.

Really, you shouldn't be doing data orientated design unless you have to.

JevaEngine, Latest Playthrough (This demo is networked with a centralized server model)

http://www.youtube.com/watch?v=rWA8bajpVXg
Offline wessles

JGO Ninja


Medals: 49
Projects: 4
Exp: 3 years


Coding with bad posture since 2011... Nonstop.


« Reply #7 - Posted 2013-09-01 19:54:08 »

Thanks! I'll stick to OO.

Hm?

You don't know nerdiness yet; you haven't even met me!
www.wessles.com
Offline Troncoso

JGO Coder


Medals: 20



« Reply #8 - Posted 2013-09-01 20:35:15 »

Again, you should look it up before jumping to conclusions. Object-oriented programming is a programming paradigm. From wikipedia:

Quote
A programming paradigm is a fundamental style of computer programming. There are four main paradigms: imperative, functional, object-oriented, and logic programming.

So, basically, the language you choose revolves around this style of programming, and as such, your own code should as well.

Data-oriented design is a guideline for how you interact with and optimize your data and how you access it/store it. These are two feathers from two different birds.

If you are interested in Data-oriented programming, look no further than SQL. That language is nothing but organizing/accessing data. Then again, it's not really meant to be used on its own.
Offline wessles

JGO Ninja


Medals: 49
Projects: 4
Exp: 3 years


Coding with bad posture since 2011... Nonstop.


« Reply #9 - Posted 2013-09-01 21:37:51 »

Oh, programming, and design. Didn't catch that! Thanks!

You don't know nerdiness yet; you haven't even met me!
www.wessles.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Several Kilo-Bytes

Senior Member


Medals: 11



« Reply #10 - Posted 2013-09-02 07:26:05 »

Data oriented programming is designing code to operate on data in mass. (Either serial or parallel.) Object oriented programming is organizing your code so variables (classes/objects) describe data and operations defined for that data.

Data oriented is currently a loosely defined buzzword. You can tell that data oriented advocates do not know the meanings of the words they used because they claim the two concepts are mutually exclusive. Some people are Real Game Developers with a lot of experience in what they do, but don't have the breadth of knowledge to realize that experience with one platform, with one compiler, and with one programming language is not enough to make a universal rule. One pro data oriented programming documented states something to the effect of "write functions that work on many [objects], not just one [object]", apparently missing the memo that C++ code is very inline-able.

Let them have their personal mantra and let them call it data oriented programming if they want. They may certainly be an authority on some game programming subjects, but take what they say with a grain of salt. Know that someone may be giving you great tips and tricks for PS3 C++ code for a certain compiler, but no matter how grandiose it sounds it is not really a way of life or list of best practices. They did something right for their game and know why it's right, but teach the wrong lesson from it. Data oriented design is usually just a fancy way to say performance conscious design.

(The focus is on data because of the structure of modern hardware. Your success will vary with respect to your understanding of how modern hardware works.)

If you use shaders, you are already using data oriented programming. SQL may be thought of as data oriented programming if you use certain features and look at it a certain way. So can spread sheets actually... It's not a cure all. You can't just drop SQL into your project for example. It will bite you if you don't understand what is happening.

The only reason the ideas may be in conflict is in languages where there are no user defined types which are assigned to variables and passed to functions by value, like Java. It is still possible to do data oriented design in Java and can be done very well. Replacing an ArrayList of Objects with a single array of raw data for example makes a huge difference and eliminates the GC problems of storing data behind thousands of references that must be reclaimed. The downside is you don't extend Object and it's harder to move variables around, but that does not mean it excludes using object oriented designs. However if you cannot read and write assembly code I do not recommend trying to write data optimized high level source code.


Finally, besides the common definition of data oriented design there are also people that refer to dynamic languages like Javascript as data oriented. (Because functions are dynamically interchangeable. Which apparently qualifies them as data from the high level programmer's perspective.) It's a completely different form of object oriented design but with most of the useful features stripped away for programmer "convenience." If that's what you were directed to, go ahead. The learning curve to Javascript is very shallow. It's not very practical though for data intensive programs and none of the skills will transfer to strict programming languages, though.
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 (27 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (193 views)
2014-04-01 02:16:10
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

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!