How to compile against multiple libraries w/ different API's

I am trying to write code that will run with 2 different versions of a Java library. The API is different between those 2 library versions.
For example in library v1.1 I have a method:
myMethod(String x) {...}And in library v1.2 I have a method:
myMethod(String x, String y) {...}In my calling code I have a way to determine what version of the library is present. I want to dynamically choose at runtime which API to call based on this version. Roughly, the code would look like this:
if (version = "1.1")
    myMethod("arg1");            //call 1.1 API
else if (version = "1.2")
    myMethod("arg1","arg2");   //call 1.2 API
  }The problem is that I cannot compile my code with both versions of my library at the same time. The method whose corresponding library is not used to compile always causes an error.
Can someone suggest a design pattern that I can use to get around this? There must be some way to call a different version of myMethod() (with different number of parameters) without exposing it to the compiler.
Thanks.

The problem is that I cannot compile my code with
both versions of my library at the same time. The
method whose corresponding library is not used to
compile always causes an error.
Huh?
You do have two versions of the library right? And you can compile both right?
If so then the problem is the application.
If so.....
- You create a proxy library. It loads the real library dynamically using reflection based on however you determine which is correct.
- You compile the application using the proxy library.
Note that in the above the application is NOT compiled with the two real libraries. The libraries are compiled seperately.

