Java IoT Authors: Elizabeth White, Liz McMillan, Yeshim Deniz, Zakia Bouachraoui, Pat Romanski

Related Topics: Java IoT

Java IoT: Article

Advanced Source Control In VisualAge For Java

Advanced Source Control In VisualAge For Java

For software developers source code is more than just files on a disk - it's the result of hours of thought and work and must be protected. If you look at the number of software tools available to help developers track and store their source code, you'll see that code protection is a key part of any serious software development effort.

A software configuration management (SCM) tool is as important as a compiler or debugger, but as any experienced developer can tell you, getting your favorite tools to work together isn't always easy - especially when they're from different companies.

VisualAge for Java version 3.5 includes an External Version Control (EVC) tool that interacts with external SCM systems. Each project in VisualAge for Java can be associated with an SCM system (called "adding a project to version control") and a specific group of files in the SCM system's source code. Once you've added a project to version control, you can add classes to your SCM systems, check classes in and out of the system, and import the most recently checked-in version of a class from the SCM system into the Integrated Development Environment (IDE).

In Part 1 we discuss the following:

  • Using the team server instead of the EVC tool
  • Automatic versioning of your SCM files
  • Merging changes
  • Working with class groups and resource files

In Part 2 we'll continue with a discussion on path prefixes and refreshing your SCM files in the IDE.

Using the Team Server Instead of the EVC Tool
VisualAge for Java, Enterprise Edition, includes a team server (EMSRV) that enables you to share your code with other developers through a shared repository. One of the biggest decisions a development team needs to make is how to manage its source code: Should it use the team server, the EVC tool, or both?

The VisualAge for Java repository is inseparable from the IDE and is at the heart of most functions offered by the product. However, developers don't need to learn its SCM role if they're using another SCM tool. If you prefer a third-party SCM tool, you can use a local repository instead of the shared repository.

There are certain advantages to using only a local repository and the EVC tool:

  • Less administration for the team (no team server required)
  • No confusion about the location of the source code's most current version
  • No confusion about source management processes
  • More mobility since users can work disconnected from the network
  • Less training for new developers since there's only one paradigm to learn

However, there are several reasons why developers may also wish to use a shared repository:

  • Developers working on multiple teams may need to access both versioning systems.
  • Code libraries may be more efficiently stored on a common server.
  • Access to code previously stored in a repository might be necessary.
  • Personal preference.
  • Easy code-sharing capabilities.

There's no single right answer. The decision of which method to use depends on the characteristics and requirements of your development team.

The remainder of this article assumes that an external SCM tool will be used by the development team, and discusses how VisualAge for Java's EVC tooling bridges the gap.

Automatic Versioning of Your SCM Files
Every time you use the EVC tool in the VisualAge for Java IDE, the SCM files you're working with are automatically versioned, and new copies of those files are created in the VisualAge for Java repository. Also, before actions such as refreshing and checking out are performed, all the SCM files that are being modified are automatically versioned and named.

Versioned copies of your code can be very useful. If, for example, you refresh your project and accidentally replace a file you've changed with another unchanged version from your SCM system, you can simply replace the new version in the workspace with the older version from the repository using the Replace With > Another Edition menu item.

Although developers using the tool don't need to worry about the internal versioning that occurs, the tool itself relies on this information to track changes and determine courses of action during processing.

Merging Changes
Checking out source code before making changes is good programming practice when working with most SCM tools that are accessible via EVC. It lets teammates know you're modifying a file so they don't try to make simultaneous changes. Unfortunately, this rule is often broken. For example, a developer who needs to fix a bug while flying to a customer site doesn't typically have a connection to the LAN to check out the file before making changes. Whatever the reason, the bottom line is that conflicts will happen and merging will be necessary.

You can modify the source code for a project associated with an external SCM tool even if the code has not been checked out yet. The edits are allowed and you're reminded that you didn't check out the source yet. In addition, the status icon beside the filename shows a warning symbol. If it's necessary to check in the changes later, you can check out the file, resolve any conflicts, and then check in the code.

