Samsung Galaxy Note II Keyboard space issue

As Samsung is launching new phones in its popular Note series, the old phone in the series is getting in trouble. Recently Note II owners got new system update which was approximately 104.88 MB. This update might have bring some fixes into system but left over an irritating issue with Samsung Keyboard.

Those who have used Samsung phones, especially Note Series, might have familiar with Predictive Text feature of keyboard. This feature actually predicts what user is going to type and provide some suggestions from which user can select and also tries to predict next word user would probably use thus saving users time and energy while typing. Another good functionality with keyboard was ‘Auto Spacing’, this feature is for automatically inserting spaces between words. This both  feature together makes it super easy for user to type something.

The recent update in Samsung Galaxy Note II has introduced a bug in Auto Spacing feature that is it inserts 2 spaces instead of 1. So if you type ‘he’ it will give you suggestions ‘hello’ and when you click on suggestion it will write ‘hello  ‘; 2 spaces after hello. So a simple sentence like ” Hi, How are you?’ becomes ‘Hi , How  are  you ? ‘ with predictive text and auto spacing on. If you disable auto spacing than it does not include any space at all, so its either 2 or nothing for space. This is very annoying for those who are spending their most of time messaging and doing social updates, and using note 2 phone.

Someone has also reported a bug into Samsung developer forum, but still there is no answer from Samsung; so user’s have to wait until Samsung sends a new update which resolves this. Meanwhile there are some alternative keyboards available as suggested by some user on forum.

So if you are using Samsung Galaxy Note II, installed latest updates and now getting unwanted spaces between words than You are not alone my friend, there are lots of others out there, including me (Yes I do own Samsung Galaxy Note II).

Some people have also reported to have similar issues with other Samsung phones like S4, so this might not be only for Note II.

If anyone of you surprisingly able to find a unique and perfect solution or get latest news about this, please comment on this post so others can know as well.

Reference: Samsung Developer Forum

About these ads

Simple Bootstrap CV

Want to build your online resume?

Harsh Raval  My Self   Bootstrap CV
Here is the chance to do same by using the provide template. It is a single page resume and is ready-to-go, just replace the content with yours and your online resume will be ready in just minutes. It is simple and based on the default bootstrap theme and its only html, css and little bit js.

The template is made with following things:

The whole source code is available on GitHub so you can easily grab it and use it. Don’t forget to star the GitHub repo if you like the template. For demo click the image.

Thanks :)

2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 35,000 views in 2012. If each view were a film, this blog would power 8 Film Festivals

Click here to see the complete report.

Simple REST client in java

Today most of the mobile applications that used to communicate to some server use REST services. These services are also common practice to use with JavaScript or jQuery. Right now I know 2 ways to create client for REST service in java and in this article I will try to demonstrate both the ways I know hoping that it will help someone in some way.

1. Using Apache HttpClient

The Apache HttpClient library simplifies handling HTTP requests. To use this library you have to download the binaries with dependencies from their website.
Here is the code for HTTP GET method:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
public class Test {
	public static void main(String[] args) throws ClientProtocolException, IOException {
		HttpClient client = new DefaultHttpClient();
		HttpGet request = new HttpGet("http://restUrl");
		HttpResponse response = client.execute(request);
		BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent()));
		String line = "";
		while ((line = rd.readLine()) != null) {
		  System.out.println(line);
		}
	}
}

And for Post method; for sending simple string in post:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
public class Test {
	public static void main(String[] args) throws ClientProtocolException, IOException {
		HttpClient client = new DefaultHttpClient();
		HttpPost post = new HttpPost("http://restUrl");
		StringEntity input = new StringEntity("product");
		post.setEntity(input);
		HttpResponse response = client.execute(post);
		BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
		String line = "";
		while ((line = rd.readLine()) != null) {
			System.out.println(line);
		}
	}
}

You can also send full JSON or XML of a POJO by putting String representing JSON or XML as a parameter of StringEntity and then set the input content type. Something like this:

StringEntity input = new StringEntity("{\"name1\":\"value1\",\"name2\":\"value2\"}"); //here instead of JSON you can also have XML
input.setContentType("application/json");

