Hikari Shidou

Ranch Hand
+ Follow
since Jan 22, 2013
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Hikari Shidou

So, from user's POV they are almost identical, and their differences are in their APIs and how they render components?

Then, which one have more and better components? Would it be SwingX?
10 years ago
Sorry for delay.

Indeed normally we should stick with what we know best. But in this situation I'm looking for the best tool, in features set. I'd rather learn a new framework, if it provides better result.

It is said we have some GUI frameworks for Java and nobody, in all these years, have made a good comparison based on Usability and User Experience. Java could even provide better graphical components and innovate.

I'm willing to learn a new framework if I knew it's worth it, but I'm sad to have to learn both just to know which is best.

I'd also wanna know which one is better supported and updated, which is more stable, etc.
10 years ago
I have algready googled about the subject, but found nothing regarding user Usability.

SwingX can be put on table instead of Swing. Third party components in either side can too, as long as they aren't so many that most GUI is based on them.

Using a few components of a framework inside another one isn't desireble.

What I'm rly looking for is which one provides best productivity and complex graphical components, that resambles Windows native Look&Feel.

For example. I've not worked with Swing for some years, but I remember that masks over edit input didn't work well in Swing. While Borland VLC components used to process mask as soon as user typed a key, Swing used to wait for the component to lose focus to process mask as "fix" the string.
10 years ago
Hello guys. I know this comparison has been asked for years and I've read some, but I haven't seen any article comparing them regarding Usability.

Let's consider Swing with Windows Look&Feel, both frameworks over Windows compared with a "native" .Net application.

Regarding user productivity, shortcuts, advanced components like datetime pickers, calendars, grids. Keyboard (Tab) interaction, take focus over other windows, systray icons and context menu.

Which framework is better for Usability and productivity? Links to articles would be very much appretiated!
10 years ago
Cookies, Session, HTTP headers.

When I made this post I needed Session support for a Stateful app. But I learned how to do it in Axis2.
10 years ago
When we develop a WebApp using Servlet, we have available all Web features, like setting and retrieving HTTP headers, sessions, etc.

But when we develop it using Axis2 in a bottom-up way, all we have is a Plain Old Java Class.

I know that Axis2 uses Servlet to implement SOAP WS, so Sevlet features are available underground, and of course we're above HTTP messages, but these feature are hidden.

How can our class access them? Would there be for example some Axis2 class we can use to extend our class, with methods we can call to access these features, as we do with HttpServlet?
10 years ago
Better is indeed very wide.

Considering WebService as a way for different processes to communicate, its biggest advantage would be interoperability. Different platforms can "talk", as long as both has some framework for a WebService standard, or you are willing to develop your own. At these days of multicored smartphones, even embedded microcontrollers have Ethernet ports and HTTP Server.

In the past, inter-process communication used to require OS or IDE specific APIs, like Unix pipes, Windows shared objects, Java RMI, Borlands junks, etc. They were binary based or were implemented only in their own platform. It was VERY hard to make applications developed in different languages, platforms, compilers or even just different IDEs to talk to each other.

One of the oldest inter-platform communication solutions I know is CORBA. It uses IIOP(rotocol), which is binary based as long as I know. Each platform/IDE creator had to develop its own CORBA implementation. It could require a CORBA server that would interface between different CORBA implementations, if they weren't able to talk directly.

I remember when I tried to make Borland C++ Builder talk with Java. Java implements CORBA by RMI, when it uses IIOP as its protocol. Borland had its VisiBroker. it was Java 1.5 at the time and I was using BCB6. VisiBroker was developed in Java. Newest VisiBroker version at the time (6 if I rmember) didn't support BCB6, so I had to use VisiBroker 4.5. But VisiBroker 4.5 was developed using Java 1.3, which was discontinued, and VisiBroker 4.5's server didn't run in Java 1.5 and neither was able to talk to its RMI-IIOP. I had to use an old Java 1.3 JVM to execute VisiBroker, it was able to properly talk to BCB6 app, then use a Java 1.5 RMI server to talk to VisiBroker, and then this Java RMI server talk to my Java 1.5 app. 4 process involved and 2 CORBA servers...

