Collections of Vector and Hashtable obsolete?
Vector and Hashtable are supposed to be the collection synchronized as part of th e java collection objects. I have a few questions about those two.In the early days of my development career, I learned that 'Vectors' & 'hashing' SHOULD be used when programming of applications that those that can be accessed simultaneously by multiple users. We use EJB components and we always use vectors and hash tables when returning collections of objects of EJB methods, inside business methods and inside servlets. Most of my elders advised me not to use all the other collections, leaving a chance to provoke conflict and interference of information. I hesitated to accept this, but I just did what they asked, because I didn't want to take this responsibility.
But now I see that Vector and Hashtable are supposed to be obsolete collections and should probably not be used in new development. So now, I have a question about these.
1. why they were ranked as the ancients?
2. What are the alternatives we have to use instead?
3. should I risk by using other collection objects in an application simultaneously accessible? (information jam, unexpected manipulations on information, etc.).
Thank you!
+ [To the admins of the forum (to remove one of them if necessary) (: I posted the same section of simultaneity as well)] +.
Knightbeat wrote:
Vector and Hashtable are supposed to be the collection synchronized as part of th e java collection objects. I have a few questions about those two.In the early days of my development career, I learned that "vectors" & "hash tables" SHOULD be used when programming applications that those that can be accessed simultaneously by multiple users.
It is false and has always been.
Most of my elders advised me not to use all the other collections, leaving a chance to provoke conflict and interference of information.
WTF is 'interference information '? And what specific conflicts they claim will lead to and how?
The Collections Framework is out with Java 1.2 in 1998. Its classes are unsynchronized by default, but there are methods to provide a synchronized version of each of them. Your elders don't know what they are talking about.
But now I see that vector and Hashtable are supposed to be obsolete collections and probably should not be used in the development of new.
Functionally they still work very well. The reason for preferring the ArrayList and HashMap is that these classes were created as part of Collections from the beginning. Vector and Hashtable was modernized in it. Most people use the most recent classes, and I would personally never use the old categories, unless I had to for reasons of backward compatibility. They still work perfectly well.
Tags: Java
Similar Questions
-
Vector and Hashtable are supposed to be the collection synchronized as part of th e java collection objects. I have a few questions about those two.
In the early days of my development career, I learned that 'Vectors' & 'hashing' SHOULD be used when programming of applications that those that can be accessed simultaneously by multiple users. We use EJB components and we always use vectors and hash tables when return collections of objects of the methods of EJB, inside business methods and inside servlets. Most of my elders advised me not to use all the other collections, leaving a chance to provoke conflict and interference of information. I hesitated to accept this, but I just did what they asked, because I didn't want to take this responsibility.
But now I see that Vector and Hashtable are supposed to be obsolete collections and should probably not be used in new development. So now, I have a question about these.
1. why they were ranked as the ancients?
2. What are the alternatives we have to use instead?
3. should I risk by using other collection objects in an application simultaneously accessible? (information jam, unexpected manipulations on information, etc.).
Thank you!Knightbeat wrote:
In the early days of my development career, I learned that "vectors" & "hash tables" SHOULD be used when programming applications that those that can be accessed simultaneously by multiple users.IMHO Vector and Hashtable were replaced in Java 1.2 in 1998 and are inherited classes.
We use EJB components and we always use vectors and hash tables when return collections of objects of the methods of EJB, inside business methods and inside servlets. Most of my elders advised me not to use all the other collections, leaving a chance to provoke conflict and interference of information. I hesitated to accept this, but I just did what they asked, because I didn't want to take this responsibility.
A good decision I would say pragmatic. Personally, I wouldn't return a collection (rather to return data from the collection, the caller must) or send a copy of the collection that does not need to be synchronized.
But now I see that vector and Hashtable are supposed to be obsolete collections and probably should not be used in the development of new. So now, I have a question about these.
I agree with you.
1. why they were ranked as the ancients?
Because interfaces in Java 1.2 such as map and list have been added and the Vector and Hashtable often served when they do not need to be synchronized or when not used with sufficient attention. i.e. the later design requires you to put a reflection more in how you use the collections.
2. What are the alternatives we have to use instead?
In Java 1.2 Collections.synchronizedList/Map/Set etc. have been added, but most recently in Java 5 (2004) the collections of the library of concurrency have been added (if the class is older than that) for example, ConcurrentHashMap, CopyOnWriteArrayList.
If you want to be updated, I would look at the simultaneous collection as well. http://download.Oracle.com/javase/6/docs/API/Java/util/concurrent/package-summary.html
3. should I risk by using other collection objects in an application simultaneously accessible? (information jam, unexpected manipulations on information, etc.).
I would not spend collections between classes. Instead, I would incorporate them, so a collection is used only in a single class and all the possible interactions between threads can be notice by reading this class. Passing a collection between classes you're openning yourself to unexpected interactions. (Unless you can easily read/understand all the code where the collection could be used)
Thank you!
No problem.
-
Mr President.
Can we make several Off features in a collection of panels and how the query-off based on the example?
Concerning
Once again, no jdev version?
It must be really hard to remember ehich version you are working.
Would have given a quick glance in the docs
featuresOff java.util.Set Yes a list separated by spaces of the features by default to disable to the panelCollection. Values supported are That is the answer to a message.
The second answer is that qbe is filtering tables. If you fund the table without filter you have not the qbe.
Timo
-
Smart Collections using 'Source' and 'Collection '.
I'm a little confused about this subject. I want to create a smart collection within a set of sets in the collection.
Example:
The TRIPS agreement is a set of collection
Under the TRIPS Agreement, you have RV
Under the RV, you have "ButterField Ranch may 2016.
Under "ButterField Ranch 2016 may" you "All".
Then under "ButterField Ranch 2016 may" want to create a smart collection that includes only the "color of the label" green collection "All".
The question is, how - you reference the 'all' within all the other collections without getting all other collections 'All' somewhere else.
What the question is: How do bosses really work for 'Source'-> 'Collection '.
The question is, how - you reference the 'all' within all the other collections without getting all other collections 'All' somewhere else.
You can not. Smart collection criteria allow you to match the names of the folders, collections, published reports and publish the service (for example, "Flickr"). There's no way to match the name of a collection defined in smart collections (or filters, incidentally). Others have asked for this feature - please add your vote and detailed opinion, why you want this feature request service in the official Adobe feedback forum: Lightroom: Smart collections lack of criterion for "Collection Set | Community customer Photoshop family .
To match the names of the sets in the collection, you can use the plugin to any filter.
-
A3 landscape artboard. When the zoom is less than 100%. the appearance of the work (lines) in staircase, I can tell this resolution because something I have to zoom and it disappears. I understand the difference between vector and raster so... this kind of problem is like when you zoom too in an image and it becomes pixelated... but otherwise...! I have a macbook pro 2012 model, the retina. is my screen resolution. I thought that the apple screen product meet good standards of adobe creative products... Reviews
Check if the switch between the GPU and CPU makes a difference: Cmd E
Or turn in the preferences: GPU performance.
-
I purchased the CS4 master collection for windows and I change my computer on a Mac. How to upgrade my license?
There is no option to update your CS4 license except subscribe to specially of the first creative cloud plan cuts the year for owners of CS (Adobe: creative, marketing, and document management solutions).
Platform swaps are allowed only for the most recent released CS software (CS6). You can get a version license Mac to CS4 by Adobe since Adobe doesn't sell older versions, and the only version of CS for sale is CS6... CS4 is not eligible to get CS6 at an upgrade price.
You can buy CS6 via the following page: http://www.adobe.com/products/catalog/cs6._sl_id-contentfilter_sl_catalog_sl_software_sl_c reativesuite6.htm
-
What is the Differnce between HashMap and HashTable?
Hi all
What is the Differnce between HashMap and HashTable?
I'm confuse. !!
Thanks to advnce.This question is answered in the Javadoc here http://download.oracle.com/javase/6/docs/api/java/util/HashMap.html and here http://download.oracle.com/javase/6/docs/api/java/util/Hashtable.html. The thread to block.
Published by: EJP on 12/07/2010 13:27
-
Collect the fonts and images in Illustrator
Hello
In addition to using a plugin or software to collect the fonts and images, is it possible to carry out this action in Illustrator. Perhaps, even showing the path or the location of the fonts/images is easily accessible.
Sutagami
Given that I cannot even keep that part on the external link images vs straight embedded images, the chances of a mode of work to collect assets are thin... I agree, however, that these days, just send a PDF file is the surest and most send the files, so why not try it?
Mylenium
-
Need help with debugging collection in bulk and loop forall
Hi people,
I was wondering if someone can look at my PL/SQL code and tell me where I'm wrong.
Environment
=========
10g (Rel 2)
Algorithm of
=======
A slider lets collect records
The data block
Bulk insert the data into a table
Implementation
==========
Set serveroutput on;
declare
cursor source_cur is
Select * from
from t1;
-Define the variables and collection types to be used by the BULK COLLECT clause
source_data_type type is the table of the source_cur % rowtype;
source_data_table source_data_type;
Start
Open source_cur;
loop
extraction source_cur
bulk collect into source_data_table;
When the output source_data_table.count = 0;
-Now, we print the data collected
-for i in source_data_table.first... source_data_table. Last
-loop
-dbms_output.put_line (' company name: ' | source_data_table (i).) Company);
-dbms_output.put_line ('Count: ' | source_data_table.) (COUNT);
-end loop;
end loop;
close source_cur;
Note: The statements above Print print the correct data and County
-Now, bulk insert us the data into the target table
dbms_output.put_line ('Count: ' | source_data_table.) (COUNT);
Note: The print statement above indicates a number 0 =. Since there is no available record, FORALL loop below will not insert anything in the table
ForAll idx in source_data_table. FIRST... source_data_table. LAST
Insert into T2
source_data_table (idx) values;
end;
/
Thanks in advance
rogers42You'll want to do something like this
open source_cur; loop fetch source_cur bulk collect into source_data_table; exit when source_data_table.count = 0; forall idx in source_data_table.FIRST .. source_data_table.LAST insert into T2 values source_data_table(idx); end loop; close source_cur;
or even better:
insert into target select col, col, col from source
no need to COLLECT in BULK and FORALL
;) -
ORA-32004 reason: outdated and/or obsolete or the parameters specified?
Hello
ORA-32004: outdated and/or obsolete parameters specified
Whenever I changed my noarchive log mode test database archive log mode, after I changed, I start database occurred the above error.
steps I do.
SQL > archive logs list;
Database log mode no Archive Mode
Disable to AutoArchive
Destination of archive: c:\oracle\ora90\rdbms
More old sequence of journal online 0
Next log sequence 0
Current log sequence 0
Change your mode of no. Archive database in Archive mode
Your database needs in editing process
SQL > shutdown immediate
SQL > startup mount
SQL > archive logs list;
Database log mode no Archive Mode
Disable to AutoArchive
Destination of archive: c:\oracle\ora90\rdbms
More old sequence of journal online 0
Next log sequence 0
Current log sequence 0
SQL > alter archivelog database;
Database altered.
SQL > archive logs list;
Database log mode Archive Mode
Disable to AutoArchive
Destination of archive: c:\oracle\ora90\rdbms
More old sequence of journal online 0
Next log sequence 0
Current log sequence 0
SQL > alter database open;
SQL > list of archive logs
Database log mode Archive Mode
Disable to AutoArchive
Destination of archive: c:\oracle\ora90\rdbms
More old sequence of journal online 0
Next log sequence 0
Current log sequence 0
Archives - Disable automatic (the database archive mode but automatic
disable of archiving
Then data not archive.you must activate AutoArchive)
SQL > archive log start; (session level activated no instance level)
SQL > archive logs list;
Database log mode Archive Mode
Enable to AutoArchive
Destination of archive: c:\oracle\ora90\rdbms
More old sequence of journal online 0
Next log sequence 0
Current log sequence 0
If you want the game level will change in instance parameter file
SQL > show parameter log_archive_start
Value of Type name
log_archive_start boolean FALSE
SQL > alter system set log_archive_start = true scope = spfile
Modified system.
SQL > shutdown immediate
SQL > startup
ORA-32004: outdated and/or obsolete parameters specified
Open database.
SQL >
But I solved the problem
I want to know the reason why the above error occurred
database version: 10g
OS: xp (my laptop) not office database
Concerning
S.Azar
S/N>
SQL > alter system set log_archive_start = true scope = spfileModified system.
SQL > shutdown immediate
SQL > startup
ORA-32004: outdated and/or obsolete parameters specified
>Specifically, this setting LOG_ARCHIVE_START is obsolete in 10 g. You must also enable archiving with
archive log start
Just switch to an archive also brings the archiver since 10g processes :-)
Kind regards
Uwehttp://uhesse.WordPress.com
-
cross-checking of backup and delete obsolete;
Hello
10 g R2 on a Win 2003 server. Connected to the catalog and target database, that I run:
RMAN > backup duplication
RMAN > remove obsolete;
FILE 1
FILE 2
....
.....
.....
You want to delete the above file? O/N: YES
And then:
RMAN > backup duplication
RMAN > remove obsolete;
FILE 1
FILE 2
....
.....
.....
You want to delete the above file? Y/N
I don't understand. If the first time that I answered YES and the obsolete table then deleted why they appear again and again?
Can we all be kind to explain to me?
Thank you."crossover" has nothing to do with obsolete backups, this command verifies backups, which are always saved in the controlfile/recovery catalog, but do not exist physically on the disk/tape. The order correct after 'overlap' is 'remove expired', 'deprecated' are backups is more necessary because of the defined retention policy.
I guess that your backups are both obsolete and outdated, but "remove obsolete" does not work, because these backups were abducted outside RMAN. It could also be a permission problem, RMAN is not allowed to delete the backups at the OS level. This happens on Windows, when using shared disks.Werner
-
Vectors and vectors and storage
Hi, I'm new to the idea of a persistent storage. But I managed to just simply record a channel... that's all
I will try to implement vectors with persistent storage.
I want to however the following questions were answered.
- A vector can be stored on other things in addition to the elementary data types? For example a vector can store the Editfields or LabelFields with content?
- A vector stores objects; Does that mean that I can create a custom object and then make a vehicle more of one of my custom object? How to make a custom object?
- What is casting? What is its use?
If you look at the doc for PersistentObject, you will find a list of objects that are implicitly persistent - this includes the String and vector. If you look at the Persistable doc, you will find a list of other objects that are persistable. If you want to create a persistent object, you can create using or extend them, by ensuring that all of the classes that are added to the object (or collection) implement also Persistable, directly or by implication.
Note that you must explicitly define an as Persistable class. If you say
class MyString extends {String
}
then MyString is not persistent.
I hope that now I understood and answered all of your questions! Sorry to not do it at the beginning.
-
dates of collections difficult. years and times are good.
I just imported all my photos in the form of files referenced in the Photos. Some of the photos had been imported originally using iphoto, some with opening and with lightroom. All those iPhoto and aperture had been exported as originals for my photos folder. They live outside the original iphoto and aperture libraries managed. Everything goes well except a few dates in the collections view are wrong. I checked the dates in my lightroom catalog (I have all imported as well) and they are all correct. In the years and moments all dates seem to be correct. It's very frustrating because I prefer the opinion of collections, but some of them are out of sync as much as 6 years. Is there a way to fix this?
One of the problem photos open in preview and check the EXIF date (or use Simple EXIF viewer - http://www.tucows.com/preview/1103787/Simple-EXIF-Viewer-For-Mac-OS-X )-I expect to deceive but check it out
and note that references libraries are not a good idea with Photos - Photos doesn't have the right tools to work with the referenced libraries and they are problems - and have no advantage (see this thing on iPhoto- iPhoto and file management - is the same for Photos) and it was even reported that they take more space in the photo library as the copy of the photos in a managed library
LN
-
I collect a quadrupole encoder using CounterReader and AsyncCallback. At any time, I would like to know how much value is currently stored/collected before receiving the AsyncCallback and calling EndReadMultiSampleDouble.
Hi MYR.
If I understand what you're asking, you should try the DaqStream.AvailableSamplesPerChannel property:
If you perform a task of counter entry in the buffer, then this property can be used to query the number of samples available in the input buffer that have not yet been read in the application memory.
Best regards
John
-
Collection of garbage and ListField Performance
Hello
I created an application that has a custom KeywordFilterField. This component is simply a custom listechamps that has the ability to KeywordFilterField.
I am in the phase of testing my application now. I don't know how (im using 5.0) Blackberry handles objects.
1. all objects created by my application receive garbage-collected when the application is closed?
2. the listfield scrolls very slowly after that I started and closed the app for a couple of times.
I think that whenever the application closes, objects created during execution are still causing the slowdown of my Listfield. Any advice out there?
Thank you
Mark
BTW, after reset a device (battery pull), the listfield scrolling performance is back to normal.
Not sure how much it will help. The close call AAFAIK only works for screen and does because when the screen detects that you close the last screen on the display stack, it will assign a System.exit (0).
I would recommend that you have an exit in your menu that directly call System, exit (0) and try this to see if it solves the problem.
Regarding your previous post, Persistentstore can leak, just generally harder to do because objects must be Persistable. That said, you can also cause problems for the PersistentStore if you have very large objects which you change or you do not commit.
I see you found this: 'every line contains a custom layout manager that positions the textfields on the inside.'. Page layout can certainly cause sluggish performance.
Maybe you are looking for
-
Pavilion 500-054: reloading Windows 8 new hard drive
Hello. I had a drive hard failure and have installed a brand new. I don't have the recovery disk. My question is how can I get Windows 8 original OS back on my new HDD without having to buy a whole new full version of Windows 8? Any help would be app
-
"WindowsUpdate_28FB02D9" "WindowsUpdate_dt000" SQL Service Packs update failure
Hello. I tried to install this update on my computer Windows 7 Professional. 64 bit. Update failed to install: Microsoft SQL Server 2008 Service Pack 2 (or 1). (KB2285068) Please help me on how to install these service packs. I get the message fai
-
Distortion w / PowerShot A1100 IS
What setting should I use so that my photos of a large room do not come with almost an effect "fisheye"? The vertical lines are little inclined, as if the camera cannot 'see' point of view.
-
Failure, then the installation program is underway
TWIMC...I'm dreaded "failure so that the Setup program is underway" on my HP Pavilion DV 9825. Instructions (links to) this forum require a Vista DVD to do a "clean install"... but the HP has come with pre-installed Vista - without disks. The recover
-
My admin account password is not working. Help, please! Running windows vista Home premium. HELP ANYONE?