Similar Messages

  • How can I edit multiple clips with different frame rates on the same timeline

    how can I edit multiple clips with different frame rates on the same timeline

    You do not want to edit material from different frame rates on one timeline. You CAN do this, but it is a very bad idea - and this is why.
    Once you establish the sequence frame rate - lets say it is PAL material at 25fps, any material that you drop into the sequence other than 25 fps will have to be changed to play at 25 fps. If the material you add is NTSC (29.97), FCP will DROP 5 frames per sec to bring the frame rate down to 25 fps. Which 5 get thrown away? Every 6th one. This yields a funky cadence that becomes even more complex as as there are also interlaced fields (DV/NTSC is an interlaced format). Oh, and by the way, the image sizes are different as well. DV/PAL has 576 lines of resolution and DV/NTSC has 480. FCP has to scale up the NTSC to fit the PAL frame.
    You do not want FCP adjusting these things on the fly. You want to do a thoughtful (and time consuming) conversion so that you end up with all your material in one format with the best possible image from the conversion process. Compressor can do an adequate job with Frame Controls turned on. The Natress Standards Conversion FCP plugin is another way to go. A third option is to find a post house that can do the conversion for you using a hardware based process.
    The good news is, once everything is in the same format, editing it will be painless and the output process very quick.
    Whatever frame rate/ image size you select, I'd suggest using ProRes for the codec. It is 4:2:2 color and will withstand color correction and composting with much more grace than any variant of DV based codecs.
    Have fun.
    x

  • How to go about multiple inclination with different data selection in Delta

    We have to copy large amount of data ( more than 42lak of recodes) selectivly from on ODS to other ODS. in delata load ( BW 3.5 enverioment)
    I thought of loading data in slices through delta loading with selection condition.
    step 1> Do The initialization with selection condition as for calyear =2001 ( Init without data transfer )
    step 2> Take the delta load .. it will take all delta record with same selection
    step 3> Now I want to do Initialization with selection condition as for calyear =2002
    step 4> take the delta now it will take delta for year 2001 and 2002 both Right ?
    Here what problem I am facing.. while doing 2nd time initialization it prompt me to delete the last  initialization request form scheduler menu.
    if i delete the last request .. will it take the delta  for previous initialization selection  and new initialization selection. ?
    Please advice how to go about multiple inclination with different data selection in delta loading.
    Looking forward your reply.

    Hi,
    step 1> Do The initialization with selection condition as for calyear =2001 ( Init without data transfer )
    step 2> Take the delta load .. it will take all delta record with same selection
    step 3> Now I want to do Initialization with selection condition as for calyear =2002
    step 4> take the delta now it will take delta for year 2001 and 2002 both Right ?
    You are correct with this scenario normally. The message you mentioned normally comes up when you open a infopackage and don't change the selection first or in case you have overlapping selections with an already done init.
    regards
    Siggi

  • How do you make multiple libraries WITHOUT replicating similar directories?

    I have two ipods and one ipad
    On each, I have some of the same music, and more importantly, many of the same movies AND podcasts.
    I can't figure out how to use multiple libraries that share files (on a SINGLE COMPUTER).
    For example, my three libraries ALL seem to want to create a directory for the exact same podcast, which then stores the files three seperate places, killing my hard drive space.
    How can I tell each seperate library to only look in one location for the podcast / movie / music files?
    Message was edited by: tvmaster

    For some reason, I could only add items IF the ipad was hooked up, is that correct?
    No.
    You don't need anything connected to create playlists.
    If you selected the iPad and created playlist directly on the iPad through iTunes, yes you would need it connected to edit those playlists.
    But don't do it that way.
    Just create them without the device connected.
    Also, you don't need playlists for everything. Mainly music.
    In iTunes, you can select the device (when connected) and click the Movies, Podcasts and *Music Videos* tabs and select what to sync. You can make different selections for each device.
    For music, create a playlist for each device to have differnt music on each device.
    Connect the device, click the Music tab, tick *Sync music*, then *Selected playlists* and tick the playlist you want on that specific device.

  • How to set up multiple libraries on one computer

    How do you set up multiple libraries on one computer for itunes?

    Launch iTunes with the Shift key(Windows) or Option key(Mac OS X) held down.
    (90004)

  • How can I create multiple libraries on a windows 8 HP computer?

    I just got the newest generation Ipod Touch, and the itunes is not supported on my iMac G5. My parents have a Windows 8 HP computer. My dad's itunes account is on that computer. So what I want to do is use my external hardrive to sync it to my Windows 8 computer. I am trying to find out how to create multiple libraries.
    Please help me out.

    These all have drm so i cannot read them without a i-Device. 
    Correct.  If you do not have an iOS device or a Mac running Mavericks, do not buy Apple iBooks.  They will be unreadable.

  • Managing multiple libraries with different file types (AAC v. Lossless)

    I have set up two libraries, one for my AAC music and the other for my lossless music. The files themselves are located in two separate places on my hard drive. When I switch libraries (option-clicking iTunes), and go to Preferences/Advanced tab, the directory for the files and the import method doesn't change -- I have to change it manually. This is annoying.
    Does anyone know of a way to automate this change, so that if I open a new library, the default location of the files and the import format changes automatically? I tried ituneslibrarymanager from Dougscripts, but for some reason can't get this program to install on my machine.

    No, it's the same Windows XP user account, but I have two separate music libraries - the music files in library are in a lossless format, while those in the other are in AAC. For convenience, I wish to keep the two libraries separate.
    In iTunes 7 it is possible to have separate libraries - start iTunes and hold down the SHIFT key (Windows) while the program starts. A dialogue box then appears where the required library can be selected. However, as far as I can tell, it's not possible to have a different set of preferences for each library.
    Say the preferences are set up for my lossless library, which is located on a separate network drive. If I then make the AAC library active and open iTunes, iTunes reindexes the library according to the settings for the lossless library and I end up with the AAC library full of lossless files. I've tried unchecking various things in the preferences box, but I've had no luck fixing the problem. Thanks for your suggestion - I have already reported the problem.
    The whole thing is a rather inelegant way of managing multiple libraries in iTunes. Surely the Apple developers can come up with a way of doing it from within iTunes??

  • How can i run multiple libraries simultaneously ?

    i work in music & post production, i tend to keep my listening music on my 60 gig ipod, & keep my main itunes library for sound fx & production masters...
    i understand i can create & change libraries but is there a way or app that will give me access to multiple libraries simultaneously ? id like 3 .. each accessing different drives without having to save, close, load or dump anything. ????

    I've found this:
    http://dougscripts.com/itunes/itinfo/ituneslibrarymanager.php
    But I'm having trouble determining whether they can run simultaneously. But, it's something for you to look into, at least.
    CG

  • How do you organize multiple libraries?

    Last year, I kept one big giant library for every 6 months. This consisted of a terabyte of images per library.
    I have always feared a library becoming corrupted and being unable to successfully restore the images.
    Do people keep smaller libraries?
    I am thinking of starting a new library every month. Does this seem like a good idea? or a waste?
    Lastly, do people keep the actual images not stored in the aperture library itself in case you need to get to the original file if something were to happen to the library?
    Thanks!

    My biggest objection to multiple Libraries is that you then can't search for anything except the 'current' images, but I'm doing a lot of DAM tasks with Aperture as well as normal processing.
    I mostly use referenced files, but that's because I'm usually working on a MBP which simply doesn't have the room to store all the files.
    Ian
    P.S. Don't worry too much about corrupted Libraries - your images aren't being stored in a binary database file, they are in a 'package' - in other words it's a special kind of folder which you can access by Control-clicking on it in the Finder and choosing 'Show Package Content'. You can then do a Spotlight search in the folder and find all your image - doesn't matter if the DB is corrupt, you don't even need Aperture on the machine.

  • How do I create multiple libraries & use with multiple ipods?

    Hi All,
    My wife and I have different tastes in music. Currently we use different user log ons to seperate our libraries. It's a complete pain because there's no other reason to use seperate log ons.
    We'll soon be upgrading to a new iMac and I'm wondering if it's possible to have two libraries operating in the one itunes sesssion?
    So here are my questions:
    1) Can I have two libraries sourcing the same music files?
    2) We each have an iPod, can it be set to only update one of those libraries, but still automatically update when connected?
    3) If we create playlists, will they be associated with only one library, or both (my preference is one, of course)?
    4) I'm pretty sure iPods can be set so my iPod only updates my playlists, and my wife's iPod only updates her playlists - is that correct?
    5) If we have seperate libraries, can we have seperate ratings? (Our opinion of what a five star song is is different)!
    Of course, for the above questions, if the answer is 'yes' please let me know how to do this. I've had a look through the itunes manuals online, but they don't seem to have any information.
    Cheers, Chris

    Chris,
    I have the exact same situation, and I have tried Doug's iTunes Library Manager, but it doesn't work for me. The first workaround I tried was to set up two smart playlists to group together any music that only one of us liked, which could then be checked or un-checked (control-click) depending on which iPod is being synced. This is clumsy, and if you aren't careful the Recently Added playlist will still "contaminate" your iPod.
    Last night I just made a new library for my wife (hold down Option when starting iTunes), copied everything over using the Add to Library command, exported all the playlists using the Export Library command, deleted all the music and playlists she doesn't want, and synced her iPod. It took a while to erase and re-sync, but it is now synced to HER library, and she doesn't see any music she doesn't like.
    Tonight I will do the same for myself. I will have, then, three libraries which can be selected by holding down the option key when starting iTunes: Mine, My wife's, and the main one with everything (called Library) All the music files stay on an external Firewire Drive. There is no way to toggle libraries from within iTunes, you have to quit and start it again holding down the option key.
    Podcasts are another story, and I haven't quite figured them out yet.
    Marty

  • How can I create multiple pages, with different layouts to the others, in DW fluid grid layouts?

    Hi everyone,  : )
    I am creating a website using FGL in DW CS6, v12.0 build 5808.  I do not have Creative Cloud (do you have to pay to use this service?).
    I have created one layout for my home page.
    I would like to create several more pages, but I want them to use different layouts (as well as different content).
    I tried to do something similar before using 'save as' (this was with a non-FGL), but whenever I changed the original page that I had 'save as'd' from, the layout in all the other pages would change too!
    I found a possibility from someone else online suggesting using a template, but have not tried it yet: http://www.linkedin.com/groups/Adding-second-fluid-page-in-119937.S.192422240
    I'm a bit scared of breaking everything, as I am new to web design and have had to restart the whole process a few times due to messing up the fluid.css etc and other issues, so I am taking baby steps.
    Happy to try whatever's suggested and, while I wait for (I hope) your responses, I think I will try the template thing, but from the reply the person who asked the question gave, it sounds like his subsequent pages changed too, as I mentioned above?  *scared*  ; )
    If anyone can help me with this query I would be very grateful.  Thank you!  : )

    Thanks David.
    I tried using different IDs for the other pages, but eventually one of the divs seems to 'break' - it overlaps other divs, or cannot be moved or resized (you can select the outline and it goes blue, but no 'move up a row' or down a row or 'lock to grid' etc icons appear and it can't be drag-re-sized), plus the green overlay disappears (just from that div.  I'm aware of how to turn visual aids on and off), so it seems broken.  This often seems to happen if you rename a div once it's been created; it does not rename in the layout.css on the right side panel (CSS Styles) in DW and the 'broken' behaviour above is exhibited.  Do you know anything about this?  Is this the 'edit this doc at your peril' stuff that most tutorials seem to mention?  Am I doing something wrong?
    I also tried making an FGL and saving out the original boilerplate.css, layout.css and respond.js.  Then created multiple new FGLs and each time it created new versions of layout.css (called 'untitled-1', 2 etc.).  Once I had created all the FGLs, I deleted all the new boilerplates and untitled.css files.  Then restored the original ones and changed the link at the top of each page's html to refer to the same filename (the original layout.css), rather than untitled.css.  I thought this might work and it seemed to for a while, but then as I had to add new div names for the sections on each page, it eventually broke (as above).
    Anyway, I think you have a good point about different layouts and it occurred to me also while I was exploring and waiting for replies here.  I think I will make one layout for all pages and go with that.  I have a couple of questions about that though:
    1. I think the max number of divs I want for one of the pages is 10, but some pages need less divs.  If I only fill e.g. 8 divs on one page, will the other ones be sat there empty?  I think they will actually...I guess I'm asking because I have not tried it yet (will do after this) and it takes so long to do this trial and error.
    2. If the amount of content in each div is different, e.g.  let's say Page 1 has 6 lines of content in div1, but page 2 may have an unlimited amount of content (I will want to add to it in the future).  Will this result in the div on page 1 being a huge block of empty space after its 6 lines?
    Thanks so much for your help!

  • How can I manage multiple iPads for different students?

    Problem: I need to manage multiple iPads for my students with special needs. I need to download different apps to different iPads and I'm not sure how to keep their apps separate but still keep ultimate control of the units (i.e. lock them from loading anything on the apps that we at the school district haven't approved).
    I need to be the only one doing updates, loading software, etc., and don't want to keep using my own personal iTunes account...any suggestions?

    If the presenter is using a computer and everyone else has an iPad this is very easy and free. Just use http://join.me and on the iPad just download their free app

  • How do I collapse multiple libraries into one library?

    I have a couple of dozen libraries, created over multiple versions of FCP, and now I have equivalent copies of events and resources strewn across multiple library files across three drives.  Plus, FCP has been automatically creating new instances of projects and storing them in files named with dates; I can't find the latest version to open it!
    How do I collapse all these libraries into one?  Hopefully not by moving event by event from one to another!  It takes a couple of minutes per event and resource; the program keeps wanting to "reload" resources after each move.

    It looks like you updated your libraries multiple times. Yes, the only way to consolidate them is to drag the events from each library into a master library.

  • How do I insert multiple values into different fields in a stored procedure

    I am writing a Stored Procedure where I select data from various queries, insert the results into a variable and then I insert the variables into final target table. This works fine when the queries return only one row. However I have some queries that return multiple rows and I am trying to insert them into different fields in the target table. My query is like
    SELECT DESCRIPTION, SUM(AMOUNT)
    INTO v_description, v_amount
    FROM SOURCE_TABLE
    GROUP BY DESCRIPTION;
    This returns values like
    Value A , 100
    Value B, 200
    Value C, 300
    The Target Table has fields for each of the above types e.g.
    VALUE_A, VALUE_B, VALUE_C
    I am inserting the data from a query like
    INSERT INTO TARGET_TABLE (VALUE_A, VALUE_B, VALUE_C)
    VALUES (...)
    How do I split out the values returned by the first query to insert into the Insert Statement? Or do I need to split the data in the statement that inserts into the variables?
    Thanks
    GB

    "Some of the amounts returned are negative so the MAX in the select statement returns 0 instead of the negative value. If I use MIN instead of MAX it returns the correct negative value. However I might not know when the amount is going to be positive or negative. Do you have any suggestions on how I can resolve this?"
    Perhaps something like this could be done in combination with the pivot queries above, although it seems cumbersome.
    SQL> with data as (
      2        select  0 a, 0 b,  0 c from dual   -- So column a has values {0, 1, 4},
      3  union select  1 a, 2 b, -3 c from dual   --    column b has values {0, 2, 5},
      4  union select  4 a, 5 b, -6 c from dual ) --    column c has values {0, -3, -6}.
      5  --
      6  select  ( case when max.a > 0 then max.a else min.a end) abs_max_a
      7  ,       ( case when max.b > 0 then max.b else min.b end) abs_max_b
      8  ,       ( case when max.c > 0 then max.c else min.c end) abs_max_c
      9  from    ( select  ( select max(a) from data ) a
    10            ,       ( select max(b) from data ) b
    11            ,       ( select max(c) from data ) c
    12            from      dual ) max
    13  ,       ( select  ( select min(a) from data ) a
    14            ,       ( select min(b) from data ) b
    15            ,       ( select min(c) from data ) c
    16            from      dual ) min
    17  /
    ABS_MAX_A  ABS_MAX_B  ABS_MAX_C
             4          5         -6
    SQL>

  • Multiple libraries with different desktop shortcuts

    I know that iTunes can boot from different libraries by holding Shift while starting. But is it possible to create a shortcut on desktop to open iTunes using a defined library (so I dont have to hold Shift while starting iTunes)?
    Like for instance I would like two shortcuts: one that starts iTunes loading my iPhones library and a shortcut that starts iTunes using my iPads library.

    As Polydorus says you can't just create a shortcut to the different .itl files as iTunes will always open the last library it used regardless. The next best thing is probably a bit of software such as Libra that lets you switch libraries. I used it briefly about 4 years ago when I was first evaluating iTunes but the web pages shows it has been keeping up to date so it should do what you need.
    I don't see a real need for it myself since it is easy to manage multiple devices with one library by creating playlists for the content that you want on each device. Using one library also means that content purchased on one device becomes easily available for the others. That said, I might try it out again as I do occasionally need to switch to test libraries when I'm trying to examine some of iTunes' quirks.
    tt2

