Good learning resources for JNDI implementation (JBoss 5) - jndi

I have been working with JavaEE/EJB3 web apps for about half a year now. Until recently, I haven't had to touch a lot of the behind-the-scenes stuff, just the meat of the code. I have been wrestling with JNDI problems, and though I've solved a couple of them, I'm pretty much just doing the whole cargo cult copy-paste routine. It would really help me to better understand JNDI; my understanding of it right now can be summarized as "it's that thing these classes sometimes do to find other classes."
My question is, has anyone had success learning JNDI/EJB3/related topics from a book or online content? I've googled for it but the stuff that comes up is old or specific to a certain framework I'm not using. I'm looking for something that's either JBoss-specific or generic enough to be useful anyway.

Related

F# - Resources for learning it from scratch

I appreciate there are a few posts out there, asking about F# tutorials/learning resources, but so many of the questions (and answers) assume a somewhat established knowledge or experience in C# or programming generally.
While I HAVE engaged in some programming, it's been very bitty and over many years. What I'm looking for is an F# tutorial, or series of tutorials, that walks you through from the very basics (a "complete" program that prints "Hello World!"), and progresses naturally while still showing you the complete solution. Most resources I've found cut out most things and just say "this is how you'd do it in C#, and this is now F#", leaving out other elements that complete the solution to the problem.
EDIT: I found the free course on F Sharp TV (udemy course), but didn't like how it was always exploiting F# Interactive to demo the language, as opposed to building an actually complete application.
I am very new to F#. I just started picking it up this month and I have really enjoyed it so far!
I can really relate to your question because every book or tutorial I've found assumed a lot more knowledge than I had. I would open them up start reading and then 3...2...1...and I was completely lost.
I'm sure once I am better at the language the references that are usually listed will be obviously superior to what I'm about to recommend.
One book I've enjoyed is "Functional Programming Using F#". It starts from the very, very basics and provides information about the small things in F# that I otherwise would have missed. The best part are the exercises at the end of the chapters, because someone went through all of them and posted answers here: [1]. So you can struggle through the exercises and then get an idea of how someone else approached the problem! The main drawback of this book is that the examples can be math heavy at times.
The second book I've used is called "Friendly F#". I really have never seen it linked or talked about, but I have thoroughly enjoyed it. I have found the approach the author takes to be rather novel. Instead of showing me how to implement the Fibonacci sequence in F# for the bajillionth time the author starts with projects! Real projects where you can actually visualize things! For example, in the first chapter you create an F# script where you visualize a ball bouncing in a box acted on by gravity! I know real coders are probably more worried about the esoteric features of the language but as someone starting out it was super motivating to actually be able to visualize something and more importantly to have something to show to my wife so she won't think I'm just wasting hours doing nothing. 😁
The last thing I'll recommend is Excercism. It's a great website where the tutors give great feedback. The only drawback is that you need to have somewhat of an idea of what the language can do. For me, I wasted countless hours trying to solve one of the problems only to realize that there is something called Seq.zip which would have solved the problem instantly. So, I recommend sitting down with a problem thinking hard on it for an hour and then googling "fsharp excercism solutions insert problem name here". Luckily, you can navigate directly to the solutions page and go through hundreds of solutions that other folks came up with. That's how I learned forever what Seq.zip is.
EDIT:
I also wanted to add this video [2]. It's not going to teach you all you need to know about F# in one video. However, it will give you a great overview of the language so while you are learning it in more depth you have an idea of what the language is capable of.
I hope this helps!!
[1] - https://github.com/TorbenRahbekKoch/Functional-Programming-Using-FSharp
[2] - https://www.youtube.com/watch?v=c7eNDJN758U
As mentioned in the comments, some might think this answer can be seen as opinion motivated. I feel that those resources could be a good entry point to learning more about the language.
Reference: sachabarbs.wordpress.com/1406-2
Reference en.wikibooks.org/wiki/F_Sharp_Programming
Bonus: Getting started with F# in the cloud with Azure, take a peek at this awesome reference!
Reference: Getting started with F# with Azure Notebooks
I would recommend first fsharpforfunandprofit.com - clearly a big starting point. You have the complete. This is a great section to "thibk functionally". https://fsharpforfunandprofit.com/series/thinking-functionally.html
When you get used to the language (a little bit), I would recommend "Stylish F#" . It is a very recent well written book on good practices for beginners (but who can write a bit of F#). Really liked it.

Scale now or later?

I am looking to start developing a relatively simple web application that will pull data from various sources and normalizing it. A user can also enter the data directly into the site. I anticipate hitting scale, if successful. Is it worth putting in the time now to use scalable or distributed technologies or just start with a LAMP stack? Framework or not? Any thoughts, suggestions, or comments would help.
Disregard my vague description of the idea, I'd love to share once I get further along.
Later. I can't remember who said it (might have been SO's Jeff Atwood) but it rings true: your first problem is getting other people to care about your work. Worry about scale when they do.
Definitely go with a well structured framework for your own sanity though. Even if it doesn't end up with thousands of users, you'll want to add features as time goes on. Maintaining an expanding codebase without good structure quickly becomes fairly horrible (been there, done that, lost the client).
btw, if you're tempted to write your own framework, be aware that it is a lot of work. My company has an in-house one we're quite proud of, but it's taken 3-4 years to mature.
Is it worth putting in the time now to use scalable or distributed technologies or just start with a LAMP stack?
A LAMP stack is scalable. Apache provides many, many alternatives.
Framework or not?
Always use the highest-powered framework you can find. Write as little code as possible. Get something in front of people as soon as you can.
Focus on what's important: Get something to work.
If you don't have something that works, scalability doesn't matter, does it?
Then read up on optimization. http://c2.com/cgi/wiki?RulesOfOptimization is very helpful.
Rule 1. Don't.
Rule 2. Don't yet.
Rule 3. Profile before Optimizing.
Until you have a working application, you don't know what -- specific -- thing limits your scalability.
Don't assume. Measure.
That means build something that people actually use. Scale comes later.
Absolutely do it later. Scaling pains is a good problem to have, it means people like your project enough to stress the hardware it's running on.
The last company I worked at started fairly small with PHP and the very very first versions of CakePHP that came out (when it was still in beta). Some of the code was dirty, the admin tool was a mess (code-wise), and sure it could have been done better from the start. But do you know what? They got it out the door before their competitors did, and became extremely successful.
When I came on board they were starting to hit the limits of their current potential scalability, and that is when they decided to start looking at CDN's, lighttpd caching techniques, and other ways to clean up the code and make things run smoother when under heavy load. I don't work for them anymore but it was a good experience in growing an architecture beyond what it was originally scoped at.
I can tell you right now if they had tried to do the scalability and optimizations before selling content and getting a website live - they would never have grown to the size they are now. The company is www.beatport.com if you're interested in who I'm talking about (To re-iterate, I'm not trying to advertise them as I am no longer affiliated with them, but it stands as a good case study and it's easier for people to understand what I'm talking about when they see their website).
Personally, after working with Ruby and Rails (and understanding the separation!) for a couple of years, and having experience with PHP at Beatport - I can confidently say that I never want to work with PHP code again =p
Funny to ask "scale now or later?" and label it "ruby on rails".
Actually, Ruby on Rails was created by David Heinemeier Hansson, who has a whole chapter in his book labeled "Scale later" :))
http://gettingreal.37signals.com/ch04_Scale_Later.php
I agree with the earlier respondents -- make it useful, make it work and get people motivated to use it first. I also agree that you should pick off-the shelf components (of which there are many) rather than roll your own, as much as possible. At the same time, make sure that you choose components for your infrastructure that you know to be scalable so that you can go there when you need to, without having to re-write major chunks of your application.
As the Product Manager for Berkeley DB, I've seen countess cases of developers who decided "Oh, we'll just write that to a flat file" or "I can write my own simple B-tree function" or "Database XYZ is 'good enough', I don't have to worry about concurrency or scalability until later". The problem with that approach is that a) you're re-inventing the wheel (and forgoing what others have learned the hard way already) and b) you're ignoring the fact that you'll have to deal with scalability at some point and going with a 'good enough' solution.
Good luck in your implementation.

