• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
obizues

Abstract Data Type in Java

9 posts in this topic

I was given a quiz on what an ADT was:

I wrote that it was a group of similar data types in a class together that performed a series of Mutations and accessing methods. it also makes the data processes hidden from a programmer that may just use the accessor and mutator methods to achieve what is needed with the driver.

I was given a D- and told I was way off.

Can someone help me figure out where I went wrong? Everything I look up seems similar to tha and some sites even just claim its a class with private variables.

Any help would be appreciated.
0

Share this post


Link to post
Share on other sites
[quote name='obizues' timestamp='1347423987' post='4979168']
I was given a D- and told I was way off.
[/quote]
[url="http://en.wikipedia.org/wiki/Abstract_data_type"]He is right [/url][img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
2

Share this post


Link to post
Share on other sites
I read the article posted above, and I wouldn't have given you a D-. I think this is more a case of trying to figure out what the teacher wants than trying to argue why you're "right." Those kinds of things always made me very angry, and when I was in college, I would have dropped the class. I really don't think it is the right thing to do, but I have never been very go at doing the right when thing when dealing with people.

I don't see anything wrong with your answer, except that, because of the D-, it wasn't the same as the guys definition.

"May the semicolons be ever in you favor." Edited by Glass_Knife
0

Share this post


Link to post
Share on other sites
Do you mean, talking a List interface, and all the operations that can be perfomed on a list, make a List an abstract data type.
You can add things, remove things, count things, iterate, sort, print, ect.

At what point does an abstract data type become concrete? All the data is hidden, and there can be concrete classes without any data held inside them. From a theoretical point of view, is any class that can be instantiated a concrete type, or is there more to it?

Just asking for my own knowledge. I never really thought about defining an abstract class, and I can see from my first post that I don't
really understand.

I am always amazed at how much I still don't know about computer science. Edited by Glass_Knife
0

Share this post


Link to post
Share on other sites
In practical terms, outside of the classroom, people don't use the terms abstract data type and concrete data type very often. We just talk about data types and let how specific we are about implementations provide the context about which kind we're talking about. For example, describing A* there's an open list and a closed list. These are abstract data types, because when describing A* all that matters is what operations can be done on the open list and closed list. However, when implementing A* then you might want to use a priority queue based on an array for your open list so you can easily grab the minimum cost node.

At least part of the reason that we don't use these terms very often is that, outside the classroom, the line between abstract and concrete data type isn't particularly firm. For example, the definition of a std::vector in the C++ standard omits implementation details, but it's so specific that there are really very few ways that you can implement it. In particular there are big O guarantees for standard library types that go a long way in restricting implementation details.

However, if you are in a classroom, then abstract data types just define operations and concrete data types have implementations.
1

Share this post


Link to post
Share on other sites
[quote name='SiCrane' timestamp='1347546480' post='4979718']In practical terms, outside of the classroom, people don't use the terms abstract data type and concrete data type very often.[/quote]I've seen ADT used a bit by C-educated colleagues. Where a C++-based programmer might say "abstract base class", or a Java programmer might say "interface", these guys would say "abstract data type", but we'd all mean the same thing.
e.g. the abstract part[code]//Java guy says:
public interface Interface
{
int DoStuff();
}
public class InterfaceFactory
{
public static Interface Create();
}
//C++ guy says:
class ABC
{
public:
static ABC* New();
virtual ~ABC() = 0;
virtual int DoStuff() = 0;
};
//C guy says
typedef struct {} ADT;
ADT* ADT_Create();
void ADT_Destroy(ADT*);
int ADT_DoStuff(ADT*);[/code]And the (hidden) concrete backing:[code]//Java guy says:
public class Concrete implements Interface
{
public int DoStuff() { return 42 };
}
public class InterfaceFactory
{
public static Interface Create() { return new Concrete; }
}
//C++ guy says:
class Concrete : public ABC
{
public:
int DoStuff() { return 42; }
};
static ABC* ABC::New() { return new Concrete; }
//C guy says
typedef struct {} Concrete;
ADT* ADT_Create() { return (ADT*)malloc(sizeof(Concrete)); }
void ADT_Destroy(ADT* o) { free(o); }
int ADT_DoStuff(ADT* o) { return 42; }[/code] Edited by Hodgman
1

Share this post


Link to post
Share on other sites
[quote name='obizues' timestamp='1347588406' post='4979916']
I'm a little confused as to what I should have written still.
[/quote]
Someone correct me if I'm wrong, but I think this would've been better:
[quote name='obizues' timestamp='1347423987' post='4979168']
[...] it[s] was a group of similar data types in[/s] [b]is [/b]a class [b](or data type)[/b] [s]together[/s] that [s]performed[/s] [b]declares [/b]a series of [b]possible operations that my be performed on it, often with declared but undefined member [/b][s]Mutations and accessing[/s] methods. it [s]also[/s] makes the data [s]processes[/s] [b]and representation of the actual object [/b]hidden from a programmer [b]and gives a common interface that may be used to abstractly interact with an underlying, possibly unknown concrete type[/b] [s]that may just use the accessor and mutator methods to achieve what is needed with the driver[/s]. [b]For example, an abstract List type can declare a common interface for accessing and storing items sequentially. It does not require the underlying storage to use a contiguous array or a linked list; it makes no mention of class member objects (how the data is stored is abstracted away). Instead it provides a common, abstract interface that one may use to implement or interact with a concrete type (like an ArrayList or LinkedList). The concrete data type may then be abstractly treated as a generic List that fulfills the abstract List's contract (that is, you can sequentially store and access items, and you don't care if you have an ArrayList or a LinkedList; all you care about is the fact that you have a List).[/b]
[/quote]
Or something like that... Edited by Cornstalks
1

Share this post


Link to post
Share on other sites
I always define an ADT to other students like this:
An abstract data type specifies a component's interface via signatures (e.g. "new: --> Stack, push: Stack x T --> Stack, size: Stack --> Integer") and it's visible behavior via axioms (e.g. "size(new()) = 0, size(push(A, x)) = size(A) + 1") but makes no statements at all about it's implementation. Edited by lwm
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0