For JSON you can use JSONObject to create string representation of JSON.

JSONObject json = new JSONObject();
json.put("name1", "value1");
json.put("name2", "value2");
StringEntity se = new StringEntity( json.toString());

And for sending multiple parameter in post request:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
public class Test {
	public static void main(String[] args) throws ClientProtocolException, IOException {
		HttpClient client = new DefaultHttpClient();
		HttpPost post = new HttpPost("http://restUrl");
		List nameValuePairs = new ArrayList(1);
		nameValuePairs.add(new BasicNameValuePair("name", "value")); //you can as many name value pair as you want in the list.
		post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
		HttpResponse response = client.execute(post);
		BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
		String line = "";
		while ((line = rd.readLine()) != null) {
			System.out.println(line);
		}
	}
}

2. Using Jersey

Jersey is the reference implementation forJSR-311 specification, the specification of REST support in Java. Jersey contains basically a REST server and a REST client. it provides a library to communicate with the server producing REST services. For http get method:

import java.io.IOException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
import org.apache.http.client.ClientProtocolException;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
public class Test {
	public static void main(String[] args) throws ClientProtocolException, IOException {
		ClientConfig config = new DefaultClientConfig();
		Client client = Client.create(config);
		WebResource service = client.resource(UriBuilder.fromUri("http://restUrl").build());
		// getting XML data
		System.out.println(service. path("restPath").path("resourcePath").accept(MediaType.APPLICATION_JSON).get(String.class));
		// getting JSON data
		System.out.println(service. path("restPath").path("resourcePath").accept(MediaType.APPLICATION_XML).get(String.class));
	}
}

There are also other media formats in which you can get the response like PLAIN or HTML.
And for HTTP POST method:

import java.io.IOException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.UriBuilder;
import org.apache.http.client.ClientProtocolException;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.core.util.MultivaluedMapImpl;
public class Test {
	public static void main(String[] args) throws ClientProtocolException, IOException {
		ClientConfig config = new DefaultClientConfig();
		Client client = Client.create(config);
		WebResource webResource = client.resource(UriBuilder.fromUri("http://restUrl").build());
		MultivaluedMap formData = new MultivaluedMapImpl();
		formData.add("name1", "val1");
		formData.add("name2", "val2");
		ClientResponse response = webResource.type(MediaType.APPLICATION_FORM_URLENCODED_TYPE).post(ClientResponse.class, formData);
		System.out.println("Response " + response.getEntity(String.class));
	}
}

If you are using your POJO in the POST then you can do something like following:

ClientResponse response = webResource.path("restPath").path("resourcePath").
type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, myPojo);
System.out.println("Response " + response.getEntity(String.class));

Here myPojo is an instance of custom POJO class.
You can also use Form class from Jersey to submit multiple parameters in POST request:

import java.io.IOException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
import org.apache.http.client.ClientProtocolException;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.api.representation.Form;
public class Test {
	public static void main(String[] args) throws ClientProtocolException, IOException {
		ClientConfig config = new DefaultClientConfig();
		Client client = Client.create(config);
		WebResource service = client.resource(UriBuilder.fromUri("http://restUrl").build());
		Form form = new Form();
		form.add("name1", "value1");
		form.add("name2", "value1");
		ClientResponse response = service.path("restPath").path("resourcePath").
		type(MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class, form);
		System.out.println("Response " + response.getEntity(String.class));
	}
}

Let me know if you find any difficulty while using these code samples. Feel free to comment. :)

Gateway interaction in Smack API

Gateway interaction is described by XEP-0100. The query xmlns (namespace) used for this is same as IN-Band registration, that is “jabber:iq:register”. Smack API provides an easy way handle gateway interaction with the server. It has predefined classes for the required namespace and operations which one can easily use and do the thing. In this article I will explain how one can register, edit, unregister and retrieve gateway information using Smack library. I have listed both XML and code using Smack API for the purpose. I have used Openfire server with Kraken plugin in it for gateway related operations described in this article.

1. Gateway service discovery

First you have to send an IQ-get with xmlns of the service discovery info to the Gateway. The XML would look like this:

<iq id="uLQX1-3" to="gtalk.mtHost" type="get">
	<query xmlns="http://jabber.org/protocol/disco#info"></query>
</iq>

And in return Gateway returns identity information like this:

<iq id="uLQX1-3" to="user1@myHost/Smack" from="gtalk.myHost" type="result">
	<query xmlns="http://jabber.org/protocol/disco#info">
		<identity category="gateway" name="Google Talk Transport" type="xmpp"/>
		<feature var="http://jabber.org/protocol/disco#info"/>
		<feature var="http://jabber.org/protocol/disco#items"/>
		<feature var="jabber:iq:gateway"/>
		<feature var="jabber:iq:register"/>
		<feature var="jabber:iq:version"/>
		<feature var="vcard-temp"/>
	</query>
</iq>

By this you can identify which namespace features are supported by the gateway. To register and/or unregister the gateway “jabber:iq:register” support is required. This response can differ at your side based on your server and Gateway support. Now the code using Smack API for this operation is as follows:

DiscoverInfo iq = new DiscoverInfo();
iq.setType(IQ.Type.GET);
iq.setTo("gtalk.myHost");
PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(iq.getPacketID()));
connection.sendPacket(iq);
IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
collector.cancel();
System.out.println(response.toXML());

And to check for specific feature is supported or not and getting information of items in response do the following:

if (response != null && !response.getType().equals(IQ.Type.ERROR) && response instanceof DiscoverInfo) {
	DiscoverInfo info = (DiscoverInfo) response;
	Iterator<Identity> identities = info.getIdentities();
	while (identities.hasNext()) {
		DiscoverInfo.Identity identity = (DiscoverInfo.Identity) identities.next();
		System.out.println("identity name -> " + identity.getName());
		System.out.println("identity category -> " + identity.getCategory());
		System.out.println("identity type -> " + identity.getType());
	}
	System.out.println(info.containsFeature("jabber:iq:register"));
}

2. Get information of gateway

To query gateway id about which information is required to register, you need to send following xml:

<iq id="VT12T-4" to="gtalk.myHost" type="get">
	<query xmlns="jabber:iq:register"></query>
</iq>

In response server will respond something like this:

<iq id="VT12T-4" to="user1@myHost/Smack" from="gtalk.myHost" type="result">
	<query xmlns="jabber:iq:register">
		<instructions>Please enter your e-mail address and password used with GMail and GTalk</instructions>
		<username></username>
		<password></password>
		<x xmlns="jabber:x:data" type="form">
			<instructions>Please enter your e-mail address and password used with GMail and GTalk.</instructions>
			<field label="Address" var="username" type="text-single"></field>
			<field label="Password" var="password" type="text-private"></field>
		</x>
		<x xmlns="jabber:iq:gateway:register"></x>
	</query>
</iq>

By this you will know that which fields are required for gateway registration. Here in this example 2 fields are require, one is username and another is password.
Code to do this in smack is:
1) Send GET request to gateway

Registration iq = new Registration();
iq.setType(IQ.Type.GET);
iq.setTo("gtalk.myHost");
connection.sendPacket(iq);

2) Get the response.

PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(iq.getPacketID()));
IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
collector.cancel();
System.out.println(response.toXML());

3) Process the response for extracting required information like this:

if (response != null && !response.getType().equals(IQ.Type.ERROR) && response instanceof Registration) {
Registration registration = (Registration) response;
System.out.println(registration.getInstructions());
	if (registration.getAttributes() != null && !registration.getAttributes().isEmpty()) {
		Map<String, String> map = registration.getAttributes();
		System.out.println(map);
	}
}

3. Register gateway:

To register a gateway using one has to send IQ SET with the required attributes:

<iq id="WiISc-2" to="gtalk.myHost" type="set">
	<query xmlns="jabber:iq:register">
		<username>user</username>
		<password>pass</password>
	</query>
</iq>

And as a successful response server will send back following xml:

<iq type='result' from='gtalk.myHost' to=user1@myHost/Smack' id='WiIsc-2'/>

And here is the code to do registration using Smack API:
1) Send an IQ set packet. For jabber:iq:register we will use Registration class from smack library:

Map<String, String> attributes = new HashMap<String, String>();
attributes.put("username", "user");
attributes.put("password", "pass");
Registration registration = new Registration();
registration.setType(IQ.Type.SET);
registration.setTo("aim.myHost");
registration.setAttributes(attributes);
connection.sendPacket(registration);

2) Get the response:

PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(registration.getPacketID()));
IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
collector.cancel();

4. Retrieve registered gateway information:

To retrieve registered gateway information one has to send an IQ GET packet with “jabber:iq:register” query to the gateway id (i.e. gtalk.myHost). This is similar what we did to get gateway information. In short when you can query gateway for information it will return the information with currently registered information, if any and if there there are no registered information then response is just about the required field names to register.

<iq id="VT12T-4" to="gtalk.myHost" type="get">
	<query xmlns="jabber:iq:register"></query>
</iq>

The gateway returns registration requirements with already registered information like following:

<iq type='result' id='VT12T-4'>
   <query xmlns='jabber:iq:register'>
      <registered/>
      <username>user</username>
      <password>pass</password>
   </query>
</iq>

One can do this thing in Smack API as follows:
1) Send IQ GET packet to gateway:

Registration message = new Registration();
message.setTo("gtalk.myHost");
message.setType(IQ.Type.GET);
connection.sendPacket(message);

2) Get and process the response returned by gateway:

PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(message.getPacketID()));
IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
collector.cancel();
if (response != null && !response.getType().equals(IQ.Type.ERROR) && response instanceof Registration) {
Registration registration = (Registration) response;
if (registration.getAttributes() != null && !registration.getAttributes().isEmpty()) {
Map<String, String> map = registration.getAttributes();
// map contains information about registration.
}
}

5. Edit registered information:

To edit registered information one has to first fetch information as shown in above section and then follow the same code for registering gateway. In simple words do point 3 & 4 form this article in reverse order.

6. Unregister gateway

To unregister a gateway first query for the registered gateway to see if any gateway information is registered or not. If it is registered then to unregister you just have to add a “remove” attribute in the IQ set as follows:

<iq type='set' from=user1@myHost/Smack' to='gtalk.myHost' id='VTiLk-4'>
   <query xmlns='jabber:iq:register'>
      <remove/> <!—remove is for unregisterting the gateway -->
   </query>
</iq>

This is very similar to the register gateway xml so difference in code is very small. Instead of adding username and password as attributes in Map you just add a “remove” attribute and everything else is same.

Remove these 2 lines from register gateway code:

attributes.put("username", "user");
attributes.put("password", "pass");

And add following line instead:

attributes.put("remove", ""); // no need to provide any value as remove tag is an empty tag

Everything else in the code is same. Response is also similar to the register gateway response.

This is it for now!!! :)

Transparent JFrame using JNA

In Make JFrame transparent I had shown a way to making frame’s transparent using AWTUtilities class. But using that class results in access restriction compile time error, resolution in Eclipse is also shown in that post. Now here is the version using java natives. I have used Java Native Access (JNA) library to call native functions to get the things done.

What is Java Native Access (JNA)?

JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required.JNA allows you to call directly into native functions using natural Java method invocation.

The Code

import javax.swing.JFrame;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import com.sun.jna.platform.WindowUtils;

public class TransparentFrame extends JFrame {
   public TransparentFrame() {
      setTitle("Transparent Frame");
      setSize(400,400);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      JSlider slider = new JSlider(JSlider.HORIZONTAL, 30, 100, 100);

      slider.addChangeListener(new ChangeListener() {
         @Override
         public void stateChanged(ChangeEvent e) {
            JSlider slider = (JSlider) e.getSource();
            if(!slider.getValueIsAdjusting()){
               WindowUtils.setWindowAlpha(TransparentFrame.this, slider.getValue()/100f);
            }
         }
      });
      add(slider);
      setVisible(true);
   }
   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
	 @Override
	 public void run() {
	    new TransparentFrame();
	 }
      });
   }
}

