Question about bridge pattern

its definition is "decouple an abstraction from its implementation so that the two can vary independently". I don't understand what "abstraction and the implementation vary independently" really mean and how .
Before another question pls see the below class diagram of bridge pattern:
http://images.cnblogs.com/cnblogs_com/zhenyulu/Pic91.gif
My question is whether not using abstraction and just keeping implementation hierarchy can do the same thing? Interface and its implementation itself(polymorphism) can make extending easily and be well subject to open-closed principle,can't they?
Sorry for my bad English.
Edited by: fxbird on 2011-7-17 上午5:13

fxbird wrote:
jschell wrote:
fxbird wrote:
I think it's very common in j2ee development. Certainly isn't if someone is using a container.
If someone is creating a container then I would suspect that such a pattern might be useful.
However if someone is creating a container then there are going to be a lot of useful patterns. And lot of classes as well.
And in total of the entire scope of creating a container the bridge would be a very small part.
So it certainly isn't going to be "common".Hello jschell , what do you mean by 'container'? You phrased your comment about J2EE. A common idiom is to refer to a J2EE (actually newer name is JEE) server as a JEE container. Not sure why specifically that word is used but maybe because such servers are said to 'contain' applications.
In my previous reply, the architecture I mentioned is ss(spring+struts2.x),the pattern I mentioned is a standard way. You either do not understand what I said or you do not understand what happens in those implementations.
If I have 100,000 classes and 3 of them are implementing the bridge pattern then it is not "common".
If I have 100,000 classes and 3,000 of them implement many bridge patterns (and not generated) then one could say it is "common".
And having done some JEE applications I seriously doubt there is an implicit need to use the bridge pattern.
The bridge pattern is intended to deal with a complex situation. Since there are more simple JEE applications than complex ones then it seems unlikely that there is a "common" need for it in JEE applications.
Actual I've not been understood why it's used this way---define business interface, from my perspective, it doesn't have to define it, simply writing a business class and calling dao method is enough. I assume bo interface thing is a bridge pattern.I don't know why they would use the bridge pattern nor even if they really do. I wouldn't be surprised that it is used and I can also suppose that the use would be a good idea. Although it is quite possible as well that it is used incorrectly in some places.