The advantage of these binary/proprietary solutions is the performance. If you're gonna make Java talk to Java, just use RMI. But, IMHO, interoperability > performance. You may even end up getting your apps talking broken just by upgrading 1 of them's IDE/VM/Framework/Lib/etc version!
10 years ago
Does anybody know a good menu creator that uses Suckerfish as basis?

Suckerfish is a "standardized" web menu. Its markup is made only of ul's, li's and a's, and its layout is made exclusively with CSS. The cool thing about it is that we can have unlimited nested submenus, by adding an ul inside an li, without having to rely on JavaScript.

Although there's no official standard, if we use the ul-li-a structure, we can add some css styles to structure this list as a menu - and its submenus -, and another styles set to customize it with colors and "shiny" stuff. And also there's superfish, supersubs and hoverIntent, 3 jQuery plugins that enhance any Suckerfish menu without having to change its markup and style.

In the past, before Suckerfish, it was very hard to get a good menu for Web that supported submenus. Most used wacky JavaScript or were made with Flash. Some created jpeg pics for menu itens, which are pretty but make the menu static, while Suckerfish allows easy dynamic customization just by creating the markup from PHP/JSP. Even today there are some menu creators that use div's and wacky markups, that create very pretty menus, but keep us locked on their proprietary software.

I know Suckerfish is old stuff, but was standardized by its use. I just wanted software that would create neat CSS based on the standard, to make it easier to create many different menus. Have anybody ever seen a pro-quality creator?
After reading about these frameworks, I decided java.util.logging is really the best and simplest solution.

I just used a XML file with configs for setting up logger. From this file I can set it to print in stdout or to a file, and set its format to XMLFormatter or a custom simpler format:

That's working pretty well for stdout logging. Each line gets larger than SimpleFormatter, but now I easily see that each log is in 1 line. If the log has a throwable, it also prints that throwable, with the advantage of it printing full stack trace, without those boring "more" texts when stack is too big.

An example of the result:

11 years ago
As I said, because Properties is good enough for for me in simple configs, and if it gets more complex I just use XML.

My need is related to having a bundled file with default values, and allowing to use an external one for custom values, without having to mess in jar file.

The issue is not related to format used, it's about finding the correct file. The problem is that getResourceAsStream() gives preference to bundled file and ignores if there's another one in the same path as the jar (more precisely, if there's another one in classpath). It searches first inside jars, I need something that searches first in jar's folder.

For now I'm using this code:

Being configFileName = "project.xml", it does the following:

1) Uses default getResourceAsStream()
2) If not found, searches in PATH
3) If not found, assures to search in Working Directory
4) If really not found, simply uses "bundled.project.xml", which is the file added to jar's root
5) If Jar is corrupted or badly generated, it throws Exception with the filename

My main need is to not touch jar file after it's generated. It's baselined, it shouldn't and mustn't need to be edited at all. The advantage is that allows to quickly compare production jar file with the one baselined in Repository.

In my team ppl use to put in production codes that weren't commited to Repository, they mess in jar files and files extracted from wars. It's sad, and they also LOVE to edit jars' config files. It's their standard practice to edit a jar everytime a config must be changed. So I wanna create a better solution, but couldn't find an international best practice one regarding config files deployment.

This code I created is good in the way that config files are still bundled in jars and at the same time does extensive searches for external files. But it's kinda big and a bit complicated, and also requires bundled file to have different name from custom one.

If I could just get getResourceAsStream() to search outside before searching inside jar!
11 years ago
It seems to not solve my concern.

Properties is good enough for simple configs, and if I need some more sofisticated I just use XML.

My problem is having a default file inside JAR - it has standard name, based on project's name -, and be able to identify if there's another file outside of it - preferably in the same folder the JAR is - and give preferance to it, ignoring then the bundled one.

The best I could find is doing this:

1) put a project_bundle.property in src folder, this file will be bundled in jar's root when deployed
2) first try to read
3) if null==inputStream, try to read

This way I'm able to give it a try to the external properties file, and if it's not found I use he bundled one.

