Rewriting old/deprecated code java [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
The company I work at has a piece of code they would like to rewrite. It uses Java/Java server faces. The problems with it are that it is old and uses depreciated code, was written in an IDE that is no longer available and doesn't work well with netbeans, and that it is kind of sloppy coding in the first place. No one really knows its structure and there is limited documentation.
Before beginning on the rewrite, we would like to find the structure of the old program and get a decent UML diagram. What tools would work the best in this situation? So far we have looked at one called Agilej.
Sorry if this is a little vague, I'm just a lowly intern an haven't been filled in on everything yet =p

You can use JArchitect, a pretty complete java static analysis tool

I'm not giving clickable hyperlinks as you should be able to find them easily through a web search and there may be more than 1 link that is useful for you
Sparx Systems Enterprise Architect has very powerful reverse engineering capabilities. Java (also compiled binary JAR) is in the list of supported languages.
I have used Enterprise Architect's reverse engineering features several years ago to help us understand and design modifications of legacy C++, QT code.
Enterprise Architect was able to automatically retrieve the class model. I then used the raw class model to drag/drop draw several other diagrams including only classes of my interest with level of detail I needed etc.
In the range of other static code analysis tools (e.g. the code flow visualization) I don't know which tool particularly supports Java well enough. Quick Google points e.g. to Coder Gears JArchitect. In the past project I have mentioned we used Doxygen's automatically generated documentation. Part of that were also some automatically generated graphviz dependency diagrams.
To clarify the design and visualize the flow (especially big legacy functions) I have found useful the Rapid Quality Systems Code Rocket flow visualizer
Once you get the basic facts at your hands through the various reverse engineering tools next step would be to go through them, annotate what is the unknown, what is doing what, basically apply some formal code review method (e.g. Fagan inspection or some of its derivatives).
(using evaluation versions of the various tools may be enough if you think ahead what are the required deliverables for your follow up actions. I guess the company is not planing to give you a >0$ budget)
The Agile Modeling site may have some good refactoring tips and some minimal UML mapping guidelines, start e.g. at Agile Legacy System Analysis and Integration Modeling

Related

Hierarchical / linked diagrams [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Within my company we have numerous distributed systems, which are maintained by different developer teams. It becomes increasingly difficult to track the dependencies and communication between these systems:
Drawing a single diagram is impossible as the level of complexity is too high.
Static diagrams produced in tools like Gliffy or Visio quickly become out of date.
The ideal would be some kind of hierarchical diagram software, whereby I can click on a "system" (that could in fact correspond to an entire dev. team) and "zoom in" to other diagrams representing the components in that system. Also, ideally this would be a "live" diagram with processes providing topology information on-the-fly.
Does anyone know of any applications / libraries (preferably in Java) that fulfill one or both of these requirements?
I guess you would like to have a system like shown in the movie with the ability to give an overview of the overall system architecture and drill-down to the individual components. This seems to be a commercial solution, however you can gain some ideas from them.
I assume you already know/use the following tools:
Dependometer
JDepend - here you can filter the packages to be displayed on diagrams and have automatic verification of dependency rules
SonarGraph - commercial tool. Allows drill-down on dependency diagrams
As far as data visualization is concerned:
d3.js - awesome library for data visualization. You can easily create zoom-able diagrams: example 1, example 2
GraphViz - graph visualization software
JGraph - mentioned by #MadProgrammer
In order to have diagrams, which are updated automatically you could add custom java annotations to your code. With these annotations you would mark some of the important components and communication interfaces along with some metadata. Then you can write a simple parser, which will produce output for GraphViz or d3.js and you'd have the desired documentation.
We use yFiles libraries in order to visualize network topologies and UML diagrams. It's quite easy to create interactive "drill-down" diagrams with it. A complex system can be hidden by a folder node, that can be opened/closed at any time. Spawning a new graph/diagram based o some node sounds plausible too. It comes with detailed documentation and lots of demo code.
There's a downside though. It comes with a commercial license (you have to pay for it) unless you are an academic researcher.
Disclaimer: I'm not a developer of yFiles and am not affiliated with them.

What is your recommended tool suite for internationalization of a complex multi-module java application? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am currently doing an intership in a company and my task is to reevaluate the tool suite used to translate applications as it has become a problem internally. I've looked everywhere on the web and my conclusion is there is just no proper documented end to end workflow for this type of task, so I am asking the community to help me understand what they have seen in the field.
Our current flow looks like this:
java, properties files and resource bundles in the code
custom made tool to extract keys from code based on classes. bit clunky, as it uses class loading and therefore has many practical constraints
custom made web tool to do translations and handle code revisions
Here are some constraints and improvements we're looking towards:
we'd like for external translators to help us for additional languages our company cannot handle
we would like to add metadata to translation keys, such as validation flags, categorization data and description data, something not handled by properties files
we're going to have external translators and would wish to be able to use standards where possible to properly integrate with their tools
Here's what I've found on the web:
GNU Gettext's plural handling and context messages are nice. However, our existing code is written using keys and would not work with writing plain english messages in the code.
XLIFF provides means to have all the extra metadata we would like to add. However, all existing tools are either incomplete, buggy, or costly. Many of the tools add their own metadata which complicates working with XLIFF.
Pootle pretty much does what our custom made web tool does except fails to work on multiple Git branches.
Weblate, which is similar to Pootle, has the ability to work on multiple Git branches. However, updating a project with many languages and many translations takes time. It fails to meet our needs of continuous development.
So what is your recommended tool suite for internationalization of a complex multi-module java application?
Gettext (.po) is possible by a two stage key: key -> English, English as key. Disambiguation can be done with the original key. The original key can be preserved.
Gettext seems to be more extensively used than XLIFF - but I may be wrong meanwhile.
Web interfaces are fine - as a secondary tool. Translation agencies will complain when offered such a thing.
I cannot stress sufficiently that the delivery of the text is very important, to prevent that every translator has to do extra work. Almost the same text that might be united is such an example. A Translation Memory might give a fuzzy translation, but it is better to do processing by someone dedicated, before delivering things to translate. Also things like "Select from the menu 'Process thumbleweed'" and "Process thumbleweed" could well need a translation responsible person, to have coherent translations. XLIFF might offer more technicalities, but in general I think it is best to let an experienced developer ensure, develop this process. A common glossary of specific terms.
Also being able to have the application switch between showing a specific language and the key "[key]".
How about Tapiji? Not sure if it will meet all your requirements, but it is a time saver. If you are using Eclipse, or can use it, it might be worth a look. From the site:
The implemented editor is based on the Babel Messages Editor Resource-Bundle editor, which considers the whole Resource-Bundle as the object under modification instead of a single property file. Furthermore, a Resource-Bundle view adds rich functionality for browsing resources and directly comparing different languages. In parallel, RCP and RAP based stand-alone applications enable the translation of resources without the need of programming skills.
Weblate indeed is not the fastest tool for import (but there are many improvements in the upcoming 1.6 release), but there are several hints in the documentation how to improve this. Have you tried those?

Open Source Java CMS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Can anyone suggest a good open source cms for java? I have not used any java cms but I have used wordpress. Looking around google I have short listed openCMS, dotCMS and Liferay. Has anyone used these? which one of these would be a "good" CMS. It would be good if it has good documentations and online community... it can be integrated with other java tech e.g. frameworks like spring framework... simple to learn...
I just don't want to spend time on one and then realise there is a better option out there...
it would be good to get others view on this....
thanks in advance...
Firstly, may I assert that this is a perfectly reasonable question given the importance of CMS web technologies, which run a large portion of the WWW, and one rightly asked by many Java-aware people, as there are some serious problems with all of the many (nevertheless popular) PHP-based systems like Drupal, Wordpress, and Joomla, including:
inability to integrate well with graphical Unified Modeling Language (UML) engineering
massive use of freestyle strings as hash array keys (instead of as system-wide, shared, pre-defined string constants) in their programming style, burying data structure as hard-to-document conventions in hashmaps, and breaking everywhere the fundamental Don't Repeat Yourself (DRY) principle, instead of using reusable encapsulation with object-orientation
consequently poorer integration with IDEs and IDE prompting than a Java CMS API would permit.
There is a very good list of Java CMSs at:
http://en.wikipedia.org/wiki/List_of_content_management_systems#Java
The dotCMS site compares its own popularity with its main Java CMS competitors: Magnolia, Hippo, Jahia.
http://www.dotcms.com/images/carousel/banner/graph.png
It is interesting that OpenCMS does not make that list: http://www.opencms.org/
There is a CMS comparison tool at: http://www.cmsmatrix.org/
CMSmatrix lets you easily compare the features in over 1200 content
management system products.
The fact that there are 1200 indicates that asking others for tips or feedback on their experience with Java CMS variations is fair, as it is hard to test out all of the options.
As far as I can tell, dotCMS is the fastest growing and best option depending on your requirements.
Finally, permit me in my answer to offer an observation on the PHP vs Java CMS matter. My main language is Java, always, at least to some extent, under graphical UML model-driven engineering (if only sometimes via reverse engineering monitoring), but I have worked extensively with PHP and PHP-driven Drupal for many years, one of the "big three" along with Joomla and Wordpress.
As far as I can tell, none of the Java CMS options comes even close to the feature set of Drupal, when the massive range of contributed modules is considered, or (once you are familiar with it) the ease of setting up easy or very complex enterprise CMS sites with Drupal. In particular, the Views module in combination with ease of creation of custom content types makes it very easy to create very rich page displays with structured data, relationships, and rich query view reports. I do not know of any Java CMS that has anything that can even come close to matching the Drupal Views admin interface for creating custom query view reports. I am thankful that Drupal exists, and at times it has helped me to feed myself and my child, and I even use it to track my Enterprise Java software development projects, and I use it ironically for educational web sites promoting Unified Modeling Language (UML) and UML-driven Java.
Also, the CMS aspects of my own Java web applications deliberately imitate Drupal.
I make however no secret of the fact that I absolutely can't stand the basic Drupal programming model, the contributed module APIs, and what I consider to be an appalling lack of object-orientation in it, and a programming style that includes nearly every single sin I would as an educator discourage in any 101 programming course. I do not enjoy coding contributed modules against its API, and the Drupal hook system is completely unnecessary, and has no advantages over simple interface registration patterns that any Java programmer would know, and would let an OO compiler do.
I bemoan every working day the lack of a well-architected Java-based CMS that can otherwise match Drupal (while always remaining thankful for what one can do with Drupal).
With hot reload technologies for Java like JRebel, it should now be possible to have a Java-based CMS that is as easy to develop against as the PHP-driven CMSs but with a decent and properly object-oriented API, and I hope that one Java CMS does finally really take off and develop as active a contributed module community as the PHP-based ones like Drupal have.
There are a few, and being Java based they tend to be more targeted to enterprise environments. I recently answered a similar question and explained why we (at our company) use Dotcms. You can read about it here: Java-based CMS with RESTful service / API to access content
Hope this helps.
Crafter CMS (http://craftersoftware.com/) is a 100% open source, Java based web content and experience management system built for today's multi-channel, personalized environment.
Crafter CMS is based on the most modern and popular technology in the Java space: Spring MVC, Goovy, Freemarker and Apache Solr. It's ideal for today's Java developers, extremely easy for non-technical authors to use and it's perfect for the enterprise. It's integrated with Alfresco content repository and Liferay portal.
Highlights Video:
https://www.youtube.com/watch?v=mSJ_7rvqMic
Apache Jackrabbit is a full Java Content Repository, which is basically a CMS on steroids.
You can take a look at Ametys CMS, a java-based open source CMS including microsoft Word-like interface.
You can read about it on their wikipedia page

NLP Library (Subject Extraction+Sentiment Analysis) for a Java-based Web Application [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm a college student looking for a NLP library to perform subject extraction and sentiment analysis in a Java-based web application for a summer-hobby project.
To give you a little context on what I'm trying to do... I want to build a Java-based web application that will extract subjects out of a Reddit submission's headlines, as well as identify the OP's sentiment for the headline (when possible).
Example Inputs:
Reddit, we took the anti-SOPA petition from 943,702 signatures to
3,460,313. The anti-CISPA petition is at 691,768, a bill expansively
worse than SOPA. Please bump it, then let us discuss further measures
or our past efforts are in vain. We did it before, I'm afraid we are
called on to do it again.
My friend calls him "Mr Ridiculously Photogenic Guy"
Insanity: CISPA Just Got Way Worse, And Then Passed On Rushed Vote
I'm currently trying out AlchemyAPI, but it sounds like better NLP libraries exist out there. Preferablly, I wouldn't be restricted to a limited number of API requests in a given time period (AlchemyAPI has a quota). I've heard the names of GATE, LingPipe, and OpenNLP - however, I'm unsure whether they fit my needs.
I'm looking for framework/library/api recommendations, or even better, comparisons from experienced users. My experience with NLP is extremely limited, which is why I'm asking for help here (ps: if anyone has any resources for learning more, outside of www.nlp-class.org, please let me know!) :)
First, I'd highly recommend using python, as the NLP libraries are a bit more user friendly than java, and it'd be a lot less code to maintain for a one-man project.
I can't think of anything off the top of my head to do either classification, so my recommendation would be to train two classifiers, one for subject, and one for sentiment. You'll have to label data and define features, but I think that wouldn't be too hard, especially with sentiment where you build up a dictionary of 'emotion' words. Labeling data is a pain in the ass, but that and good features are how you get good classification.
Subject Classifier:
Use NLTK with a Naive Bayes classifier, and define features as the word (lowercased), and word bigrams and trigrams.
Sentiment Classifier:
Same features as subject classifier, but also have a feature that says word w is in emotion dictionary with connection c. So, word 'bad' means 'bad sentiment'.
Once you've amassed sufficient training/testing data, you train your classifiers and optimize features, if necessary, and then you can run the classifiers against whatever other data you want.
General Purpose Libraries (Java):
OpenNLP
LingPipe
Weka
Stanford stuff
Libraries (Python):
NLTK
Scipy

A good Swing project for learning best practices [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I would like if there is some project developed in Java to learn Swing best practices. I mean an open source project hosted on the Internet through SVN or similar. I've been reading some questions in Stackoverflow about this topic but I would see some projects. Thanks.
The way I learned Swing best practices was reading the Swing source code in the JDK and practice. Follow Sun's practices and you'll be on the right path.
Read the implementations of JTable, JTree, JScrollPane, the various LookAndFeels, SwingWorker, SwingUtilities. Their event handling and MVC patterns are extremely complex but very readable, maintainable, and extensible. Essentailly, every time you use a component, go read the source code and understand what and why they do it. Eventually, you'll start doing the same thing.
And most importantly, code. Write some large programs, and you'll start seeing things that don't seem right or optimal. Come on to Stack and find out what you're doing wrong or could do better. Write something else, and do the same.
That said, the following projects have (or probably have) good code:
SwingX - The maintainers of SwingX were Sun/ex-Sun people, and I've always thought of it as unofficial incubator for future Swing features.
Squirrel (A JDBC client) - I haven't actually looked at their source, but I've used the program for years and it doesn't show any of the common flaws in badly written Swing programs. With how powerful it is, and how well it works, I would put money that's its extremely well written.
InfoNode (A powerful docking framework) - I've gone through quite a bit of their code, and its pretty solid.
JFreeChart (A powerful charting library) - Not the greatest code, but much better than average, especially taking into account its an old project that was never really intended to do everything people are using it for. That said, it is very extensible, and I've never had a problem molding it to my needs (which are much, much more than its original intentions).
GlazedLists (A highly performant event-based list library) - Not exactly Swing, but it's event handling is similar to Swing. They also have implementations of Swing models and some custom components that are extremely fast.
JIDE Common Layer: A massive collection of custom components that serves as the basis for their commercial components. I haven't gone through their code, but their components are beautiful, and since their primary focus is commercial Swing components, once again, I'd put money that their code is solid.
I found it very interesting to see a professional-quality application written in Swing, such as IntelliJ IDEA Community Edition. Now that it's open-sourced, you can check out the code and start digging in. Be forewarned though, there are no comments!

Categories