Java Bytecode Manipulation Library Suggestions [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 months ago.
Improve this question
I'm looking for a well-maintained Java bytecode manipulation library with an intuitive API. There seem to be quite a lot of them out there. Any suggestions on which ones to try?

The best answer to your question will be governed by your specific needs and objectives; if you can expand upon what you're trying to accomplish, I can perhaps offer a more tailored response.
In lieu of that, however, in my experience, ASM offers probably the best combination of maturity, flexibility, and ease-of-use:
It's under relatively active development: even though the latest release is from June 2009, developers are regularly making commits to their VCS.
It's already in wide use in a number of prominent Java products, such as AspectJ, Groovy, Cobertura, and many others, which promises a wide user-base and thus a wide community for support.
It's fairly thoroughly documented, and there are a number of tutorials, user guides, and reference documents available both from the OW2 Consortium and the community at large.
N.B. The comment #Yuri left below describes a situation I personally haven't yet encountered but that may potentially pose a significant obstacle. Keep his observation/experience in mind while evaluating the various bytecode manipulation libraries.

That actually depends on how you define intuitive ;-) I started using ASM two weeks ago for a certain task on my current project and it worked like a charm. It only took me a couple hours to understand it and be able to use it, but I wouldn't exactly call the API intuitive. But if you know a little bit about Java bytecode and are familiar with the visitor pattern, the learning curve is not very high, IMO.
Another advantage of ASM is that it is apparently bundled with the standard API at least in the Sun JDK, although in a different package (com.sun.xml.internal.ws.org.objectweb.asm and subpackages).

Take a look at this article :
http://www.pabrantes.net/blog/space/start/2008-03-24/1
A little old but still relevant.
ASM And Javassist are the most used ones now.
Bcel is dying.

Related