Which framework should a beginner pick for a twitter mashup?

I have this idea about a twitter mashup and I've been doing some research over the last couple of days regarding which framework to build it with. SproutCore looks really nice (especially as it has a UI designer too), then someone suggested Capuccino (I am not to keen to go with Objective-J, don't know why though). What do you think, stackoverflow-ians? (Note that it's going to be my first mashup attempt)
Really, it's too early to decide. They are both built on a strong foundation and have some great tools, but neither is complete or at that well documented. I've been tooling around with both on some small personal projects for a few months and there are parts of both that are great and parts of both that aren't. Its really up to personal taste and which community you think you'll want to be most active in.
The good part though, is that it shouldn't take you too long to get up to speed in either of them. I suggest you run through the tutorials on each page and just pick one and go with it. If it ends up not working out after a day or two, just switch. Even if you dont already know objective-c cappuccino's learning curve isn't that steep.
tutorials:
sprout core: http://wiki.sproutcore.com/Todos%C2%A0Intro
cappuccino: http://cappuccino.org/learn/tutorials/

How do you remember/organise Rails information to prevent wheel reinvention? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I love working with Rails but I keep tripping up against my own inefficiency: I'll spend time implementing some "useful" function only to discover subsequently that it was already in the framework, had I but known it!
Particular areas of wheel reinvention for me are
helpers and built-in class extensions
recently-released features that may not yet have lodged in my brain
plugins (a taxonomy of Rails plugins, if such a thing makes sense, would be a boon)
migration options
less-frequently used rake tasks
the options hash on just about everything
Obviously (?) we can't all remember all this stuff all the time. There are "cheat sheets", but unless they're up-to-date they can potentially compound the problem by appearing authoritative when they're really targeted at older versions.
What do you do to minimize this excise? Can anything be done?
I wondered if a set of Big Visible Charts might help, although goodness knows where I'd stick them in an open-plan office.
One thing here is to know about the existence of particular feature (plugin, gem, etc) in the first place. That's why
I try to keep up to date with the information about the edge Rails.
I follow many blogs and try to if nothing else then run over the titles every day, just to have it leave at least some tiny footprint in my memory.
That's for the passive part. Now for the active:
As I fly through the new features/plugins I try to imagine at least some use case in which it might be helpful in what am I working on right now - this exercise helps me to remember the thing, since I connect it to my actual conceptual system.
In my less serious projects I really try experiment with new things.
On SO I often answer questions I'm not sure about or I don't really know anything about but they seem interesting to me - then I do some research and extend my knowledge on that particular topic.
I don't think that "big visible charts" can help in the long run. I only use cheat sheets when learning new things and it's really only a short term thing. Exellence is a habit, as Aristotle said.
This isn't just a problem with Rails, but with any framework. Programmers I know who have worked for years with Delphi still are shocked to find simple standard functions that they'd replicated.
WRT Rails, Mike Gunderloy recently wrote about highlighting text, and ended with this wise tidbit:
It’s worth taking a dip into ActionView::Helpers occasionally to see what other bits of functionality are lurking that you’ve forgotten about.
Any time I need to do something I think should be easier than it is, I do a quick check there, as well as Google, to make sure I'm not about to waste a ton of time.
I face this problem as well- and it was a lot worse when I first started with RoR. Now after over 1.5 years, I know what's available pretty well.
Basically what I do is if I am using parts of the framework I know... no big deal. If I need to do something I will likely have to create myself, I first google it or search the Rails API. Lately I have also begun searching github and some of the plugin sites like railslodge.com.
While this does not completely solve the problem, it has helped dramatically.
I surf over the rails blogs in my RSS feed reading the headlines and just enough to figure out what the article is about. This gives me a good breadth of knowledge but pretty shallow. Still it lets me know what is out there. Like yesterday when I saw a blog post about a highlight helper (I had no idea it existed. Now I do and if I ever need it I know to look for it - even without reading the post in depth). I also open the posts I want read in depth in another tab for later (I used to use ReadItLater but it got out of hand) and as i read them i write notes in a post on my own blog more for my own benefit than for others - to get into memory and to ensure I can find it later.
The other thing I do when I am entering uncharted or forgotten territory is to I ask a question here about best practices or specific details even if I think I know the answer. For example I couldn't remember the names of the popular plugins for tracking edit histories of records (acts_as_audited and acts_as_versioned). I had the answer in 15 minutes.
It turns solo programming into programming in one of those cool noisy dev shops with a foosball table and lots of other people who know stuff i don't.
I tend to assume that most types of basic problems I'm solving have already been solved by someone else; by starting with the assumption my thoughts aren't along the lines of "how do I build this" but "where do I find it" and of course google, the wikis and the plugin and gems lists all play a part in that. I have written very little code that isn't directly related to my business domain.
I write tests first. Then code. Sometimes the framework does it for me and I don't have to write code. :)
I don't think Rails is any different than other frameworks... it takes a while to know where things are. The best you can do is read the API docs and see what's there. You don't need to learn how to use it, just what is there and get an idea of how to look for it when you need it.
Also, it's not a bad thing to write code that someone else already has. You learn from it. Later you just swap in the framework mojo and see if your tests still pass. If so, you're good and you know how the internals of one part of the framework probably work.
I believe the key to eliminate the time wasted on reinventing the wheel is to have a very handful tool to search inside the Rails helpers/capabilities.
On one hand a good choice of IDE could help a lot. On the other hand - a very good online (offline) edge documentation with an ability to quick search through it. These days one of our russian Rails programmers made one: http://railsapi.com/. The search is done in a very MacOS style, making it a very good choice for a fast diggin'.

How to approach learning a new SDK/API/library?

Let's say that you have to implement some functionality that is not trivial (it will take at least 1 work week). You have a SDK/API/library that contains (numerous) code samples demonstrating the usage of the part of the SDK for implementing that functionality.
How do you approach learning all the samples, extract the necessary information, techniques, etc. in order to use them to implement the 'real thing'. The key questions are:
Do you use some tool for diagramming of the control flow, the interactions between the functions from the SDK, and the sample itself? Which kind of diagrams do you find useful? (I was thinking that the UML sequence diagram can be quite useful together with the debugger in this case).
How do you keep the relevant and often interrelated information about SDK/API function calls, the general structure and calls order in the sample programs that have to be used as a reference - mind maps, some plain text notes, added comments in the samples code, some refactoring of the sample code to suit your personal coding style in order to make the learning easier?
Personally I use the prototyping approach. Keep development to manageable iterations. In the beginning, those iterations are really small. As part of this, don't be afraid to throw code away and start again (everytime I say that somewhere a project manager has a heart attack).
If your particular task can't easily or reasonably be divided into really small starting tasks then start with some substitute until you get going.
You want to keep it as simple as you can (the proverbial "Hello world") just to familiarize yourself with building, deploying, debugging, what error messages look like, the simple things that can and do go wrong in the beginning, etc.
I don't go as far as using a diagramming tool sorry (I barely see the point in that for my job).
As soon as you start trying things you'll get the hang of it, even if in the beginning you have no idea of what's going on and why what you're doing works (or doesn't).
I usually compile and modify the examples, making them fit something that I need to do myself. I tend to do this while using and annotating the corresponding documents. Being a bit old school, the tool I usually use for diagramming is a pencil, or for the really complex stuff two or more colored pens.
I am by no means a seasoned programmer. In fact, I am learning C++ and I've been studying the language primarily from books. When I try to stray from the books (which happens a lot because I want to start contributing to programs like LibreOffice), for example, I find myself being lost. Furthermore, when I'm using functionality of the library, my implementations are wrong because I don't really understand how the library was created and/or why things need to be done that way. When I look at sample source code, I see how something is done, but I don't understand why it's done that way which leads to poor design of my programs. And as a result, I'm constantly guessing at how to do something and dealing with errors as I encounter them. Very unproductive and frustrating.
Going back to my book comment, two books which I have ready from cover to cover more than once are Ivor Horton's Beginning Visual C++ 2010 and Starting Out with C++: Early Objects (7th Edition). What I really loved about Ivor Horton's book is that it contained thorough explanation of why something needs to be done a certain way. For example, before any Windows programming began, lots of explanation about how Windows works was given first. Understanding how and why things work a certain way really helps in how I develop software.
So to contribute my two pennies towards answering your question. I think the best approach is to pick up well written books and sit down and begin learning about that library, API, SDK, whatever in a structured approach that offers real-world examples along with explanations as to how and why things are implemented as they are.
I don't know if I totally missed your question, but I don't think I did.
Cheers!
This was my first post on this site. Don't rip me too hard. (:

Resources