Disclaimer and License

Opinions expressed here by Tim Tripcony are his own and not representative of his employer.

Creative Commons License
Tip of the Iceberg is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at timtripcony.com.

Unless otherwise explicitly specified, all code samples and downloads are copyright Tim Tripcony and licensed under Apache License 2.0.

Search

What the Quote?

"It's an enzyme that keeps you from farting when you eat chili."

Devin Olson

"I've always wanted to say, 'Paris is burning", and have it be true."

Jennifer Holland

"The sun's coming out... sort of. The fog is a lighter blue."

Laura Tripcony

« SSJS is a crutch | Main| Taking the scary out of Java in XPages: knowing the entry points »

Taking the scary out of Java in XPages: Prologue

Category java xpages
The discussion following my last post made stark the need for greater availability of information that makes the nature of Java more accessible to Domino developers. Credit for the title of this post goes to Declan, who is considering writing a series of blog posts on this topic. I will be doing the same; hopefully there will be a fair amount of duplication. As David Leedy is fond of stating, it's a good thing when several people share the same information, because that makes it easier for the people who need it to find it. And that's what's missing: an easy path to using Java in XPages.

My hope is to answer three questions:

When?

How?

What?

There's plenty of Why on my blog already. And I'm not the only one who's been advocating an increased use of Java in favor of other languages. But when does it make sense to define your business logic in Java instead of an alternative? In my opinion, that's the first question that needs to be more clearly answered. As several folks stated in the aforementioned discussion, if I simply tell you to use it for everything, that can be an intimidating answer. And, frankly, it's not realistic. At least, not right away. For most of you, the first time you directly make use of Java, it will be for a single use case within the context of an entire application that meets the users' needs via other means. Over time, you may find that you've reached a point where the majority of your code is written in Java. But that shift is likely to be gradual. And that's perfectly fine.

Suppose you've identified a specific use case for Java... now you need to know how to gain the benefits of Java just for that use case without impacting the rest of what your application does. Do you call Java classes that are already bundled with Domino? Or do you download a library that is entirely unrelated to Domino and call classes that are defined in that library? Or do you write your own classes entirely from scratch? Once you've decided, how do you actually do that?

Finally, it is crucial to know what the code needs to be. In time, you'll find that this is often the first question you'll be asking, not the last. And this entire process is recursive: as your exposure to Java increases, you'll become aware of the types of tasks it excels at, as well as the common programming problems that others have used it to solve; this will give you fresh opportunities to ask when it is appropriate to create a custom solution and when to just stand on someone else's shoulder, and to ask how to best integrate the resulting solution into your application and your broader Domino ecosystem.

I do understand that, for many, the prospect of learning Java seems difficult. I've been there too. My goal is to provide answers to these questions that demonstrate that XPages really do make it easy to put the power of Java to work for you. The truth is, it does this every day: XPages are Java... when we write code in any other language, we're just introducing another layer of abstraction that has to be translated back into Java anyway. And, if your experience is similar to mine, you'll find that the more that you discard those extra layers and just speak to the platform in its native tongue, the easier it becomes to do the very things that already feel difficult.

If the last 4.5 years have taught me anything about Domino, it's that when something I'm trying to do in XPages seems hard, it's because I'm fighting the platform somehow. Once I identify where I'm resisting it, where I'm not allowing it to be what it already is, whatever I was trying to accomplish instantly becomes easy. So if at times it seems like I'm disproportionately nonchalant, that's the reason. I'm not just hoping to convince you that Java is nothing to be afraid of, I'm hoping to show you just how easy it makes everything you want to do.

Comments

Gravatar Image1 - I like where you're going with this, Tim... I look forward to seeing how the series plays out in addition to what Dec and David add to the discussion.

Gravatar Image2 - Sweet. Circle time.

I am in

Gravatar Image3 - Tim, I cannot agree with you more. I find that the more I use JAVA the more I want to use JAVA. Also, the more I want to move out of DDE and stay in Eclipse. I think you have written about that. I'll have to go and dig it up. -- Jeff

Gravatar Image4 - Interesting topic. I know many developers who are at the entry point of using Java - and are reluctant. Look forward to see more of this Emoticon

/John

Gravatar Image5 - Looking forward to it.

Gravatar Image6 - Tim,

I'm look forward to your posts. I've been using java on a daily basis for about a year now. The language itself isn't something I've struggled with and there are loads of examples out there on the web to help solve the majority of problems....

Were I come unstuck is planning true oop architecture. Its easy enough to create a bean that does several different operations but creating several classes that inherit off each other and use concepts such as polymorphism is a shade more difficult. We've all seen those examples of 'Vehicle' is a superclass and class 'Car' and class 'Motorbike' both inherit from it. Putting real life problems into those concepts is much more difficult and having the confidence to know you've done it in the best way possible as well...

So any light you can cast on that subject would be much appreciated.

Gravatar Image7 - Sounds like an excellent plan. Previous attempts to make Java easy for Domino developers were always held back by the fact that Domino's (and the Notes client's) support for Java was, shall we say, less than stellar. Now you have a much better story to tell.

Gravatar Image8 - "If the last 4.5 years have taught me anything about Domino, it's that when something I'm trying to do in XPages seems hard, it's because I'm fighting the platform somehow"

THIS.

Gravatar Image9 - "If the last 4.5 years have taught me anything about Domino, it's that when something I'm trying to do in XPages seems hard, it's because I'm fighting the platform somehow"

I second Kathy. This bit of wisdom is one of the main keys to being a great programmer on any platform.

Gravatar Image10 - Ah, but for old-fashioned Notes client development "fighting the platform" is what people are used to, because it's pretty much all there is.
Emoticon

Gravatar Image11 - Thanks Tim
Looking forward the read this series

Gravatar Image12 - This is definitely one of the best articles I have read in this website! Thanks Mate.
<a href="{ Link } training in Chennai</a>

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)