Similar Messages

  • 2 questions about bridge cs6 is always the rotate lossless? and high quality on demand

    Hi
    about bridge cs6 the rotate buttons rotate 90° counter and 90°clockwise is lossless ? i mean without loss of quality ?
    and my i know the meaning of high quality on demand? might someone make an example?
    thanks a lot

    That's why I have never bothered to conduct such a test.  A complete waste of time, in my opinion.
    I would not put it that way because it always interesting to what extend users like to go or come up with for testing
    But in basic, yes you are right. If you need such extreme test to proof the theory wrong the practice still is a winner. If you can't see it with your own eyes it is not really important but to fill an academic paper. In real life neither you, nor the customer or viewer would notice any difference
    According to the discussion about jpeg vs Raw, of course Raw has a ton of benefits above jpeg. Personally I almost never shoot jpeg but I do know people that do to satisfaction.
    Suppose you are a sports photographer and need both speed in writing to the card as in post process etc. You are working under know and solid light conditions and have measured your wight balance and set it manual. This provides very good qualities (that is if you have set the jpeg quality to high or max in camera) and shot with a recent good dSLR it produces files that can be published without problems on a magazine spread.
    I can't see disadvantage for such situations. However, you have to be aware that for future use your options are still limited when deciding to change post processing. Color temperature, exposure etc etc are far more flexible with Raw then jpeg.
    The vast majority of my clients want jpeg and that is what I convert to when files are ready. Yet I keep my original DNG and PSD file.
    Especially the archived Raw (in my case since 2008 converted DNG from CR2 files) is important. I can't tell you how surprise I am every time I open a raw file from 10 years ago in todays Raw converters. They have been improved very much and are able to get more out of your old files then you ever could imagine.
    And to finish with an other plus side of Raw. If you need to enlarge old and new raw files to huge billboards you will discover that the results of the Raw are far more superior

  • Questions about DAO pattern

    Hi,
    I am a junior programmer and I am trying to understand somewhat more about best practices and design patterns.
    I am looking for more information regarding the DAO pattern, not the easy examples you find everywhere on the internet, but actual implementations of real world examples.
    Questions:
    1) Does a DAO always map with a single table in the database?
    2) Does a DAO contain any validation logic or is all validation logic contained in the Business Object?
    3) In a database I have 2 tables: Person and Address. As far as I understand the DAO pattern, I now create a PersonDAO and an AddressDAO who will perform the CRUD operations for the Person and Address objects. PersonDAO only has access to the Person table and AddressDAO only has access to the Address table. This seems correct to me, but what if I must be able to look up all persons who live in the same city? What if I also want to look up persons via their telephone numbers? I could add a findPersonByCity and findPersonByTelephoneNumber method to the PersonDAO, but that would result in the PersonDAO also accessing the Address table in the database (even though there already is an AddressDAO). Is that permitted? And why?
    I hope someone can help me out.
    Thanks for your time!
    Jeroen

    That is exactly what I am trying to do. I am writing it all myself to get a better understanding of it.
    Please bear with me, because there are some things I dont understand in your previous answer.
    1) Each BO validates his corresponding DTO and exposes operations to persist that DTO. Each DTO will be persisted in the database via his corresponding DAO. So this would be:
    - in PersonBO
    public void save(PersonDTO personDTO) {
    this.validate(personDTO); // does not validate the nested address DTOs
    this.personDAO.save(personDTO); // does not save the nested address DTOs
    - in AddressBO
    public void save(AddressDTO addressDTO) {
    this.validate(addressDTO);
    this.addressDAO.save(addressDTO);
    Am I viewing it from the right side now?
    2) Imagine a form designed to insert a new person in the database, it contains all fields for the Person DTO and 2 Address DTOs.
    How would I do this using my Business Objects?
    This is how I see it:
    // fill the DTOs
    daoManager.beginTransaction();
    try {
    personBO.setDao(daoManager.getDao(PersonDAO.class));
    personBO.save(personDTO); // save 1
    addressBO.setDao(daoManager.getDao(AddressDAO.class));
    addressBO.save(personDTO.getAddress(1)); // save 2
    addressBO.save(personDTO.getAddress(2)); // save 3
    daoManager.commit();
    catch(Exception e) {
    daoManager.rollBack();
    If I insert the transaction management inside the DAOs, I can never rollback save 1 when save 2 or save 3 fail.
    It can be that I am viewing it all wrong, please correct me if that is the case.
    Thanks!
    Jeroen

  • Question about design pattern - business delegate

    hi guys
    i have got a question to ask about the delegate pattern. usually, we use it to decouple between presentation client and businessservice tiers. for instance, the service tier has an session ejb, and delegate wrapps the ejb. and the web client calls delegate to access service. is the delegate only used by the presentation tier? within the service tier, we can have many ejbs that work together to get tasks done. do we still use delegates in the service tier? what is ur suggestion? thanks

    Try the Patterns and OO Design forum.

  • Question about design pattern - business delegate: repost

    hi guys
    i have got a question to ask about the delegate pattern. usually, we use it to decouple between presentation client and businessservice tiers. for instance, the service tier has an session ejb, and delegate wrapps the ejb. and the web client calls delegate to access service. is the delegate only used by the presentation tier? within the service tier, we can have many ejbs that work together to get tasks done. do we still use delegates in the service tier? what is ur suggestion? thanks

    thanks, but i don't think i follow what u said.
    bascially i was asking if it was still a good idea to use delegates to communicate between ejbs the same way presentation tier calls service tier. i.e. SessionEJBA calls DelegateB to access SessionEJBB. or SessionEJBA calls SessionEJBB directly including the lookup, etc.

  • Question about commond pattern

    Hi!
    can somebody tell me about any good resource where i can get knowledge of designing controller on basis of command pattern and an example will help me a lot....
    I want to develop a controller for my application which except's data from swing client and calls the appropriate business components (session beans) to perform the requested task , asked by customer.....
    Also i need to design Factories for my objects and need good resource to get started from....
    thanx in advance
    sajjad ahmed paracha

    Also take a look at Struts on apache.org. You can either use Struts directly or, if you want to develop your own, look at how they architected things as a starting point.
    - Saish

  • A question about bridge mode

    I have a DSL modem which is set to distribute IP addresses. Wireless network is off.
    A Time Capsule (connected to DSL modem by Ethernet) which is in bridge mode and creates the wireless network.
    Question: should I be able to connect to Internet through a Ethernet connection at the Time Capsule?
    thanks
    Ken

    I would first verify that the Time Capsule is setup as a bridge as follows:
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click Manual Setup
    Click the Internet icon
    Connect Using = Ethernet
    Connection Sharing = Off (Bridge Mode)
    If all appears to be well, try connecting the ethernet cable from your gateway to one of the other ports on the Time Capsule. In other words, if you have it connected to the WAN port (circle icon) now, connect to one of the other three LAN <-> ports.
    Truth be known, when the Time Capsule is setup in bridge mode, all the ports behave the same. It does not matter which you use. If the WAN port has taken a hit from a nearby lightning strike or a power surge, the other 3 ports may still be operational.
    Any luck?
    Message was edited by: Bob Timmons

  • Copyright Question about Adobe Patterns

    I have created illustrations for a book and am using Adobe Photoshop Elements to "color in" my drawings. In addition to the patterns which came with my program, I have downloaded patterns from Adobe Exchange. How would you suggest I reference/give credit to Adobe in my publication since these patterns are under copyright protection?

    Unless you sell it as your own creation (that is the pattern template/ swatches, not the result), the usage of provided content is covered in the EULA. No need to make any extra mention of specific stuff beyond perhaps a generic © Adobe for the relevant parts. For third-party content that may be different, but you should find the relevant info from the authors there...
    Mylenium

  • Question about DAO pattern

    Greetings.
    If I'm using EJB's in my application when does DAO fits in?? I mean, it is DAO an alternative to EJB's or a complement ??
    Thanks in advance.

    DAO fits in if you are using entity beans using bean managed persistence. In this case, the DAO brokers the database calls during the EJB's lifecycle. The other instance when you would use DAO would be if you forgo entity beans altogether. In this model, stateful or stateless session beans would use DAO's to broker the database calls directly, outside of the normal entity bean lifecycle. The DAO pattern can also be used with POJO's (plain 'ole Java objects).
    The only instance where DAO would not apply is in the case of a container managed entity bean. In this case, there is no need to write a DAO, as the container will persist the bean for you.
    - Saish
    "My karma ran over your dogma." - Anon

  • Question about ServiceLocator pattern

    Hi,
    I was wondering what would be the most approproate way to modify the serviceLocator pattern (from the core j2ee patterns book) to handle multiple initialContext? I.e, how do I modify the ServiceLocator to get the home from multiple remote servers?
    Do I get the client to pass in the InitialContext to be used?
    If I cache the homes - what should you use as the key? I.e. what can uniqeuly identify an InitialContext?
    Cheers,
    Nim

    An InitialContext is probably uniquely identified by the provider URL. I'd rather set up some kind of mapping, though, so that you just say "service this" and "service that", and the ServiceLocator, through configuration info, figures out what JNDI service to lookup as well as what to ask for.

  • [SOLVED] Question about Bridge Interface in VirtualBox

    Hi,
    So I use bridge interface option in VirtualBox opposed to the default NAT one.
    From what I see, the two interfaces(original one and bridged one) are isolated, such that the guest OS cannot intercept traffic of host OS and vice versa, is that correct?
    Cause I cannot see the interface bridged by VirtualBox in host OS and cannot see the actual interface in guest OS.
    Thank you.
    Last edited by darrenldl (2013-09-12 02:30:39)

    I'm not sure what you mean by isolated, do you mean that the guest machine won't be able to communicate with the host system? I don't think that the case. I'm not an expert on this myself and it's a bit of a blind man describing an elephant, but from what I understand a bridged interface acts as an independent host on your network. As far as any other machine is concerned, the guest and host are 2 machines. Are you able to ping the host os' ip from the guest machine? If you are able to ping across, then they are sharing the same network segment. This means if you want the bridge to not be able to see what's going on on your network, you'll have to use some firewall or subnet tricks to get that to happen.

  • AEBS 802.11n question about bridging

    using AEBS 802.11n and connecting to an existing network which is using DHCP...
    internet button chosen
    internet connection panel chosen
    connect using : ethernet
    configure ipv4 : using dhcp
    ethernet wan port : automatic (default)
    connection sharing : share a public ip address
    is the AEBS acting as a bridge here? so, now the AEBS can pass out ip addresses that are different (local) network addresses than what the AEBS is receiving from the established network, which it is joining?? the established network 192.168.1 the AEBS DHCP network 10.0.1
    internet button chosen
    internet connection panel
    connect using : ethernet
    configure ipv4 : using dhcp
    ethernet wan port : automatic (default)
    connection sharing : Off (bridge mode)
    or...
    the AEBS is acting as a bridge here? (off (bridge mode)) can the AEBS pass out ip address using a different network address here? and if it does so there will be no NAT functionality?
    what does it mean to have DHCP functionality and no NAT. does using DHCP and no NAT mean that each computer, on the local network connected to the AEBS, that segment, must have a static address?

    In your first configuration, where connection sharing = share a public IP address, the AEBSn is still acting as a wireless router and, effectively, has created a second wireless subnet.
    In the second configuration, where connection sharing = Off (bridge mode), the AEBSn is "passing thru" the NAT/DHCP services from the router it's connected to so any devices connected to the AEBSn will still be on the same network as the upstream router.

  • A question about singleton pattern

    Will a singleton instance be a bottleneck of an application when many client address this instacne?
    and How can I do to deal with this problem?
    help me!

    Unless the singleton has synchronized methods or blocks of code that are synchronized there should be no bottle neck, as multi threads can access it at the same time.

  • Can someone help me clarify a bridge pattern?

    So I have this qualm about bridge patterns. A professor I have is telling me I should never be doing switch statements in my driver if I'm using bridge patterns (except for at object creation), but I think he's wrong and I want to clarify when I think you're going to have to use one of two faux pas.
    Let's take a look at the good old Shape example. So we have a Square and a Circle and we want them to be able to draw themselves. The square uses two points (top left, and bottom right let's say) to draw itself and the Circle uses a center point and a radius to draw itself. It's obvious we need a switch statement at creation to determine which one we're making. My question then comes in, what about when we edit it? Let's say we want to change the points in the rectangle or the point/radius on the circle. We'd either need to do one of two things:
    a) if we put our editShape function in our driver class, we'd have to do a switch to see what type of shape we're editing before we can find out if we need to get input for two points or if we need to get input for a point and a radius length, and then pass that to our edit functions within the objects themselves.
    b) the other option requires we have both objects contain an editShape function (which would probably be an abstract method within Shape that we'd override) and each object would implement them different. Within this function, the object itself is displaying prompts and getting input.
    A is clearly not the right choice, because it results in high coupling and we're having to switch on our objects and we'd have to change the code every time we add new shape classes. B makes sense because we can just call Shape.editShape() from the driver and depending on which type it is it will ask for the proper input from within the object. However, I thought it was bad practice to have input (specifically prompts and scan reads) from within an object.
    Is this where the bridge class comes into play? For example, would I have a ShapeIO class (which could then have an extended ShapeIOConsole class possibly vs a ShapeIOFile class that would read input from a file?) that would contain the prompting from there? And then that class would handle all possible inputs I'd be prompting for?
    E.G. ShapeIOConsole.getPoint() would have the scanner and prompting calls and would return a Point while my Shape.editShape for Square would just call ShapeIO.getPoint() (assuming I have a ShapeIO object within Shape that's been instantiated as a ShapeIOConsole object) to get two points and my Shape.editShape for Circle would call a ShapeIO.getPoint() and a ShapeIO.getRadius? This would mean anytime I have a new Object that has a new type of property to get input for, I'd have to add a function to my ShapeIO, right?
    Anyways, I hope that made some sort of sense. I guess my question is am I correct in most of what I said, if I even said it clear enough for anyone to understand it ^^.

    benirose wrote:
    Thanks for your reply lance! I have a few responses if it's not too much trouble:None at all.
    >
    >
    >>
    That isn't obvious to me at all. Why do you need a switch?
    I would assume you need a switch statement because you need to know what constructor to call, right? For example if you have Shape myShape, wouldn't you need to determine if you're instantiating that as a Square or Circle? I mean you could do it with if statements and not a switch, but you'd need to conditionalize (is that a word?!) the creation, correct?Presumably something has caused the need to instantiate a particular shape. Let's suppose that the action that caused it was that a user pressed a button on a GUI. Now presumably there is a button for a new circle and another button for a new square. Each of these buttons can have their own event handler. The event handler for the 'New Circle' button can instantiate a new circle (or call something else that does it) and the event handler for 'New Square' can instantiate a new square (or call something else that does it). Where does the conditional logic come in?
    It could be that your user interface is a text based list of items to create, and the user has to type a number to choose. In this case, you might need to do some conditional logic, yes.
    Of course there are times when context is not given or insufficient. Often at the fringes of systems, when interacting with other systems, you need to determine what kind of message you've been given before processing it. But even then, there are usually better ways than lots of conditional logic (dispatch tables, for example).
    Having said all of that, I have worked on a system where a GUI had something like 150 different buttons / menu items / other things that could cause actions to occur. The original developer had decided to give each of these things a number so that he could save himself the bother of creating a new ActionListener or whatever for each item, and routed every action through the same switch statement to try to recover the information he'd just thrown away. Bizarre.
    >
    >>
    You could use a visitor rather than doing a switch.
    I don't really know much about the visitor class, but I'll give it a look.
    I assume you mean 'from within a "domain model" class'. I think the bad practice you're referring to is the failure to separate model concerns from view concerns (or, more generally, the failure to separate the concerns of different domains).
    Yeah, I suppose so. I just don't see many classes asking for it's own input, you usually pass it from the driver class. There's no editString() function which asks for input of a new string, you do that in the driver and then set the new string.Try not to think in terms of a 'driver'. This suggests procedural thinking. Think instead of a collaborating eco-system of objects where one object may delegate to another to do some work on it's behalf. The delegator may, when delegating, also give the delegate something that it might find useful to do its work (such as a means of obtaining data or something that it can further delegate some of the work to). If you do it right, the delegate only sees an abstraction appropriate to its place in the eco-system, behind which could exist any number of implementations. If you're just starting out, this may seem a bit heady. Don't worry about it, it'll come...
    >
    >
    >>
    I wouldn't necessarily do any of it this way; I'm only trying to address your question about Bridge. It probably is a good idea to go and talk to your professor again. If you do, come back here and tell us what he said...
    Yeah, I'm not sure I'd do it this way either, but the assignment is a Survey taking program, and the basic implementation was to have an abstract Question class which has a two level inheritence tree of MultipleChoice, Essay, and Matching inheriting from Question, and TF, Short Answer, and Ranking inheriting from MC, Essay, and Matching respectively. So our Survey class would have a Vector of Questions, which is fine, but he said we couldn't do any conditioning to see what type of Question we have, and that we should just be able to make calls to abstract functions in Question that will handle everything.It sounds like he's trying to get you to put behaviour into the Question subclasses, rather than having it in the Survey (i.e. to do what I said above :-). This may feel a bit strange at first, and you might be saying to yourself 'I thought OO was supposed to model the real world, but a question doesn't do anything in the real world'. One of the core concepts in OO is that if you find yourself doing something to an object in the real world, then ask the object to do it for you in your model. That way, system intelligence gets distributed evenly throughout your model.
    You do run into odd issues though. For example, in a library, suppose you have a book and a bookshelf. Supposing the book has just been returned to the library, should the book now goBackToShelf(), or should the shelf receiveBook(). It might even be both under some circumstances. It could also be neither, if you decide that a Librarian is part of your model. But be careful about doing that. You could get all of your behaviour concentrated in the Librarian with everything else in the system being dumb containers of data (some might argue that would be a good thing).
    >
    On a side note, I know if you type a variable with the abstract class (E.G. Question) and then instantiate it as an inherited class (E.G. MC), you can only make calls to the abstract functions (at least Eclipse tells me so). Is it the same way with an interface? What if my Question class wasn't abstract, then I should be fine, right?You can only make calls to the methods declared by Question and it's supertypes (it doesn't matter whether those methods are abstract or not). This is the same for interfaces and it would also be the same if Question was not abstract. The reason is that when you have a declaration like this
    Question question;you are defining a variable called 'question' of type Question. The only things you can ask 'question' to do are those things that its type knows about, which are the methods declared by Question and it's supertypes. The fact that 'question' refers to an object of some subclass of Question doesn't matter. All that matters is the type of the variable, which is Question.
    Regards,
    Lance

  • Questions about ActiveX Bridge and SWT

    Hi !
    I found few weeks ago the www.reallyusefulcomputing.com site answering my question about Java & Macro of MSWord. Now I've found two steps that I am not able to overcome.
    First, when I build a simple application and I have internal libraries to use, am I compelled to place the jars in the lib/ext directory of the Java Runtime Directory? I have many difficulties in placing a convenient class-path in the manifest file. Why does the application ignore the manifest string?
    The second problem (and the biggest one) is that I am trying to build an SWT java-bean-application but I have problems during runtime. Is it possible to use this technology for my software or am I compelled to use AWT and SWING?
    I really hope you can help me.
    Thank you in advance.

    hi,
    I have to catch events from excel sheet in my java code..events like some change in value or a click of some user defined button etc.I have written th follwoing code but it does not gives me any event.It simply opens the specified file in the excel in a seperate window.but when i click on the sheet or change some value no event is captured by my code....can ne one pls tell me how to go about it....
    public class EventTry2 {
         private Shell shell;
         private static OleAutomation automation;
         static OleControlSite controlSite;
         protected static final int Activate = 0x00010130;
         protected static final int BeforeDoubleClick = 0x00010601;
         protected static final int BeforRightClick = 0x000105fe;
         protected static final int Calculate = 0x00010117;
         protected static final int Change = 0x00010609;
         protected static final int Deactivate = 0x000105fa;
         protected static final int FollowHyperlink = 0x000105be;
         protected static final int SelectionChange = 0x00010607;
         public void makeVisible()
              Variant[] arguments = new Variant[1];
              arguments[0]=new Variant("true");
              //Visible---true
              automation.setProperty(558,arguments);
              //EnableEvent--true
              boolean b =automation.setProperty(1212,arguments);
            System.out.println(b);
             public Shell open(Display display){
             this.shell=new Shell(display);
              this.shell.setLayout(new FillLayout());
              Menu bar = new Menu(this.shell,SWT.BAR);
              this.shell.setMenuBar(bar);
              OleFrame frame = new OleFrame(shell,SWT.NONE);
            File file= new File("C:\\Book1.xls");
              try{
              controlSite =  new OleControlSite(frame, SWT.NONE, "Excel.Application");
              this.shell.layout();
              boolean a2=true;
              a2=(controlSite.doVerb(OLE.OLEIVERB_SHOW|OLE.OLEIVERB_OPEN|OLE.OLEIVERB_UIACTIVATE|OLE.OLEIVERB_HIDE|OLE.OLEIVERB_PROPERTIES|OLE.OLEIVERB_INPLACEACTIVATE)== OLE.S_OK);
              System.out.println("Activated::\t"+a2);
            }catch(SWTException ex)
                 System.out.println(ex.getMessage());
                 return null;
              automation = new OleAutomation(controlSite);
              //make the application visible
              makeVisible();
              System.out.println("Going to create Event listener");
              OleListener eventListener=new OleListener(){
                   public void handleEvent(OleEvent event){
                        System.out.println("EVENT TYPE==\t"+event.type);
                   switch(event.type){
                   case Activate:{
                        System.out.println("Activate Event");
                   case BeforeDoubleClick:{
                        System.out.println("BeforeDoubleClick Event");
                   case BeforRightClick:{
                        System.out.println("BeforeRightClick Event");
                   case Calculate:{
                        System.out.println("Calculate Event");
                   case Change:{
                        System.out.println("Change Event");
                   case Deactivate:{
                        System.out.println("DeActivate Event");
                   case FollowHyperlink:{
                        System.out.println("Activate Event");
                   case SelectionChange:{
                        System.out.println("Activate Event");
                        Variant[] arguments = event.arguments;
                        for(int i=0;i<arguments.length;i++)
                             System.out.println("@@");
                             arguments.dispose();
              System.out.println("outside");
              OleAutomation sheetAutomation=this.openFile("C:\\Book1.xls");
              controlSite.addEventListener(sheetAutomation,Activate,eventListener);
              controlSite.addEventListener(sheetAutomation,BeforeDoubleClick,eventListener);
              controlSite.addEventListener(sheetAutomation,BeforRightClick,eventListener);
              controlSite.addEventListener(sheetAutomation,Calculate,eventListener);
              controlSite.addEventListener(sheetAutomation,Change,eventListener);
              controlSite.addEventListener(sheetAutomation,Deactivate,eventListener);
              controlSite.addEventListener(sheetAutomation,FollowHyperlink,eventListener);
              controlSite.addEventListener(sheetAutomation,SelectionChange,eventListener);
              shell.open();
              return shell;
         public OleAutomation openFile(String fileName)
              Variant workbooks = automation.getProperty(0x0000023c);//get User Defined Workbooks
              Variant[] arguments = new Variant[1];
              arguments[0]= new Variant(fileName);
              System.out.println("workbooks::\t"+workbooks);
              IDispatch p1=workbooks.getDispatch();
              int[] rgdispid = workbooks.getAutomation().getIDsOfNames(new String[]{"Open"});
              int dispIdMember = rgdispid[0];
              Variant workbook = workbooks.getAutomation().invoke( dispIdMember, arguments );
              System.out.println("Opened the Work Book");
              try {
                   Thread.sleep(500);
              } catch (InterruptedException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              int id = workbook.getAutomation().getIDsOfNames(new String[]{"ActiveSheet"})[0];
              System.out.println(id);
              Variant sheet = workbook.getAutomation().getProperty( id );
              OleAutomation sheetAutomation=sheet.getAutomation();
              return(sheetAutomation);
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Display display=new Display();
              Shell shell=(new EventTry2()).open(display);
              while(!shell.isDisposed()){
                   if(!display.readAndDispatch()){
                        display.sleep();
              controlSite.dispose();
              display.dispose();
              System.out.println("-----------------THE END-----------------------------");

Maybe you are looking for

  • Purchasing: Restriction of creation of PO's on the basis of buyer / user

    Hi, We are currently working on a requirement in which the business is expecting to restrict the buyers / users from creating Purchase Orders of some specific GL natural accounts. Is there any functionality using which we can provide lock / check on

  • How do I ingest files from an external drive?

    New to Prelude- I'm not able to locate, within the ingest dialog, the USB3 drive on which the files are located. I copied them from the DSLR (D600, mov wrapper.) I see my HD, just not the external. Am I missing something really obvious? Thanks. MBP 1

  • No new free iPhoto in OS X Mavericks?

    Just installed Mavericks, but . . . it did not come with the most recent update for iPhoto > the old version 9.4.3 is still on. And when checking in the App store: there is a cost of 13,90 € . . . Not really as promised or did something went wrong?

  • Adding columns to existing template layout?

    In the "Contemporary" Template, I would like to modify the Section Text layout in Portrait Mode. I would like to make the text box have 2 columns instead of 1. These options are greyed out, however. How do I go about doing this? Many thanks in advanc

  • Error migrating a 11.1.1.5 project to 11.1.2.1

    Hi. I'm migrating a Jdeveloper project 11.1.1.5 to the 11.1.2.1 version just like is explained here (http://download.oracle.com/docs/cd/E16162_01/install.1112/e17074/ojdig.htm#BDCIHDBA). Even when I migrate a blank project I got the following error t