You can merge the code of an older version of a file with the code contained in a newer version. For example, you can import a file into the IDE without checking it out, then edit it and save your changes. If you then decide you want to check the file out from your SCM system but don't want to lose your changes, simply check out the file, compare the new and old versions, and merge any changes.

If you check out a file that someone else has changed, the difference is detected and you're asked how you want to proceed. You can either ignore the changes, leaving your source in the workspace, or you can ask to load the most recent version. This is where the automatic versioning comes in handy. Loading the new code will replace your changes, but they're safely versioned in the repository. Using the IDE's "Compare With" functionality, you can bring your modifications into the current source code and check in a properly merged file without accidentally deleting your co-worker's efforts.

Working with Class Groups and Resource Files
In the VisualAge for Java IDE you can elect to work with files on an individual or group basis. For example, if you wish to check in only a few files for a project, select those files and check them individually into your SCM system. If, however, you wish to check in all the files contained in a particular project or package, select the project or package and check in all the contained interfaces and classes at the same time.

However, any resource files associated with the selected project or package won't be checked in. Since resource files are not actually contained in projects or packages (they're only associated with them), any SCM actions you perform at a project or package level won't affect them. Instead, you must work with the files separately in the Resources page of the Workbench or Project browser.

Managing source code is an essential part of the development cycle, and there are many configuration management systems available to help you store and manage your code. However, because there are so many systems available, developers must not only decide which tool is best for them but also how that tool can work with their other development tools.

The EVC tool in VisualAge for Java version 3.5 enables you to manage your source code from within the IDE and work with many external configuration management systems. This allows you to enjoy the benefits of your SCM system while still taking advantage of VisualAge for Java's powerful development environment.

In Part 2 we'll continue this topic with an article on path prefixes and refreshing your SCM files in the IDE.

More Stories By Tim deBoer

Tim deBoer currently develops tools to build applications that run on WebSphere Application Server. He previously worked with the VisualAge for Java Technical Support group, providing support to enterprise developers working with VisualAge for Java.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

IoT & Smart Cities Stories
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
SYS-CON Events announced today that IoT Global Network has been named “Media Sponsor” of SYS-CON's @ThingsExpo, which will take place on June 6–8, 2017, at the Javits Center in New York City, NY. The IoT Global Network is a platform where you can connect with industry experts and network across the IoT community to build the successful IoT business of the future.
CloudEXPO New York 2018, colocated with DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
Disruption, Innovation, Artificial Intelligence and Machine Learning, Leadership and Management hear these words all day every day... lofty goals but how do we make it real? Add to that, that simply put, people don't like change. But what if we could implement and utilize these enterprise tools in a fast and "Non-Disruptive" way, enabling us to glean insights about our business, identify and reduce exposure, risk and liability, and secure business continuity?
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
DXWorldEXPO LLC announced today that Telecom Reseller has been named "Media Sponsor" of CloudEXPO | DXWorldEXPO 2018 New York, which will take place on November 11-13, 2018 in New York City, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
To Really Work for Enterprises, MultiCloud Adoption Requires Far Better and Inclusive Cloud Monitoring and Cost Management … But How? Overwhelmingly, even as enterprises have adopted cloud computing and are expanding to multi-cloud computing, IT leaders remain concerned about how to monitor, manage and control costs across hybrid and multi-cloud deployments. It’s clear that traditional IT monitoring and management approaches, designed after all for on-premises data centers, are falling short in ...
The deluge of IoT sensor data collected from connected devices and the powerful AI required to make that data actionable are giving rise to a hybrid ecosystem in which cloud, on-prem and edge processes become interweaved. Attendees will learn how emerging composable infrastructure solutions deliver the adaptive architecture needed to manage this new data reality. Machine learning algorithms can better anticipate data storms and automate resources to support surges, including fully scalable GPU-c...