But is there a more elegant way, so that I can bundle a project.properties inside jar but use an external project.properties if it's available?
11 years ago
This is a very newb question, but even today I don't know best practices about it lol

I know our code can use Class.getRersourceAsStream() to read these files. In example,

I don't like to bundle properties inside jars. DB configs for example, it's not good to have passwords there.

But in other situations, it's good to have a properties file with default values as example for user. But on the other hand, I don't want jar to be changed if these files must be edited.

Is there a way, for example, to place another config.properties somewhere, and it be read by getResourceAsStream() instead of the bundled one?
11 years ago
I've worked with logging in Java years ago, but now I wanted a better solution. At that time I worked with java.util.logging and read about Log4j, and now I see there's Jakarta Commons Logging too. I'd be very thankful if somebody more experienced could suggest me which to choose.

My main needs are:

1) Easy to use. During development, if I wanna quickly test the content of an object, instead of using System.out I can just use logger.finer("test01 "+object.toString())
2) Easy to configure. By my own code (and not some xml or property file I must put in a very specific folder), I set its OutputStream to some txt file I created, or just route its logs to stdout if I'm inside Eclipse, or just shut lower levels out, or route higher levels logs to 1 file and lower levels logs to another file.
3) Be able to format its output. Once in production, I'd like to use XML to format logs (in case someday I need to prepare some report based on these logs, it will be easy to read and process them), and use XSL to format it into XHTML for easy viewing.

When I read about Log4j years ago I didn't like it, because it didn't seem to have any better feature than java.util.logging, but I don't know how it is now. I'll read about Jakarta Logging to see if it's worthy.
11 years ago
I'm using a Java class to build a WebService, using Axis2 and Eclipse. From Eclipse, Axis2 creates whole WebService project, including WSDL, then I use Eclipse to deploy the war file that I'll use in Tomcat.

But I need to access Axis2 properties from inside that class, including Rampart WS-Security and HTTP properties. Since that class is used to build WebService, it has no knowledge of Axis2, Servlet, etc, it's just a plain old Java class.

I know that I could build a WSDL myself and use it for Axis2 to create the class I'll use, and that class would be able to access Axis2 properties. But that makes WebService development more troubling, I'd need to mix code developed by me into Axis2 code, etc.

Is there a way to keep my class the starting point for the WebService, and still be able to access Axis2? maybe use annotation to define a special method in the class that would be extended by Axis2 and would return its properties :p
11 years ago
In your case, WebService is about content. It doesn't matter its methods (you can/should use annotation to not implement these methods in WSDL).

As I can understand, you have an Event Interface, that has the methods but doesn't define its properties, and its implementations add different properties to it. If that's the case, then yes, your WebSerivce and its WSDL will need to know each and all classes that implement that interface!

That's really troubling, because (as long as I know) SOAP doesn't support inheritance. If we're not careful, we freely use inheritance in our software, then when we must add WebService inside it we'll be stuck in SOAP requiring more simplicity than a full OOP language.

Your modules seem too much coupled, you should enhance your software architecture (I'm not saying it will be easy after it's already implemented :p ) to make each component/module less coupled (google "loose coupling"). You're facing a situation where your broker depends on all your components' internal implementation, and exposes it! It seems you have created an Event Interface and let it be freely extended by any component, in a way that these extends are being needed outside of them.

If you cannot make Event evt = new SomeEvent() and handle everything from Event interface (including pass Event evt object to some code that isn't coupled with SomeEvent), then that interface loses its use and everything that uses SomeEvent will be dependant of the component that defines it. If some complexity isn't properly encapsulated, everything that consumes it will need to be aware of it!

A solution to reduce coupling would be to have a component by itself that defines all available Event's, and couple all components only to it.

I know it's trouble. An easier solution would be create a FatEvent POJO/JavaBean class, that stores *all* possible properties (I think that behavior methods aren't needed) from all Event's. It will also have an Enum property, where you store which Event type it is.

If that works, when preparing a WebService message, you convert your actual Event into a FatEvent object, and send it. On the other side you verify its Enum property to know which Event it sould be, and convert it back.
11 years ago