Maybe you are looking for

  • Display number of unread and read messages in mailboxes?

    Hiya, Can I get Mail to list the total messages in a mailbox in the column on the left? I have a smart-mailbox for "flagged" items and I'd like to be able to see how many things are in it, while I'm sorting things in my inbox. There's an unanswered p

  • Link in alert email for PPTX document leads to "File Not Found" - Caused by encoding error

    We have an issue brought to our attention by our customers that has me scratching my head.  When our users sign up for an alert on a document library and a PowerPoint document is edited, the link in the alert email looks something like this: http://T

  • Getting exception in sending mail

    hi i got the exception as javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first m78sm938871pye eventhoug i tryed all the suggestion specified in the forum. But still i got this problem can any one send the sulution for me its u

  • Urgent...problem in  manuall ale config

    hi all, when iam doing ale config for a a simple vendor master data transfer i got error. the first 3 steps r ok. rfc destination and test connection and remote logon is ok. in step 4 ..i assigned a message type(cremas) to the modelview.when i expand

  • PSE 4.0 - HTML-Galerie - Galeriestil

    Ich möchte mit PSE 4.0 eine HTML-Galerie erstellen. Solange ich den Galeriestil "Einfach" auswähle funktioniert das auch und die HTML-Dateien werdem im angegebenen Verzeichniss erzeugt. Wähle ich aber einen anderen Stil aus funktioniert das ganze nic