Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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 3885 times)
0 Members and 1 Guest are viewing this topic.
Offline wessles
« Posted 2013-09-01 01:41:50 »

Which one?! I really want to use something different than Object oriented, but is it worth the learning curve?
Offline Opiop
« Reply #1 - Posted 2013-09-01 02: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 02: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 Opiop
« Reply #3 - Posted 2013-09-01 02: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 relminator
« Reply #4 - Posted 2013-09-01 06:35:59 »

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

Offline Jeremy
« Reply #5 - Posted 2013-09-01 07: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)
Offline Troncoso

JGO Coder

Medals: 20

« Reply #6 - Posted 2013-09-01 18:35:15 »

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

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 Several Kilo-Bytes

Senior Devvie

Medals: 11

« Reply #7 - Posted 2013-09-02 05: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  

ivj94 (586 views)
2018-03-24 14:47:39

ivj94 (49 views)
2018-03-24 14:46:31

ivj94 (383 views)
2018-03-24 14:43:53

Solater (63 views)
2018-03-17 05:04:08

nelsongames (110 views)
2018-03-05 17:56:34

Gornova (159 views)
2018-03-02 22:15:33

buddyBro (704 views)
2018-02-28 16:59:18

buddyBro (93 views)
2018-02-28 16:45:17

xxMrPHDxx (494 views)
2017-12-31 17:17:51

xxMrPHDxx (734 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!