Posts Tagged ‘ Java ’

Designing Scalable Code Generators for very large Java Projects

Model-driven development is increasingly applied in large industrial projects. When java is used as the target language, some language details have to be considered that do not make any difference in conventional implementation. It is also necessary to take them into account when deciding between code generation and runtime interpretation. In order to make the generators scalable it is important to keep their execution times low. Furthermore, they need to be designed in such a way that changes to the source models result in localized and traceable effects in the generated code. This can be achieved by respecting some basic design rules during development of the code generators.

Continue reading

Create Event Handlers for WPF frontends in Java

In one of the previous posts I showed how a WPF frontend can be controlled by a Java application. Furthermore, I demonstrated how proxies can be generated automatically that allows for more convenient way of programming the Java part. However, there is no way so far, to handle interaction of the user with the WPF frontend in the Java backend. This posts demonstrates the basics for such an implementation.

It uses the existing socket communication to send an event to the Java program whenever a relevant user interaction with the WPF frontend occurs. The java program interprets the received event and calls the corresponding handler that is selected depending on the type of event. Thus, to determine which event handler is to be called the type of event need to be set during modeling the user interface in XAML. To enable this, we will introduce a new attached property available to all controls.
Continue reading

Remote Control a WPF Frontend from Java

Windows Presentation Foundation is a powerful framework for building rich user interfaces that comes with great GUI builders. However, for creating the application logic WPF requires to use one of one of the .NET programming languages such as Visual Basic or C#. Java, also a great programming language for writing application logic, is not supported.

This post describes how to connect a an application written in Java to a WPF based user interface.

The solution uses socket communication, allowing to separate the user interface and its computation logic into different processes or programs. This can be necessary, if they are implemented in different programming languages. Furthermore, it allows to run frontend and backend on different machines or processors.
Continue reading