Java Virtal Machine.net

[ News ] rss

February 01, 2011

Mark Wielaard: New GPG key. Finally created a new GPG key using gnupg. The old one was a DSA/1024 bits one and 8 years old. The new one is a RSA/2048 bits one. I will use the new one in the future to sign any release tarballs I might create. pub 2048R/57816A6A 2011-01-29 Key f...

More »

February 01, 2011

Andrew Hughes: [SECURITY] IcedTea6 1.7.8, 1.8.5, 1.9.5 Released!. We are pleased to announce a new set of security releases, IcedTea6 1.7.8, IcedTea6 1.8.5 and IcedTea6 1.9.5. This update contains the following security updates: The IcedTea project provides a harness to build the source code from OpenJDK6 u...

More »

December/2024
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
222324 25262728
293031    

[ Archives News
for 'Java Technology' ]

home > news > java technology > eclipse, com ... nothing new...

Eclipse, COM ... nothing new...

When reading http://www.eclipsezone.com/articles/what-is-iadaptable/ I got the impression that certain solutions always come back, are quite universal and independant of domain, language or environment. The question here is about getting certain aspects of an object that are not statically declared in a yet typesafe manner. The Eclipse world came up with IAdaptable, as it seems. public interface IAdaptable { Object getAdapter(Class clazz); } public class HashMap implements IAdaptable { public Object getAdapter(Class clazz) { if (clazz == java.util.List.class) { List list = new ArrayList(this.size()); list.addAll(this.values()); return list; } return null; } // ... } To be used like that: IAdaptable adaptable = new HashMap(); List list = (List)adaptable.getAdapter(java.util.List.class); Well, this immediately brought back good-old COM, Microsofts Component Object Model back to my mind. I alway felt comfortable with COM because COM objects are just as plain C++ objects and thus very fast. The basics are the same. Every object is just a IUnknown (which transforms into an IAdaptable) [ object, uuid(00000000-0000-0000-C000-000000000046) ] interface IUnknown { [restricted] HRESULT _stdcall QueryInterface([in] GUID* rrid, [out] void** ppvObj); [restricted] unsigned long _stdcall AddRef(); [restricted] unsigned long _stdcall Release(); } For this is nothing useful, derived interfaces ...


Date: February, 26 2010
Url: http://www.java.net/blog/herkules/archive/2010/02/26/eclipse-com-nothing-new


Others News

©2002-2019Java-Virtual-Machine.net free icons | best web design software | bootstrap navigation menu | formoid.com | bootstrap website builder