Results 1 to 6 of 6

Thread: Advantage of events in java

  1. #1
    Join Date
    Mar 2010
    Posts
    222

    Advantage of events in java

    Hello,
    I have a question running through my mind for a moment. I have yet to read a text speaking of Java beans and the notion of event. But I do not understand the advantage of using events, listeners and all the syntax that goes with it. It changes in relation to what is to simply use interfaces and a Vector of objects that implement this interface? It's faster and cleaner to just use the java-beans? Or the events are necessary.

  2. #2
    Join Date
    Nov 2009
    Posts
    518

    Re: Advantage of events in java

    Hello,
    I'm not sure I understand what you mean by talking about interfaces and vector objects, but events on the JavaBeans used mainly to provide a universal and standardized way to monitor changes in properties of a bean. Of course you can emulate it through your own interfaces, but this is not universal. In fact, the concept of JavaBeans and listeners who are mostly designed with the ides and other similar tools, where interoperability is a definite asset.

  3. #3
    Join Date
    Nov 2009
    Posts
    347

    Re: Advantage of events in java

    Hello,
    In terms of frameworks and everything else, the rule seems to me the best is that if I do not understand what it is, I do not use it. However, in the case of listeners, this may be useful. It depends a little of your programming habits, for running a listener is often done with an ArrayList (modern equivalent of the Vector) and an interface so we are very close to your plan for you, and may you to do the listeners unawares.

  4. #4
    Join Date
    Nov 2009
    Posts
    359

    Re: events and listeners in java

    Hello,
    I agree with the above post. The beans are also a concept so broad that one can think that whenever there is a set and get somewhere, it was a bean. So you use beans without knowing it. If you showed us one of your typical achievements (especially short), maybe we could assess whether there is something to which side you pass completely. I hope this information will help you.

  5. #5
    Join Date
    Nov 2009
    Posts
    583

    Re: Advantage of events in java

    Hello,
    It is a way to code, you must not let you unmount those who speak only of framework / design pattern etc. It sets out ways to make the structures already established that we can always recognize as such. This is by no means a requirement, we can do without. The set / get listener and I use it even more when, clean code, and it makes the classes more independent. It still has the right code as you want, all ways to be advantages and disadvantages.

  6. #6
    Join Date
    Nov 2009
    Posts
    446

    Re: Advantage of events in java

    Hello,
    I know that I use for form bean get / set, which is very natural and satisfying to affect the function and read. At first I did differently, but I ended by saying that it was not really better, and that was even worse. So I turned everything, and everything again. For cons, I never use the events as beans, through the PropertyChangeListener I found this approach to shit (it requires to create a string identical to the name of each property!), And each Once I make listeners, I create my own interfaces, my own events, and try to see.

Similar Threads

  1. Advantage of getting GTX 680 FTW 4gb over 2gb?
    By Nguni in forum Monitor & Video Cards
    Replies: 2
    Last Post: 10-05-2012, 06:44 AM
  2. Advantage of static_cast
    By Juaquine in forum Software Development
    Replies: 4
    Last Post: 08-02-2010, 05:46 PM
  3. How is Advantage Database Server
    By MaggieK in forum Software Development
    Replies: 5
    Last Post: 05-02-2010, 01:47 AM
  4. What is the advantage of TDK LTO?
    By Nalini_sh in forum Hardware Peripherals
    Replies: 3
    Last Post: 26-11-2009, 04:19 PM
  5. Wat is Advantage over B.com(MM)?
    By Saranbalaji in forum Education Career and Job Discussions
    Replies: 4
    Last Post: 30-07-2009, 10:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,791,025.34955 seconds with 16 queries