Here WindowUtils class is provided in JNA jar (platform.jar). The method setWindowAlpha of WindowUtils class is used to make a window transparent. First argument of this method is your frame/window and second argument is alpha value. This class also has a method called setWindowTransparent, which can also be used to make window transparent .

Dependencies

You will need following 2 jars to run this program: (Both jar files are available to download on GitHub for JNA.)

  • jna.jar
  • platform.jar

To run above code on Windows, you will need to set “sun.java2d.noddraw” system property before calling the WindowUtils function.

System.setProperty("sun.java2d.noddraw", "true");

Output

Additional Notes

I have tested this code on following machines:

  • Windows XP service pack 3 (32 bit)
  • Windows 7 (32 bit)
  • Cent OS 5 (32 bit)

If you test it on other machines or have code for other machines using JNA for the same functionality then feel free to share it as comment to this post.

Trying Architexa for the first time

Architexa is a really useful tool for generating UML diagrams for Java projects in Eclipse. Most UML tools out there give you functionality of generating classes from the diagram you have created. But in Architexa you have a reverse functionality; it generates diagrams from existing code.  It helps a team to understand and document collaboratively a large Java code base. Starting from today, Architexa is available for free for individuals to use, and this post talks about my experience using it – how I used it?, which features I used?, and what I think of it?

Why should one use Architexa?

If the answer to any of following is yes for you then you should go for Architexa:

  1. Working with a new project or difficulty in introducing an existing product to a new team member.
  2. Finding it hard to understand the architecture of your code.
  3. Exploring unfamiliar code to determine its dependencies, relationships, interactions, and behavior within a codebase.
  4. Trouble finding a starting point in a large codebase.
  5. Wasting time deciphering complex code or documenting about code.

If your answer to any of the above questions is YES then you must go for Architexa. It will handle all these difficulties for you. Architexa helps you create UML diagrams directly from the code in just a single click. So making UML diagrams is way easier than before. It can create layered-diagrams, class, and sequence diagrams. These diagrams become the base for effective discussions and act as useful documentation for the project. Architexa allows you to add and edit Java Doc from code and other notes right next to the diagram.

My experience with Architexa:

(How I used Architexa?)

 

 

As do many other Java developers out there I also use Eclipse as an IDE for Java development and face some of the issues listed above in development due to lack of documentation about the project. I was already using an Eclipse tool/plugin for UML diagrams in Eclipse, but that tool was only very helpful if you are the one who starts the project. If you have been given a project that is already developed and does not have enough documentation to understand its flow and code then that tool doesn’t help me much.

About few days ago I got an email about Architexa, a tool for generating UML diagrams for Java projects in Eclipse. At first it looked like a normal tool of generating UML diagrams and I thought why download and use it as I was already using a tool to do same thing? But then I came to know about its functionality of directly generating UML diagrams from the existing code and this feature forced me to try Architexa once. And as I was expecting this is really a great and helpful tool for understanding the top level architecture of a large project. And as an advantage it provides functionalities of sharing diagrams or exporting diagrams as pictures.

I tried Architexa with one of our currently on-going projects and I would like to share my experience about how I used this tool and what features I liked most. I have written how I installed it and used it. I have listed what features I liked and used and would like to suggest you use those features. I have also written suggestions from my side that I would like to see in the product.

Download and Installation:

Download and installation of Architexa is very easy. One can start this procedure by registering on their site here: http://www.architexa.com/start. This registration is required as when you complete the installation it asks for this registered username and password. After this registration steps complete it will take you to the page where you find information on how to install Architexa on your Eclipse, which is also easy understandable and easy to follow. You also have to follow an email verification process which I guess is a very known and common practice to protect from spam and everybody is familiar with it. We have also installed extended features and the in-house group server to see how they all works together.

Generating my first diagram:

Before generating diagrams you first have to configure Architexa indexing. You can configure it after successful installation and account validation or later in Preferences.  After this configuration you are ready to generate diagrams.  You will see a Cheat Sheets view of Architexa when you install it, where you find and explanation of steps to get started with the different capabilities of Architexa.

Layered-diagrams:

To generate a layered-diagram, you just have to right click on project and select Open in diagram->Layered diagram. Layered diagram gives a good representation of project packages and dependencies between them. It’s a good diagram to have a quick overview of the project. It is very good in displaying a particular classes’ dependency from a package view, and how packages are dependent on each other. Some features that I used and liked in layered diagrams are:

  • Size of the module is drawn based on code inside it and they are also placed in layered style such that higher layered modules are dependent on lower layered modules. When you hover on any class or package it shows it’s dependencies by arrows to other class and/or packages.  Also those packages are highlighted to get proper focus on it. It helps us to decide which modules will get affected if do change in a module.
  • Double clicking on packages will show the classes and packages inside it.
  • You can easily add new packages, classes, general connections, actor, database and/or comments directly from this diagram.

Class and sequence diagrams:

Generating class and sequence diagrams is also easy, right click on some class then click on Open in diagram->Class diagram or Open in diagram->Sequence diagram.  When you do this it draws a diagram with only one selected class, no any other classes to make it messy. Now you can add things you need by dragging and dropping classes or by exploring class members/methods and their dependencies. Also it uses icons for classes, members and methods that Eclipse uses, so it becomes easy to understand it.

A sequence diagram is a good representation of call hierarchy of methods or members of a class. By this you can easily see which methods/members are called and used by which other classes. To demonstrate the possible flow of control that a system could take depending on various conditions or tests, Architexa displays loops, iterations, and conditional statements in sequence diagrams.

A class diagram gives information about relationships and dependencies of classes with each other. It gives an overview of which class inherits from which class or what classes subclass it. Some features that I used and liked are in these diagrams are:

  • You can easily go to the code of particular class or method by just double clicking on it.
  • You can add new methods and/or members to a class. You can also add method call, inheritance, method override, actor, database, comments in these diagrams.
  • In sequence you can see differences in a file if 2 or more members of a team are working on same file. It shows difference in the diagram which is in my opinion a very cool feature.
  • Sequence diagrams are also integrated with the debugger.

Sharing diagrams:

Architexa provides a functionality to share created diagrams to team members. To share diagram you have to create a group on its server. By sharing diagrams your team members can easily access the documents whenever they want to. Creating groups is also easy, I have created a group from the website, but one can also create it from Eclipse. After creating a group you have to save your diagram in it. When you press CTRL + S to save a diagram it will open a dialog with 3 options:

  1. Save diagram on local disk
  2. Save diagram on private server
  3. Save diagram on community server

3rd option is for saving a diagram on their server. When you click on it, you will see Upload to server view. Here you can give it a name and choose a group to share this diagram with.

The other way to share is by email. I have not tried this functionality yet and so am not able to write much about it.

Some suggestions:

  1. In layered-diagram, if I drag and drop packages then sometimes it results in duplicate packages in the same group.
  2. In layered-diagram, sometimes an empty group of packages gets hidden and sometimes it stays visible.  Not sure if it’s intended but it doesn’t look consistent to me so would like to see a change in this.
  3. Diagrams also include method calls to Java’s default classes like Map or String. What I think is generally people don’t want to know about these classes and calls to methods of these classes as they can be considered as a part of the implementation and not documentation. It’s a part of how one has done the task. Everything else in this diagram is cool.
  4. Fonts used for class names in layered diagram are quite bigger relative to package names; it will be good if it can become smaller.
  5. If you close Eclipse without saving the diagrams, it doesn’t notify or alerts you about first saving diagrams and then close Eclipse. It should alert if one is closing Eclipse without saving diagrams.

Summary

Architexa is a good tool for UML diagrams in Eclipse for Java development. It is very  easy and simple to use. Once a class is in a diagram, it is always kept up to date so no need to refresh diagrams every time you change something. And the graphs are also very readable. If you have a large team in which members keep getting changed or you are the one who is responsible for understanding already written large codes then this is the must-use tool for you. Currently Architexa is only available for Java. Though they also have a prototype for C/C++. If you have used it for a new project from the beginning then it will become very easy to document your project, share the diagrams, code change reviews, and much more.

Architexa also has many other features that I have not used yet. For more information on Architexa visit their website: http://www.architexa.com/

Follow

Get every new post delivered to your Inbox.

Join 69 other followers

%d bloggers like this: