Thinking about switching over to Java for EMAIL software I wrote

Hi...
I am the current author of a unique EMAIL client/server program for the old MS-DOS operating system called D'Bridge. It is from the BBS days of Fidonet and I've recently began recoding some elements of the program to facilitate Internet support and whatnot. D'Bridge is over 20 years old and is written half in Borland Pascal 5.5 and half in Visual BASIC for DOS.
After careful thinking (and one of those "wouldn't it be cool?" thoughts), I'm thinking of rewriting the entire code in JAVA to have a platform independant solution. I would like to write a "server" edition which would serve Web, POP3/SMTP, FTP and Telnet users in addition to legacy Fidonet support via. traditional dialup modem lines. I would then like to write a "client" edition which would be totally slimmed-down to run on PDA's such as Palm OS or Windows CE.
I generally am new to the language but I'm going to take an entire printout of my current work and then go step-by-step into an OOP transition - D'Bridge was obviously written before the days of OOP and therefore makes heavy use of global variables, assembly language and other elements. Nearly half of the code is entirely devoted to controlling the menu system and screen elements - you could say that I'd like to use Java to concentrate more on what D'Bridge does instead of what it looks like. :-)
I guess I'm looking for any advice, feedback, criticism, encouragement, words of wisdom, whatever you want to call it. After studying the fundimentals of the language, I believe I can make the transition but need to know from you guys if a full-blown server package is possible - because thats what my DOS application is doing now, with a loyal and dedicated fan club that just loves it.
Nick

but need to know from you guys if a full-blown server
package is possible Yes.
JBoss and Tomcat are two free frameworks that exist solely to act as servers to support different parts of the documented J2EE API.
There are commercial versions that support the same framework as well as other types of solutions including forum software (like this site), middleware, message systems, Network Management Systems, etc.
And those are just the ones that I know about (and which I have implemented commercial solutions as well.)

Similar Messages

  • Thinking about switching from single-app to full CC. Is it possible to switch back at a later date or am I committed to a year of full membership?

    Hi there,
    I'm currently paying for Flash but it looks like I may have to use Photoshop and After Effects too, so I was thinking about switching to the full plan. However if I don't end up needing Photoshop or After Effects is it possible to downgrade my membership to single-app in the future?
    Thanks in advance!
    Dan

    Be sure to select the MONTHLY subscription so you may stop the subscription at any time and not have to pay a penalty for cancelling a year's subscription

  • I've been reading the comments re FCPX on MacBook Pro and now I'm scared. I'm taking a class now and thinking about buying to do videos for nonprofits. Won't be fancy stuff, but now wonder if it's a good choice. Also, heard Apple will drop support. Help?

    I've been reading the comments re FCPX on MacBook Pro and now I'm scared. I'm taking a class in FCPX and thinking about buying to do videos for nonprofits. Won't be fancy stuff, but now wonder if it's a good choice. Also, a classmate who was in CA last weekend said he heard that Apple will drop support of FCPX. Any truth? Advice?. I'm on 10.7.4 with 2.4 GHz Intel Core 2 Duo, 4 GB 1067 MHz. Thanks.    

    dkstj wrote:
    Also, a classmate who was in CA last weekend said he heard that Apple will drop support of FCPX.  
    While it is against the TOU of these boards to speculate on future products/updates what Thomas said is right: FCPX is quite a new product and it doesn't make any sense to drop it now.
    The only thing that MIGHT get dropped at a certain point is support for older hardware/OS as FCP X progresses.

  • All I wanted was a phone for my kid. Now thinking about switching despite ETF.

    So after much discussion, I decide to let my son have a smartphone to replace his dumb phone. I was on the fence about leaving him on my Verizon plan, or going prepaid with another carrier. I'd decided to keep him on my plan, for the convenience, and the network is good. June 26, we went to the Verizon store (the kid has been counting the days). They don't have the Samsung S4 mini, and they can't give it to us for the same price as the web site, so the woman there convinces me to try to order the phone over the web for in-store pickup. She really wants a sale, I guess. We try and try, and finally give up. We had to have been in the store an hour. Kid is disappointed, but I figure, I'll just order it from the web site when I get home.
    It doesn't work, doesn't work, doesn't work, and FINALLY June 27 (Friday) I am able to get through the order! But no option to pick it up in the store. Too bad, but they promise me they'll ship it overnight, so it's cool. This was getting on towards evening, so I wasn't expecting to get it Saturday, and I didn't. But I didn't get it Monday, either. I checked on the web, and it still says the order is processing. So I call. I wait on hold for quite a long time, finally speak to someone, she's not sure it it's shipped, so I ask if I can pick it up in the store if it hasn't. She puts me on hold for quite a long time, and then comes back and says, it has shipped, via FedEx, so no, you can't pick it up in the store. You'll get it tomorrow.
    Today, TUESDAY, I checked the site, and got a "still processing" message, and then finally a message that it's shipped, with a FedEx number that FedEx doesn't recognize. Got home, no phone, no slip from FedEx that they left the package somewhere, FexEx site says the number isn't valid. So I call. I was on hold for at least 40 minutes, because they're experiencing "higher than normal call volume" (yeah, I'll bet), and WHILE I'M ON HOLD I get an email that my order has shipped, via USPS, with another tracking number that isn't valid. Finally I get a human, who takes my info, and puts me on hold for a long time. He comes back and says, your order has shipped, via USPS, and he doesn't know when I'll get it.
    So my question is, what the HELL is going on with you guys? I've never really had an issue with you, I have been a customer for about 10 years. But this is ridiculous. Why would someone tell me my order had shipped when it hadn't? What is even the point of that? Why do you say you're going to ship my order overnight and then not do it? Not even process my order for days? Not try to fix it when I call and you realize it's all messed up? I'm so mad, I might go with Ting, they'll give me a credit for your early termination fee. It's the Sprint network, but I've got friends who swear by it. I'm so mad.

    I was in the exact same situation. I completed the order online, waited five days, and eventually called them back to be told that my order was still processing. I told them to cancel it, and I would retry. I ordered it again the next week, and it all happened again. They offered to escalate it and have it processed manually, but it could take another 48 hours. I told them to forget it.
    The next week, I activated a single line on my own account. It worked flawlessly. I ordered around 4:00 PM, and it showed up around 4:00 PM the next day. The difference was that I activated a single line on a new account, as opposed to activating another line on another account.
    It was a headache, and believe me, I know how you feel. Verizon representatives are more of a headache than they are actual help. Their hands are always tied, and everything has to be escalated.

  • Thinking about switch to mac

    I am in need of a new computer. I am a long time user of pc's. But the company i have been using the customer service has went downhill. And of course everyone knows windows has it's many problems. So I was thinking about giving the mac a try this time. So I thought who better to ask than the people who have had some trouble with their mac. And see if they still recommend it. Little info about me I have a small constuction company. So it will mainly be used for accounting type things. Tracking money, bid, estimates etc. I seen the imac comes with Quicken installed. How does this program work on the mac? I use it now on my pc. And it does pretty much everything i need. I guess my main thing is how is this computer for running a small company? Or is there a different mac that would work better for this? Any input would be greatly appreciated.

    Yes, you can run a business on a Mac. Quicken is available on Mac as is QuickBooks. Are you running a business using Quicken? In any case, the features are not the same for the Mac versions. It seems many people complain about the lack of abilities in the Mac version of QuickBooks Pro quite often. There is another program called MYOB. Not my cup of tea but some like it. Point is there are small business financial software packages for the Mac. The other programs like Keynote, Pages, Outliner, Mail, Safari, iPhoto all help in running your business as do many dashboard widgets.
    Next, the new iMacs have moved onto Intel processors and Universal Binary. Some applications are Universal already and some require Rosetta to run in the Mac OS. Unless you are a professional or at least use the Adobe products on a regular basis you don't really see a slowdown. Separate from this is a downloadable beta program called Boot Camp. This allows you to boot into Windows XP (which you have to purchase and install). Once in XP you can run your Windows apps just like you did on that old PC. So, you could just bring over your PC files (oh wait, do PCs have the ability to migrate like a Mac does?) Anyway...
    Then, you need to find which printer it is and determine if it is just a Dell shell over another manufacturers product in which case the driver may very well already be in the Mac OS. Again, if you are running XP then you should be able to use it anyway. If you really want to buy a new printer then look around the online retailers. They often bundle a printer and/or RAM with the purchase of a new iMac.
    iMacs: 20" MacTel; 500 & 400 MHz PowerPC G3s   Mac OS X (10.4.7)  

  • I cant sign in to i-cloud with my new apple id  i signed out of the old one and when i try to log in i just get the 'thinking about it' logo. this lasts for ages and doesn't sign me in.  help!

    Hi, i have recently purchased an i-phone 4s and had been merrily playing away and set up an i cloud account.  However when i tried to access i cloud from my pc i couldn't verify it.  I had to change my apple id because i no longer had access to my old e-mail.  I managed to sort out my i-phone and change all the  accounts to my new apple i.d (except game centre? don't know how to do that yet.)  but when i signed out of my old i-cloud account on my pc and tried to sign in with my new apple id it just tries to connect (i get the i'm thinking about it wheel) for ages; not allowing me to log on.
    Help!

    Content (apps, music, ibooks, films etc) is tied to the account that originally downloaded it, so if the iBooks app was downloaded using the account that you used to share with your ex then only that account can download updates to it. As it's a free app you could delete it and re-download it under your own account - and then re-download your ibooks into it (or copy the books to your computer's iTunes first via File > Transfer Purchases and then sync them back to the app).

  • Thinking about switching

    I'm thinking about buying a Mac but I'm having a hard time trying to find answers to my questions. Such as the principle differences between standard computers and Macs and if my progrmas will work on a Mac. Even navigating this site isn't that easy.

    Hi cyras:
    ...what to expect?
    IMO, the best computing experience of your life: seamless interconnectivity; elegant, inspiring design; an extremely intuitive interface; all told, a computer that makes you more productive, enhances your creativity and actually makes computing fun.
    Is Macs operating system as simple to use [as Windows OS]
    IMO, and in the opinion of many others, Mac OS X blows Windows (any flavor) out of the water, from a number of perspectives -- security, stability, ease of use, efficiency, the list goes on....
    Will my MS Money be compatible or does Mac have a simular program? What programs are available for surfing the internet?
    You know, of course, that you could Google the answers to all of these questions, right? So, I'm not going to do that for you, except to say that Turbotax works on both platforms; Quicken makes a version for the Mac that (I'm told) does just about everything that MS Money does; and, while OS X includes a sweet web browser called Safari that does pretty much everything that Internet Explorer does, there are a whole host of other (Mac compatible) Web surfing apps out there, many of which rank higher than either IE or Safari in tech mags and like, such as Firefox, OmniWeb and others. This article from MacWorld has lots of good info: http://www.macworld.com/2005/09/reviews/browserrdp/index.php
    Now, If I were you, I'd start Googling and research the answers to your specific questions, and, when you're done, run don't walk to your nearest Apple Store.
    Good luck.
    -- JDee

  • Java for Instructional software?

    Hi,
    I wanted to know if Java can be used for instructional software development. The age group targeted is 4-10yrs. By that, I would want rich multimedia content (video, audio and GOOD graphics). I saw the Java showcase - and saw that the graphics there are generated on the fly. What kind of tools will be needed is I have to use Java for this? Is there some kind of API?
    Thanks!!

    You can start programming Java and do all the things you are talking about with one download. If you go to the J2SE link in the upper left of this page, it will bring you to another page with Information On Specific Versions on the right side. You should probably stick with 1.4.1 because 1.4.2 is beta. You want to download the SDK for your platform.
    Now comes the hard part... You have to learn to program Java. There are Tutorials on the left side of the page. You should probably start with The Java Tutorial. Once you get past your first few programs, you might want to get an IDE. Sun Studio is available free. It will help you somewhat with the syntax and libraries. You should also learn how to search this site for info (Advance Search at the top of the page) and look up the API documentation (See APIs on the left of the page)

  • Thinking about switching to Intel Mac Mini... questions for the cognoscenti

    Greetings:
    I've been checking out the new Intel Mac Minis and I was thinking of purchasing one to replace my AV computer (PC) in the living room, which the GF currently uses. She's a typical user: watches video files/DVDs, uses iTunes excessively , sends web email and surfs the Net.
    I've fairly decided on an Intel Core Duo Mini. Since I know the basics about Mac, I had a few questions:
    1. What's an appropriate amount of RAM for a non-power user? Would 1 GB be more than enough or overkill? I'm used to running 1GB in a Windows machine. Plus, I'm also used to popping in memory when I needed to upgrade, and I see that's not really an option on the Mini.
    2. How would I integrate it into a Windows network? Would the Mini be able to share files with a Windows machine and vice versa?
    3. Regarding network integration: how easily would the Mini integrate into an existing Linksys 802.11g home network?
    Lastly, this isn't really an (easily) answerable question, but how easy do you think it would be for an average computer user to get up and running on a Mac after having used Windows machines all their life?
    Thanks, I look forward to your responses.
    -Craig
    Homebuilt   Windows XP Pro   2GB PC 3500 RAM, 500GB SATA RAID (2x250), ATI AIW 9700 Pro, Athlon XP3200

    Hello, I can only really answer Q's 1 & 3 as I've only owned a mini for the past 24 hours.
    I purchased the Single Core after taking advice of the Apple Store staff in Manchester, they were quite helpful. I only really produce music (have used Ableton, Acid Pro etc on PC for quite a while), surf the web, do my banking etc so was advised that the Single Core with 512mb would be sufficent. I work for an ISP and have 10 years plus knowledge of Windows but I was prepared to listen and learn having never used a mac before. From my own experience, I'm used to having to use a pc with minimum spec ie min 1.2GHz processor, 1gb ram in order to produce music without any pops or clicks (latency), though sound cards also play a part. I've also had to keep internet activity well away from any PC that I produce music on in that respect. Anyhow, I'm going off on a tangent here but I was playing around with garageband last night and I've never known music production to run so smoothy on 512mb RAM, never known it before so was extremely impressed and certain I made the right purchase opting for Solo Core. You may not actually NEED the full 1gb though this depends what you're doing. To answer your other question, my mac slotted straight into my home nertwork without making any additional configuration.
    i.e how long does it take to get used to a mac, I've found there is a learning curve but it's not THAT difficult, it's just the odd thing such as no right click of the mouse that takes some getting used to.

  • Thinking about switching to Windows

    This is not meant to be a Os X vs Windows thread. I dont think one platform is better than the other, but they have different strengths and weaknesses. What I want to hear is what kind of pitfalls I can expect in regards to live video performance if I go down the Windows way.
    Reason I`m asking is:
    My Macbook Pro recently died, so I borrowed my friends HP Laptop with similiar specs. He has used it alot for music production, sound of movies etc, and quite a decent graphics card (6xxxm 1gb ati radeon) I wanted to connect a Matrox Dualhead2go to two 1280 x 800 projectors using Resolume. However, I encountered nothing but problems all the way. Couldnt dual monitor resolutions, display went black, drivers stopped working, program had to restart. When it worked, it worked well, but I think I aged 10 years during that gig.
    Before that I wanted to buy a stationary shuttle PC, top of the line, 7970 radeon 3gb, Ivy bridge, Dell Touch Screen etc, but now I got a little scared of doing the switch.Having used Macbook Pro`s ever since I started VJìng, I`m very much used to plug and play using Triplehead2go, it just works. I usually use crossplatform software (resolume, after effects) but I also use motion and modul8 from time to time. I can live without however. The simplest choice is to buy a Macbook Pro, I know it, it works. But I like the idea of multiple choices in hardware, the ability to make a semi transportable shuttle and to be able to connect 6 projectors using eyefinity as some promoters have asked me to do bigger shows. Portability is important, but since I drag around 3 + projectors, the extra 10kg`s is not so important.
    So to all Windows VJ`s out there (or people with experience from both platforms) what kind of headaches can I expect if I make the switch? I`m a quite tech savvy guy (learn fast) even though I dont have much experience with the windows platform.
    1. Do you experience driver issues and troubles related to that?
    2. I`m not dependant of Syphon, but I would love to see a Windows version eventually. Do you think that is likely to happen during the next couple of years?
    3. Blue Screen of death or other strange issues?
    4. I have always wanted to get into Quartz Composer to create patches and effects for Resolume, but is there a equavilent Windows version?
    5. I`ve always been drooling over this one: http://www.youtube.com/watch?v=WxvQw0GVH2c, which is one reason I always wanted a PC.
    6. Slower performance over time using Windows? Or is that a thing of the past?
    7. Is the Os X video engine better than the one Windows is using?
    8. Any video software for windows that currently doesnt work in os x?
    9. Can you predict the future? is Apple leaving the pro market? Is Windows on a comeback?
    Hope this post is clear enough. I`m asking what I`m likely to miss out on, what I can expect, what headaches and what new possibilities comes with changing from Mac Os X to Windows. As my computer broke, now is the time for change, if ever. Hope to get some constructive replies guys!
    - Mads

    Mads Meskalin wrote:
    Hope to get some constructive replies guys!
    - Mads
    Good luck, but I doubt that you will. This is a Mac user forum; your questions are about Windows and would be better suited to a Windows forum.
    As for Q9, the moderators have a habit of removing posts that speculate about Apple's future direction.

  • What do people think about the different Generic Java approaches?

    I have seen a lot of different approaches for Generic Java, and when people find problems with each approach the normal response has been: the other approach is worse with such and such a problem, do you have a better way?
    The different approaches I have seen are: (in no particular order)
    Please correct me if I am wrong and add other approaches if they are worthy of mention.
    1) PolyJ - by MIT
    This is a completely different approach than the others, that introduces a new where clause for bounding the types, and involves changing java byte codes in order to meet it's goals.
    Main comments were not a java way of doing things and far too greater risk making such big changes.
    2) Pizza - by Odersky & Wadler
    This aims at extending java in more ways than just adding Generics. The generic part of this was replaced by GJ, but with Pizza's ability to use primitives as generic types removed, and much bigger changes allowing GJ to interface with java.
    Main comments were that Pizza doesn't work well with java, and many things in Pizza were done in parallel with java, hence were no longer applicable.
    3) GJ - by Bracha, Odersky, Stoutamire & Wadler
    This creates classes with erased types and bridging methods, and inserts casts when required when going back to normal java code.
    Main comments are that type dependent operations such as new, instanceof, casting etc can't be done with parametric types, also it is not a very intuitive approach and it is difficult to work out what code should do.
    4) Runtime Generic Information - by Natali & Viroli
    Each instance holds information about its Runtime Type.
    Main comments from people were that this consumes way too much memory as each instance holds extra information about its type, and the performance would be bad due to checking Type information at runtime that would have been known at compile.
    5) NextGen - by Cartwright & Steele
    For each parameterized class an abstract base class with types erased is made and then for each new type a lightweight wrapper class and interface are created re-using code from the base class to keep the code small.
    Main comments from people were that this approach isn't as backwards compatible as GJ due to replacing the legacy classes with abstract base classes which can't be instantiated.
    6) .NET common runtime - by Kennedy & Syme
    This was written for adding Generics to C#, however the spec is also targeted at other languages such as VB.
    Main comments from people were that this approach isn't java, hence it is not subject to the restrictions of changing the JVM like java is.
    7) Fully Generated Generic Classes - by Agesen, Freund & Mitchell
    For each new type a new class is generated by a custom class loader, with all the code duplicated for each different type.
    Main comments from people were that the generated code size gets too big, and that it is lacking a base class for integration with legacy code.
    8) JSR-14 - by Sun
    This is meant to come up with a solution Generic Solution to be used in java. Currently it is heavily based on GJ and suffering from all the same problems as GJ, along with the fact that it is constantly undergoing change and so no one knows what to expect.
    See this forum for comments about it.
    As if we didn't have enough approaches already, here is yet another one that hopefully has all of the benefits, and none of the problems of the other approaches. It uses information learnt while experimenting with the other approaches. Now when people ask me if I think I have a better approach, I will have somewhere to point them to.
    (I will be happy to answer questions concerning this approach).
    9) Approach #x - by Phillips
    At compile time 1 type is made per generic type with the same name.
    e.g.class HashSet<TypeA> extends AbstractSet<TypeA> implements Cloneable, Serializable will be translated to a type: class HashSet extends AbstractSet implements Cloneable, SerializableAn instance of the class using Object as TypeA can now be created in 2 different ways.
    e.g.Set a = new HashSet();
    Set<Object> b = new HashSet<Object>();
    //a.getClass().equals(b.getClass()) is trueThis means that legacy class files don't even need to be re-compiled in order to work with the new classes. This approach is completely backwards compatible.
    Inside each type that was created from a generic type there is also some synthetic information.
    Information about each of the bounding types is stored in a synthetic field.
    Note that each bounding type may be bounded by a class and any number of interfaces, hence a ';' is used to separate bounding types. If there is no class Object is implied.
    e.g.class MyClass<TypeA extends Button implements Comparable, Runnable; TypeB> will be translated to a type: class MyClass {
      public static final Class[][] $GENERIC_DESCRIPTOR = {{Button.class, Comparable.class, Runnable.class}, {Object.class}};This information is used by a Custom Class Loader before generating a new class in order to ensure that the generic types are bounded correctly. It also gets used to establish if this class can be returned instead of a generated class (occurs when the generic types are the same as the bounding types, like for new HashSet<Object> above).
    There is another synthetic field of type byte[] that stores bytes in order for the Custom Class Loader to generate the new Type.
    There are also static methods corresponding to each method that contain the implementation for each method. These methods take parameters as required to gain access to fields, contructors, other methods, the calling object, the calling object class etc. Fields are passed to get and set values in the calling object. Constructors are passed to create new instances of the calling object. Other methods are passed when super methods are called from within the class. The calling object is almost always passed for non static methods, in order to do things with it. The class is passed when things like instanceof the generated type need to be done.
    Also in this class are any non private methods that were there before, using the Base Bounded Types, in order that the class can be used exactly as it was before Generics.
    Notes: the time consuming reflection stuff is only done once per class (not per instance) and stored in static fields. The other reflection stuff getting done is very quick in JDK1.4.1 (some earlier JDKs the same can not be said).
    Also these static methods can call each other in many circumstances (for example when the method getting called is private, final or static).
    As well as the ClassLoader and other classes required by it there is a Reflection class. This class is used to do things that are known to be safe (assuming the compiler generated the classes correctly) without throwing any exceptions.
    Here is a cut down version of the Reflection class: public final class Reflection {
      public static final Field getDeclaredField(Class aClass, String aName) {
        try {
          Field field = aClass.getDeclaredField(aName);
          field.setAccessible(true);
          return field;
        catch (Exception ex) {
          throw new Error(ex);
      public static final Object get(Field aField, Object anObject) {
        try {
          return aField.get(anObject);
        catch (Exception ex) {
          throw new Error(ex);
      public static final void set(Field aField, Object anObject, Object aValue) {
        try {
          aField.set(anObject, aValue);
        catch (Exception ex) {
          throw new Error(ex);
      public static final int getInt(Field aField, Object anObject) {
        try {
          return aField.getInt(anObject);
        catch (Exception ex) {
          throw new Error(ex);
      public static final void setInt(Field aField, Object anObject, int aValue) {
        try {
          aField.setInt(anObject, aValue);
        catch (Exception ex) {
          throw new Error(ex);
    }Last but not least, at Runtime one very lightweight wrapper class per type is created as required by the custom class loader. Basically the class loader uses the Generic Bytes as the template replacing the erased types with the new types. This can be even faster than loading a normal class file from disk, and creating it.
    Each of these classes has any non private methods that were there before, making calls to the generating class to perform their work. The reason they don't have any real code themselves is because that would lead to code bloat, however for very small methods they can keep their code inside their wrapper without effecting functionality.
    My final example assumes the following class name mangling convention:
    * A<component type> - Array
    * b - byte
    * c - char
    * C<class name length><class name> - Class
    * d - double
    * f - float
    * i - int
    * l - long
    * z - boolean
    Final Example: (very cut down version of Vector)public class Vector<TypeA> extends AbstractList<TypeA> implements RandomAccess, Cloneable, Serializable {
      protected Object[] elementData;
      protected int elementCount;
      protected int capacityIncrement;
      public Vector<TypeA>(int anInitialCapacity, int aCapacityIncrement) {
        if (anInitialCapacity < 0) {
          throw new IllegalArgumentException("Illegal Capacity: " + anInitialCapacity);
        elementData = new Object[initialCapacity];
        capacityIncrement = capacityIncrement;
      public synchronized void setElementAt(TypeA anObject, int anIndex) {
        if (anIndex >= elementCount) {
          throw new ArrayIndexOutOfBoundsException(anIndex + " >= " + elementCount);
        elementData[anIndex] = anObject;
    }would get translated as:public class Vector extends AbstractList implements RandomAccess, Cloneable, Serializable {
      public static final Class[][] $GENERIC_DESCRIPTOR = {{Object.class}};
      public static final byte[] $GENERIC_BYTES = {/*Generic Bytes Go Here*/};
      protected Object[] elementData;
      protected int elementCount;
      protected int capacityIncrement;
      private static final Field $0 = Reflection.getDeclaredField(Vector.class, "elementData"),
                                 $1 = Reflection.getDeclaredField(Vector.class, "elementCount"),
                                 $2 = Reflection.getDeclaredField(Vector.class, "capacityIncrement");
      static void $3(int _0, Field _1, Object _2, Field _3, int _4) {
        if (_0 < 0) {
          throw new IllegalArgumentException("Illegal Capacity: " + _0);
        Reflection.set(_1, _2, new Object[_0]);
        Reflection.setInt(_3, _2, _4);
      static void $4(int _0, Field _1, Object _2, Field _3, Object _4) {
        if (_0 >= Reflection.getInt(_1, _2)) {
          throw new ArrayIndexOutOfBoundsException(_0 + " >= " + Reflection.getInt(_1, _2));
        ((Object[])Reflection.get(_3, _2))[_0] = _4;
      public Vector(int anInitialCapacity, int aCapacityIncrement) {
        $3(anInitialCapacity, $0, this, $2, aCapacityIncrement);
      public synchronized void setElementAt(Object anObject, int anIndex) {
        $4(anIndex, $1, this, $0, anObject);
    } and new Vector<String> would get generated as:public class Vector$$C16java_lang_String extends AbstractList$$C16java_lang_String implements RandomAccess, Cloneable, Serializable {
      protected Object[] elementData;
      protected int elementCount;
      protected int capacityIncrement;
      private static final Field $0 = Reflection.getDeclaredField(Vector$$C16java_lang_String.class, "elementData"),
                                 $1 = Reflection.getDeclaredField(Vector$$C16java_lang_String.class, "elementCount"),
                                 $2 = Reflection.getDeclaredField(Vector$$C16java_lang_String.class, "capacityIncrement");
      public Vector$$C16java_lang_String(int anInitialCapacity, int aCapacityIncrement) {
        Vector.$3(anInitialCapacity, $0, this, $2, aCapacityIncrement);
      public synchronized void setElementAt(String anObject, int anIndex) {
        Vector.$4(anIndex, $1, this, $0, anObject);
    }Comparisons with other approaches:
    Compared with PolyJ this is a very java way of doing things, and further more it requires no changes to the JVM or the byte codes.
    Compared with Pizza this works very well with java and has been designed using the latest java technologies.
    Compared with GJ all type dependent operations can be done, and it is very intuitive, code does exactly the same thing it would have done if it was written by hand.
    Compared with Runtime Generic Information no extra information is stored in each instance and hence no extra runtime checks need to get done.
    Compared with NextGen this approach is completely backwards compatible. NextGen looks like it was trying to achieve the same goals, but aside from non backwards compatibility also suffered from the fact that Vector<String> didn't extend AbstractList<String> causing other minor problems. Also this approach doesn't create 2 types per new types like NextGen does (although this wasn't a big deal anyway). All that said NextGen was in my opinion a much better approach than GJ and most of the others.
    Compared to .NET common runtime this is java and doesn't require changes to the JVM.
    Compared to Fully Generated Generic Classes the classes generated by this approach are very lightweight wrappers, not full blown classes and also it does have a base class making integration with legacy code simple. It should be noted that the functionality of the Fully Generated Generic Classes is the same as this approach, that can't be said for the other approaches.
    Compared with JSR-14, this approach doesn't suffer from GJ's problems, also it should be clear what to expect from this approach. Hopefully JSR-14 can be changed before it is too late.

    (a) How you intend generic methods to be translated.
    Given that Vector and Vector<Object> are unrelated types,
    what would that type be represented as in the byte code of
    the method? In my approach Vector and Vector<Object> are related types. In fact the byte code signature of the existing method is exactly the same as it was in the legacy code using Vector.
    To re-emphasize what I had said when explaining my approach:
    System.out.println(Vector.class == Vector<Object>.class);  // displays true
    System.out.println(Vector.class == Vector<String>.class);  // displays false
    Vector vector1 = new Vector<Object>(); // legal
    Vector<Object> vector2 = new Vector();  // legal
    // Vector vector3 = new Vector<String>(); // illegal
    // Vector<String> vector4 = new Vector();  // illegal
    Vector<String> vector5 = new Vector<String>();  // legal
    You must also handle the case where the type
    parameter is itself a parameterized type in which the type
    parameter is not statically bound to a ground instantiation.This is also very straightforward: (let me know if I have misunderstood you)
    (translation of Vector given in my initial description)
    public class SampleClass<TypeA> {
      public static void main(String[] args) {
        System.out.println(new Vector<Vector<TypeA>>(10, 10));
    }would get translated as:public class SampleClass {
      public static final Class[][] $GENERIC_DESCRIPTOR = {{Object.class}};
      public static final byte[] $GENERIC_BYTES = {/*Generic Bytes Go Here*/};
      private static final Constructor $0 = Reflection.getDeclaredConstructor(Vector$$C16java_util_Vector.class, new Class[] {int.class, int.class});
      static void $1(Constructor _0, int _1, int _2) {
        try {
          System.out.println(Reflection.newInstance(_0, new Object[] {new Integer(_1), new Integer(_2)}));
        catch (Exception ex) {
          throw (RuntimeException)ex;
      public static void main(String[] args) {
        $1($0, 10, 10);
    }and SampleClass<String> would get generated as:public class SampleClass$$C16java_lang_String {
      private static final Constructor $0 = Reflection.getConstructor(Vector$$C37java_util_Vector$$C16java_lang_String.class, new Class[] {int.class, int.class});
      public static void main(String[] args) {
        SampleClass.$1($0, 10, 10);
    Also describe the implementation strategy for when these
    methods are public or protected (i.e. virtual).As I said in my initial description that for non final, non static, non private method invocations a Method may be passed into the implementing synthetic method as a parameter.
    Note: the following main method will display 'in B'.
    class A {
      public void foo() {
        System.out.println("in A");
    class B extends A {
      public void foo() {
        System.out.println("in B");
    public class QuickTest {
      public static void main(String[] args) {
        try {
          A.class.getMethod("foo", null).invoke(new B(), null);
        catch (Exception ex) {}
    }This is very important as foo() may be overwritten by a subclass as it is here. By passing a Method to the synthetic implementation this guarantees that covariance, invariance and contra variance all work exactly the same way as in java. This is a fundamental problem with many other approaches.
    (b) The runtime overhead associated with your translationAs we don't have a working solution to compare this to, performance comments are hard to state, but I hope this helps anyway.
    The Class Load time is affected in 4 ways. i) All the Generic Bytes exist in the Base Class, hence they don't need to be read from storage. ii) The custom class loader, time to parse the name and failed finds before it finally gets to define the class. iii) The generation of the generic bytes to parametric bytes (basically involves changing bytes from the Constant Pool worked out from a new Parametric type, Utf8, Class and the new Parametric Constant types may all be effected) iv) time to do the static Reflection stuff (this is the main source of the overhead). Basically this 1 time per class overhead is nothing to be concerned with, and Sun could always optimize this part further.
    The normal Runtime overhead (once Classes have been loaded) is affected mainly by reflection: On older JDKs the reflection was a lot slower, and so might have made a noticeable impact. On newer JDKs (since 1.4 I think), the reflection performance has been significantly improved. All the time consuming reflection is done once per class (stored in static fields). The normal reflection is very quick (almost identical to what is getting done without reflection). As the wrappers simply include a single method call to another method, these can be in-lined and hence made irrelevant. Furthermore it is not too difficult to make a parameter that would include small methods in the wrapper classes, as this does not affect functionality in the slightest, however in my testing I have found this to be unnecessary.
    (c) The space overhead (per instantiation)There are very small wrapper classes (one per new Type) that simply contain all non private methods, with single method calls to the implementing synthetic method. They also include any fields that were in the original class along with other synthetic fields used to store reflected information, so that the slow reflection only gets done once per new Type.
    (d) The per-instance space overheadNone.
    (e) Evidence that the proposed translation is sound and well-defined for all relevant cases (see below)Hope this is enough, if not let me know what extra proof you need.
    (f) Evidence for backward compatibility
    (For example, how does an old class file that passes a Vector
    to some method handle the case when the method receives a Vector<T>
    where T is a type parameter? In your translation these types are unrelated.)As explained above, in my approach these are only unrelated for T != Object, in the legacy case T == Object, hence legacy code passing in Vector is exactly the same as passing in Vector<Object>.
    (g) Evidence for forward compatibility
    (How, exactly, do class files that are compiled with a generics compiler run on an old VM)They run exactly the same way, the byte codes from this approach are all legal java, and all legal java is also legal in this approach. In order to take advantage of the Generics the Custom Class Loader would need to be used or else one would get ClassNotFoundExceptons, the same way they would if they tried using Collections on an old VM without the Collections there. The Custom Class Loader even works on older VMs (note it may run somewhat slower on older VMs).
    (h) A viable implementation strategyType specific instantiations are at Class Load time, when the Custom Class Loader gets asked for a new Class, it then generates it.
    The type specific instantiations are never shipped as they never get persisted. If you really wanted to save them all you need to do is save them with the same name (with the $$ and _'s etc), then the class loader would find them instead of generating them. There is little to be gained by doing this and the only reason I can think of for doing such a thing would be if there was some reason why the target VM couldn't use the Custom Class Loader (the Reflection class would still need to be sent as well, but that is nothing special). Basically they are always generated at Runtime unless a Class with the same name already exists in which case it would be used.
    The $GENERIC_DESCRIPTOR and $GENERIC_BYTES from the base class along with the new Type name are all that is required to generate the classes at runtime. However many other approaches can achieve the same thing for the generation, and approaches such as NextGen's template approach may be better. As this generation is only done once per class I didn't put much research into this area. The way it currently works is that the $GENERIC_DESCRIPTOR are basically used to verify that a malicious class files is not trying to create a non Type Safe Type, ie new Sample<Object>() when the class definition said class Sample<TypeA extends Button>. The $GENERIC_BYTES basically correspond to the normal bytes of a wrapper class file, except that in the constant pool it has some constants of a new Parametric Constant type that get replaced at class load time. These parametric constants (along with possibly Utf8 and Class constants) are replaced by the Classes at the end of the new type name, a little more complex than that but you probably get the general idea.
    These fine implementation details don't affect the approach so much anyway, as they basically come down to class load time performance. Much of the information in the $GENERIC_BYTES could have been worked out by reflection on the base type, however at least for now simply storing the bytes is a lot easier.
    Note: I have made a small syntax change to the requested class:
    public T(X datum) --> public T<X>(X datum)
    class T<X> {
      private X datum;
      public T<X>(X datum) {
        this.datum = datum;
      public T<T<X>> box() {
        return new T<T<X>>(this);
      public String toString() {
        return datum.toString();
      public static void main(String[] args) {
        T<String> t = new T<String>("boo!");
        System.out.println(t.box().box());
    }would get translated as:
    class T {
      public static final Class[][] $GENERIC_DESCRIPTOR = {{Object.class}};
      public static final byte[] $GENERIC_BYTES = {/*Generic Bytes Go Here*/};
      private Object datum;
      private static final Field $0 = Reflection.getDeclaredField(T.class, "datum");
      private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C1T.class, new Class[] {T.class});
      static void $2(Field _0, Object _1, Object _2) {
        Reflection.set(_0, _1, _2);
      static Object $3(Constructor _0, Object _1) {
        try {
          return Reflection.newInstance(_0, new Object[] {_1});
        catch (Exception ex) {
          throw (RuntimeException)ex;
      static String $4(Field _0, Object _1) {
        return Reflection.get(_0, _1).toString();
      static void $5() {
        T$$C16java_lang_String t = new T$$C16java_lang_String("boo!");
        System.out.println(t.box().box());
      public T(Object datum) {
        $2($0, this, datum);
      public T$$C1T box() {
        return (T$$C1T)$3($1, this);
      public String toString() {
        return $4($0, this);
      public static void main(String[] args) {
        $5();
    }as the generic bytes aren't very meaningful and by no means a requirement to this approach (NextGen's template method for generation may work just as well), here are the generated classes with some unused code commented out instead:
    class T$$C28T$$C22T$$C16java_lang_String {
      private T$$C22T$$C16java_lang_String datum;
      private static final Field $0 = Reflection.getDeclaredField(T$$C28T$$C22T$$C16java_lang_String.class, "datum");
    //  private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C34T$$C28T$$C22T$$C16java_lang_String.class, new Class[] {T$$C28T$$C22T$$C16java_lang_String.class});
      public T$$C28T$$C22T$$C16java_lang_String(T$$C22T$$C16java_lang_String datum) {
        T.$2($0, this, datum);
    //  public T$$C34T$$C28T$$C22T$$C16java_lang_String box() {
    //    return (T$$C34T$$C28T$$C22T$$C16java_lang_String)T.$3($1, this);
      public String toString() {
        return T.$4($0, this);
      public static void main(String[] args) {
        T.$5();
    class T$$C22T$$C16java_lang_String {
      private T$$C16java_lang_String datum;
      private static final Field $0 = Reflection.getDeclaredField(T$$C22T$$C16java_lang_String.class, "datum");
      private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C28T$$C22T$$C16java_lang_String.class, new Class[] {T$$C22T$$C16java_lang_String.class});
      public T$$C22T$$C16java_lang_String(T$$C16java_lang_String datum) {
        T.$2($0, this, datum);
      public T$$C28T$$C22T$$C16java_lang_String box() {
        return (T$$C28T$$C22T$$C16java_lang_String)T.$3($1, this);
      public String toString() {
        return T.$4($0, this);
      public static void main(String[] args) {
        T.$5();
    class T$$C1T {
      private T datum;
      private static final Field $0 = Reflection.getDeclaredField(T$$C1T.class, "datum");
    //  private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C6T$$C1T.class, new Class[] {T$$C1T.class});
      public T$$C1T(T datum) {
        T.$2($0, this, datum);
    //  public T$$C6T$$C1T box() {
    //    return (T$$C6T$$C1T)T.$3($1, this);
      public String toString() {
        return T.$4($0, this);
      public static void main(String[] args) {
        T.$5();
    class T$$C16java_lang_String {
      private String datum;
      private static final Field $0 = Reflection.getDeclaredField(T$$C16java_lang_String.class, "datum");
      private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C22T$$C16java_lang_String.class, new Class[] {T$$C16java_lang_String.class});
      public T$$C16java_lang_String(String datum) {
        T.$2($0, this, datum);
      public T$$C22T$$C16java_lang_String box() {
        return (T$$C22T$$C16java_lang_String)T.$3($1, this);
      public String toString() {
        return T.$4($0, this);
      public static void main(String[] args) {
        T.$5();
    }the methods from the Reflection class used in these answers not given in my initial description are:
      public static final Object newInstance(Constructor aConstructor, Object[] anArgsArray) throws Exception {
        try {
          return aConstructor.newInstance(anArgsArray);
        catch (InvocationTargetException ex) {
          Throwable cause = ex.getCause();
          if (ex instanceof Exception) {
            throw (Exception)ex;
          throw new Error(ex.getCause());
        catch (Exception ex) {
          throw new Error(ex);
      public static final Constructor getDeclaredConstructor(Class aClass, Class[] aParameterTypesArray) {
        try {
          Constructor constructor = aClass.getDeclaredConstructor(aParameterTypesArray);
          constructor.setAccessible(true);
          return constructor;
        catch (Exception ex) {
          throw new Error(ex);
      }

  • Why does it take over ten minutes for email to get through for my request for a signature

    Why isn't this program faster? It's been over 20 minutes emailing a test form, to myself, to see how quick this is? Is this normal? Not what I was looking for in a software program

    Have you tried to eliminate everything extraneous. In other words, do you experience the same delays with a simple Java program (no lookups, JNDI) that loads the drivermanager and creates a connection.
    Do you have access to a traciong JVM or some program that captures run-time execution timing information? Even without the source, this will tell you the specific class::methos where time is spent so you can better determine where the delay is ocurring.

  • Thinking about switching to Mac from Windows, Good Idea?

    I've always had a PC and I've never really used or work with a Mac.  I'm a little questionable about buying one.  What all do I need to know about Macs?  I plan on using it for college and personal reasons. I hardly do anything outside of my house with my laptop. I've got an iPad and an iPhone which is what lead me to buying a Mac. I've done some research myself, but I don't know whether the Macbook Air or the Macbook Pro would be better for my uses.  Is it better to go for the 512GB flash storage or should the 256GB work out fine? I've got a lot of questions, so sorry in advance.
    Thanks for the help!
    broken_mirror

    Good article >  http://thenextweb.com/apple/2013/11/10/switching-windows-mac-learned/
    Storage size depends on use. If you store a huge photo and video library, go with the 256GB.
    The comparison tool might be helpful for you >  http://store.apple.com/us/mac/compare
    Easy to migrate your Windows data to a Mac >  Switch Basics: Migrate your Windows files to your Mac

  • Why does Firefox still underline President Obama's name as a misspelling. I am really thinking about switching services because of this.

    Firefox does not recognize the name of the current President of the United States of America's name as a valid spelling. Type in President Obama and Obama is underlined. It is underlined twice in my above details. I just checked and your suggestions for what I might have been trying to type are Obadiah, Obadias, Bamako, & Alabama. Are you trying to make a political statement by not recognizing his name? If this is not fixed in the next week I will no longer use your services and will start recommending that others do the same.

    the-edmeister,
    I do not think that a demand that the President of the United States of America's name be added to the real dictionary and that is will stop using it and recommend other do the same as asinine threats. No matter your political views, respect is due to the President of the United States of America. He has been president for over two years. How long should it take to make a change like this. I should not have to add the Presidents name to my personal dictionary.

  • Thinking About Switching To Getting an iPhone. But some Questions. .. .?

    My Verizon wireless contract will reach its end in January of 2008. I will then be free to choose another provider if i choose so and iphone with att looks appealing.
    But before i make the switch i have some concerns and question i'd like to be answered:
    What is the initial start up cost for getting an iPhone?
    I'm assuming,
    the iPhone at $399
    and then either the $59.99 or $79.99 monthly bill right?
    Or is there some sort of hidden fee such as a connection or new customer fee or whatever?
    Also, Free internet to go online but is it realible? I'm hearing it's super slow and it's a crowded network. Anyone clarify on this?
    Next, I use Gmail and it syncs perfectly (and free) to "Mail" in my Macbook. Can I get mail for free on my iPhone with my Gmail account?
    Even though Cingular is now the new Att, Do Rollover Minutes still apply?
    And finally, is it worth it?

    Decemberist wrote:
    So with the rollover minutes, i will be living in china for about 3-7 months in China starting in May of 2008. Does that mean all those months of minutes will just add up while i'm out of the country?
    Yes, except they expire after 12 months (rolling, so the oldest minutes disappear first).
    If you are planning to use your iPhone in China beware of roaming charges and high data charges. AT&T offers international calling and data plans that mitigate this a little (e.g., calls in China are $1.99/minute instead of $2.29, and the data plan for $25 extra a month gives you 20 MB free and $5 a megabyte after that, compared to $20 a megabyte without the plan).
    I use my smartphone when in China (haven't been back since I got the iPhone), but primarily to receive calls to my US number. I also have a quad band basic GSM phone that I put a China Mobile prepaid SIM card in when there. This makes me reachable by my associates in China without them dialing an international number, and also reduces the cost of all calls dramatically (e.g., 3 cents/minute in China, 30 cents to the US, billed in 6 second increments.)

Maybe you are looking for

  • Automate PDF Form to Excel

    I have Adobe Acrobat X Pro and Adobe LiveCycle Designer ES2. I'm going to start off with what I have currently and what I want to do to see if anyone can come up with a solution. I have created a form for new suppliers to fill out in Adobe Acrobat X

  • How to read material services object attachments

    Hi, I'd like to read pdf documents attached to material master. There is any function to do that? Then I have to send an email attaching this document with a custom program. thank you in advance! Oscar

  • Javax.naming.NamingException: Cannot create resource instance (JOTM )

    Hi all, I wanted to create an application with transaction management, first i tired out tyrex but could get a thing out of it now i am trying out JOTM, but i am getting this error "javax.naming.NamingException: Cannot create resource instance ", bel

  • When traveling abroad, how to use wifi only?

    My daughter is going to a tech school in Denmark and wants to use her phone for local wifi access (web browsing and iMessage, etc).  This morning we were able to exchange text messages when she was not connected to wifi.  It appears she would have be

  • @Ceroberts75-Need for Speed Questions !

    OK, This is in specific to Ceroberts75 and maybe also others... After People have reported some improvements in smoother and faster working of their N900 after the PR 1.3 update. The Need for speed Tips that Ceroberts75 has posted in his topic " Top