?
Solved

java collection resources

Posted on 2013-12-09
7
Medium Priority
?
846 Views
Last Modified: 2013-12-12
Hi,

i am not very sound with java collection concepts how to store, retrieve complex business objects used in various client projects. How do I improve in that area.

please advise
Any links,sample code, resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 36

Expert Comment

by:mccarl
ID: 39707455
java collection concepts how to store, retrieve complex business objects
Are you talking about "collection concepts" in terms of Java's List, Map, Set, etc? If so, then fortunately it doesn't actually matter much whether you are talking about simple objects or complex business objects, the way you use these interfaces and their implementation classes are essentially the same. So learning about the uses of these with simple objects, such as String, Integer, etc. is the first step and then you should be able to easily apply this to your complex business objects.

It is hard for us to know what level you are currently at so I can say how appropriate this is but as a first step, I would check out the Java Tutorials on Collections (http://docs.oracle.com/javase/tutorial/collections/)

If you can explain in a bit more detail about what you are having trouble with, we can certainly provide more appropriate help to you!
0
 
LVL 7

Author Comment

by:gudii9
ID: 39709579
Sure. Will check that.

I am curious to know master collection concepts as a whole. I would say I am at intermediate level.

 I want some site which i can refer for 5-10 min and should be able to refresh all the concepts of collection at a glance.

I checked this link but not much of java resources here.
http://www.javacodegeeks.com/2013/01/15-online-learning-websites-that-you-should-check-out.html

Please advise
0
 
LVL 36

Expert Comment

by:mccarl
ID: 39710250
I want some site which i can refer for 5-10 min and should be able to refresh all the concepts of collection at a glance.
I'm pretty sure that the link I gave will give you that (or pretty close). Did you look at the "Interfaces" page in particular? I don't think you will get any more "at a glance" than that!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Author Comment

by:gudii9
ID: 39712264
I am going through it. I read as below

Deque — a collection used to hold multiple elements prior to processing. Besides basic Collection operations, a Deque provides additional insertion, extraction, and inspection operations.

Deques can be used both as FIFO (first-in, first-out) and LIFO (last-in, first-out). In a deque all new elements can be inserted, retrieved and removed at both ends. Also see The Deque Interface section

What is this Deque. i am reading and hearing for the first time.
Sorted sets are used for naturally ordered sets, such as word lists and membership rolls

Sorted maps are used for naturally ordered collections of key/value pairs, such as dictionaries and telephone directories.

what is the meaning of the naturally ordered.

 Please advise
0
 
LVL 36

Expert Comment

by:mccarl
ID: 39713837
What is this Deque
What you quoted above does a pretty good job of explaining. But basically it is a "double ended queue", and by this is means that the queueing operations (adding items to the queue and removing items from the queue) can be made to operate on "either" end of the queue. This allows for a couple of different use cases...

A "stack" of items can be created. Think about a "stack" of papers on a desk, where you put new papers on the top of the stack and when you need to do something with one of them, you take the top one, ie. you are always operating on the top of the stack, you never add or take from the bottom of the pile.

A "queue" of items can be created. Like at a bank, you join the end of the queue and you wait as you move forward in the queue until eventually you are at the head of the queue and that is where the bank teller takes the next customer from. So you are adding items to the end (or tail) of the queue and taking the next one from the head of the queue.

A Deque basically allows you to do either (and even both at the same time if need be) by calling different methods. If you look through the Javadoc you will see all the different methods for operating on either end of the Deque.


what is the meaning of the naturally ordered.
Naturally ordered is just the default ordering for a particular object. For instance, the natural order for a sorted collection of Strings is "alphabetical" order, and for a sorted collection of Integers is "numerical" order. Some classes don't have a "natural order" at all. As an example, consider a Point2D class that represents a point in 2 dimensional space, as x and y coordinates. There is no natural order to these objects, you can't just say order them by their x coordinate, because ordering them by their y coordinate is just as valid or even ordering them by their distance to the origin. They are all valid orderings by neither is considering "natural" or the default one.

The quotes that you pulled out about the sorted collections are not totally correct. Because SortedSets and SortedMaps can be used for both naturally ordered collection as well as "arbitrarily" ordered collections by providing a Comparator instance that explicitly defines the desired ordering. You probably don't have to worry too much about this though, but I am just highlighting the point.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39714821
is Deque is new addition with javaSE6 or 7.

I got what is stacka and queue.

What is meaning of double ended queue and how to relate with Bank example

A Deque basically allows you to do either

What you mean by either. please advise
0
 
LVL 36

Accepted Solution

by:
mccarl earned 2000 total points
ID: 39715477
is Deque is new addition with javaSE6 or 7.
If you check out the Javadoc...

http://docs.oracle.com/javase/7/docs/api/java/util/Deque.html

...just above the "Method Summary" it states "Since 1.6", so yes, it's new is Java 6


What is meaning of double ended queue and how to relate with Bank example
Pretty well covered above I thought, but anyway... by "double ended queue" it just meaning that the adding/removing operations can happen at BOTH the head of the queue AND at the tail of the queue. In terms of the bank example, as I said you normally add items/people to the tail end of the queue, and the bank teller gets the next item/person from the head of the queue. With double ended queues, because we can do both adding and removing of items/people at both the tail and head of queue, we can do the normal case of the bank queue above, but we could also say, if we get a VIP customer, we could add them to the head of the queue rather than the tail, so that they get served faster. Just as an example.


What you mean by either. please advise
By "either", I meant either of the two use cases that I had just been describing, ie. A Deque allows you to implement either a "stack" or a "queue" just by using the different methods that it provides.
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question