NetBeans API Video Tip 1: Decoupling via Lookup.Provider

A small video with a NetBeans API tip. You'll not get much out of it if you're new to the NetBeans Platform, it's intended for slightly more advanced developers.

What do you think of it? Hoping to create more such small tips and interested in any feedback on this one.

Source code used in the sample can be found here:

http://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.1/tutorials/CapabilitySample

A related article is here:

http://netbeans.dzone.com/loosely-coupled-reloadable-capabilities

Hm, the video seems to be a bit blurry, not in the original, but after it was uploaded to blip.tv.

Comments:

I would certainly like to see more short videos on such tips and tricks. This one is well titled, short enough to deliver the complete concept, and the links point me to far more detail should I be further interested. BTW, nice use of composition using the ic to store capabilities.

Posted by Jeff on December 19, 2011 at 04:43 AM PST #

Nice tips.
I think the dynamic "capabilities" are very suitable for mashup and service-oriented applications where the capabilities depend on underlying service implementation.

For conventional apps, I think it is more maintainable to just have a method reload() in CustomerLookupProvider :)

Posted by huionn on December 19, 2011 at 03:34 PM PST #

Thanks a lot, I started learning Netbeans platform a few days ago, and I'm still quite confused with how to design an application made of independent modules. But this kind of screencasts helps a lot :)

My suggestion for your next tutorial : rather than presenting at code-level how to solve a particular case, I'd love to see some graphical schemas of the relations between modules in a very simple and typical application.

Then, having understood the general aspects, looking at the code would be much easier.

Posted by Red on December 21, 2011 at 11:51 AM PST #

Hi Red, there are dozens of tutorials that can help you understand how to design an application made of independent modules. I advise to start with the NetBeans Platform Fundamentals section here:

http://netbeans.org/kb/trails/platform.html

Posted by Geertjan on December 21, 2011 at 06:26 PM PST #

Hi, thanks for your reply.

Of course I've already done those tutorials (even twice), but I'm still a bit disoriented since most of those tutorials are quite concise (they do one very specific thing). It's not that easy for beginners to use that knowledge in a "real case".

I've drawn a little schema to explain something I'd love to achieve. It seems to me that if I understood Lookups well, it would be very simple, which leads me to thing that I don't understand Lookups very well.

The example would be an ultra-simple vector drawing application, where you can draw circles and lines... The vector part of the problem is not important, it's just "another way to look at my data than a list".

http://red.uvauvb.com/stuff/nb/schema.jpg

(Don't misunderstand me : I'm not asking you to solve my particular problem, just explaining how beginners like me can be stuck. )

Posted by Red on December 22, 2011 at 06:17 AM PST #

Really? Do the tutorials explain one very specific thing? That's simply not true. What about the CRUD tutorial? And the four part selection series? They explain pretty much everything within a single tutorial. I think you should read those, work through them step by step, and then you'll have what you need. Drop me an e-mail (AFTER doing both those series of tutorials) at geertjan dot wielenga at oracle dot com and we can talk further about your specific needs. Courses are also offered, drop me an e-mail for further details.

Posted by Geertjan on December 22, 2011 at 06:24 AM PST #

PS: Once you've done the selection tutorials and the CRUD tutorial, you'll have everything you need to create the application represented by your schema.

Posted by Geertjan on December 22, 2011 at 06:26 AM PST #

Hi again !

I'm sorry to have bothered, I think I was just a little too impatient...
Right now I'm begging to understand how to work with Lookups : I just managed to do a part of what I was trying to do... :) It really is powerful !

I was a bit overthinking what a Lookup is. I guess the best way to understand them is to think of them outside of the context of intermodule communications. Once one has well understood what they are and what they are capable of, it's easier to understand how they can be useful for intermodules communications.

Still, for my defense, it's still quite hard to grasp all those concepts at once.

Well, thanks anyway for your time ! And also for your blog which I'll soon be capable to fully understand :)

Cheers and merry christmas !

Olivier

Note A :
I haven't done the CRUD tutorial yet since there seems to be no sample database included here (though I'm running NetBeans 7.1), which makes the tutorial hard to follow.
Note B :
By "doing a specific thing", I meant "doing a lot of different things, each in one precise way". Which has the advantage of being concise and going quickly to quite advances functions, but the disadvantages for beginners of being a little bit harder to understand.

Posted by Red on December 22, 2011 at 10:02 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today