Reverse Engineering poorly documented Java from source [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I'm a systems engineer, recent college grad, and I've just been given a project that is exceptionally daunting.
We have a legacy system, we legally own the entire code and all rights to it. The problem is that the code is poorly documented, what little documentation is incomplete, sometimes wrong and the original devs are unavailable.
It uses a custom Perl build script requires a thousand modules from CPAN to work and I do not know Perl. Reverse engineering into UML has failed except with Doxygen and that is limited to just inheritance diagrams and call graphs.
I've obtained a massive chalkboard and I'm slowly trawling through the code, modeling packages and then the nested packages within.
My question is whether or not I'm approaching this reverse engineering from the right direction. I'm working close from the bottom trying to figure out what calls what while developing UML and writing a Design Document. I did a package diagram but it's hard to figure out what's going on at that high a level.
An academic paper I pulled up suggests I also make a new Requirements Document which would slow me down even more and I don't know if it's a good idea as the other developers are always busy trying to keep the legacy system up.
Are there any books out there that can help me and am I approaching this from the right angle? Should I hire a contract worker that knows Perl and JMX to assist me?
The book "Working Effectively with Legacy Code" by Michael Feathers will probably help you more than anything we can tell you here.
However, the most important thing you need to clarify for yourself (and from your question it sounds like it's not completely clear) is this: what is your goal? What do you want to achieve with this codebase?
If the answer is (as it sounds) "being able to effectively maintain the existing project", then trying to directly build a complete high-level model of the system may not be the most effective path. It's probably just too much at once to keep in mind.
In this case, I would try to understand only the use cases of the system that you currently need to modify; follow method calls through the code (pssibly using a debugger on the running system) to see what parts are involved. Do this for a few different use cases and you'll start to see patterns, then document those and gradually fit them together into a high-level image of the system.
This tool might assist you.
Or if the legacy system is written poorly it could just make a huge unreadable mess, but I hope it helps.
If it is a java code then a deep reverse engineering would be very helpful.
See a documentation at: http://www.ejb3.org/jar_file_reverse/jar_file_reverse.html

Are there any tools for detecting architectural and design patterns in code? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Our team is doing reverse-engineering on a application with virtually non-existant documentation. We want to detect if there's a use of architectural or design patterns. You may understand that this application is large, so looking manually is no sense for us.
This application is written in Java and we use Eclipse for IDE, so it may be a plugin for Eclipse.
We have found some tools, like "Design Patterns detections Similarity Scoring", but it's not working very well.
So, such tools do exists?
If you have the source code of the app, you are most probably reengineering it, rather than reverse engineering. (The latter means recovering some sort of higher level code from machine- or bytecode).
At any rate, you want to understand the application, i.e. build a mental model of it in your mind. I am afraid automatic tools aren't of much help in this. What use would it be for you to get a list of supposed patterns in the code? Would it help you understand better what the code actually does and why? Especially taking into account the high chances of patterns being misused in legacy code :-(
In the end, you need to get down to reading the code anyway. But here is another similar thread which hopefully helps in the daunting task of taking over a legacy app.
I do not believe these kind of tools exist, because that would be pretty complex. Another approach could be to generate something like an UML diagram. This should give an abstraction of the code which could help you identify the design pattern.
I doubt there are tools out there for detecting patterns or designs in code
Code Bubbles could drastically help the reverse engineering effort, when it eventually comes out !
Lately, am finding it extremely useful to use code coverage tools to identify which parts of the code are called when a particular user/system action is initiated. It's not what the tools were designed for but am increasingly finding it more effective than other approaches. (Can post a link to details here if there is demand for it)
The next best approach is using a tool such as MaintainJ to trace code execution. This link documents that approach (when the author talks about aspects) and various other approaches, and having tried them all, coverage is what I've settled for.
Have you tried running javadoc on the code base? That would give you some idea if the structure (or lack of it) of the code. If you are really lucky design patterns might be mentioned in the comments.
There are lots of other tools for discovering class hierarchy - ClassCycle, Macker, JDepend etc.
Automatic detection of design patterns would be quite difficult I think, because a design pattern carries a lot of scope for variation.

Looking for java SFTP modern library, not jsch [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
The "jsch" based implementation works for me.
But it looks not modern one due to using Vector (old style Java collection).
I found that the other implementations are less popular and not documented.
Can you recommend implementation of SFTP library that he/she has good experience with it.
Thanks.
It works. Who cares if it uses Vector? It's by far the most popular one. In fact, it's the only one I can think of without resorting to Google.
There is a newer "version" of Jsch on github. It is a vast improvement to the existing library in many ways. Check out the README on the site and the comprehensive javadoc for more information. https://github.com/vngx/vngx-jsch. It's also available on most major maven repos and it's OSGi compatible. There are quite a few alternatives, but this one is solid and I believe the most up-to-date (spec/code/docs). Disclaimer: I am a contributor.
As #dty said, as long as your application can work smoothly why do you care for the usage of deprecated classes/methods in the library ?
You only need to care about what you're calling, not how does it work in the inside.
You can also use abstraction tools above JSch, but it won't change a thing.
You can also check for JSch alternatives, but as JSch is widely used you'll have probably less bugs with it.
You may also want to take a look at IP*Works! SSH from /n software.
I have used this library https://github.com/shikhar/sshj/. Its has got an excellent API [Requires Java 6].
A cheaper commercial alternative (my own product, for disclosure), is edtFTPj/PRO.

Image acquisition hardware scanning from Java [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
How can I implement image acquisition from hardware scanner in Windows? I found JTwain library, but it's commercial. Is there any free frameworks? Any information about this?
Here's an article discussing how to implement your own API using TWAIN (confusingly also called JTwain).
From the article:
Java's lack of a standard
image-acquisition API is an oversight
that hopefully will be rectified in a
future release. Until that time,
however, we can either purchase a
commercial API or create our own API.
We can base our API on either of the
TWAIN or SANE specifications. So far,
we've only looked at TWAIN, in terms
of the big picture and important
details. We have also explored the
very simple TWAIN-based JTwain API and
played with a simple JTwainDemo
application that demonstrates JTwain.
If it's for personal or educational use, maybe you can use Morena: http://www.gnome.sk/Twain/jtp.html
Unfortunetely, if it's for commercial use you will have to pay for it.
There is EZTwain, which I was coding from jni and getting objects ( actual java objects that showed up and were usable in Java on the Java side after being constructed with all that L stuff. Never got past the dib struct pointers ... ended up looking the fool in front of Spike ( he was a true professional about it ) and before I could get the dib stuff within comprehension I crashed Whino the Poo at the root and lost data-up-link to the wooly-web and as well had to go to work in a factory to meet needs.
I'm sure I salvaged much of the code as I was digging around in the data-recovery stuff I did where I saved the "D" work that I was beginning. I had intended to do an ocr character recognition as I have a statewide organization with hundreds of real people doing legitimate work and the central office is bogged by primitive data entry methods that would never scale to the volume that is just down the road.
The license for EZTwain is well implemented as it takes much of the commercial territory as reserved for their legitimate commercial turf. I really think it would be funny as an interview question to discuss Sarbanes-Oxley auditor independence as a function of Gaussian kernel radius in the Canny edge detection algorithm. ( in Java - Tom Gibara )
I'm sure they would ask me the "O" of the thing, I'd say "Oh!"
Which is about what you would say after a few hundred func names in JNI.
( not trying to be funny, it's just that this is why you don't see a lot of development in this area )

Where can I get started learning about Rule Engines? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm currently designing a Java application where a Rule engine could be useful. Where is a good place I can learn about how to use them, how they work, how to implement them, see samples, etc.?
The Drools documentation includes a lot of useful, general purpose information. Especially chapter 2, which covers rule engine basics, knowledge representation, etc. It also includes a nice recommended reading list for coming up to speed on rule engines and expert systems.
For most rule engines, a basic understanding of the rete algorithm usually comes in handy for writing efficient rules. I have personally found the Doorenbos paper referenced in the Wikipedia article to be the clearest technical explanation.
Also, here is a list of open source rule engines in Java.
You might want to read "Should I use a Rules Engine?" from Martin Fowler's blog.
I have worked on a project where we built our own (very simple) rules engine, with the intention to move to a general rule engine when things got too complicated. Never reached that point though, the system has been running happily with the simple homegrown engine for several years now.
I found this site pretty helpful. Are you looking at building your own, or using a 3rd party library?

Categories

Resources