The ‘Types They Are a-Changin’
May 18, 2016PSG PDF API Moves to GitHub
May 28, 2016Developing traditional Synergy (and Synergy .NET) in Visual Studio
Have you ever had one of those crazy product or feature ideas that starts gaining incredible traction very quickly? When you ask enough “what-ifs” of your product set, it’s bound to happen eventually. Late last October, the Synergy DBL Integration for Visual Studio (SDI) team came up with one of those ideas. The team presented it at the Synergy/DE Summit in November, and it has since taken on a life of its own. In this article, I would like to introduce this new SDI feature: support for traditional Synergy development in Visual Studio.
Visual Studio is a very big name in developer communities. Microsoft’s flagship development product is widely known for having some of the best developer-facing experiences available, with features such as IntelliSense, a very mature editor, formatting tools, sophisticated dependency-based build functionality, and extensibility.
With SDI 10.3.3, scheduled for release next week, we are pleased to announce that you can now do both your traditional Synergy development and Synergy .NET development in Visual Studio. Keep in mind that this is an initial release, so the functionality is still evolving. For example, to debug your traditional Synergy applications, you will continue to use the standard Synergy debugger outside of Visual Studio.
Working in Visual Studio
Developing Synergy Code in Visual Studio
It’s one thing to get Visual Studio working with traditional Synergy projects, and it’s another to make this new functionality usable. An important part of solving the multiple IDE problem has been constructing a consistent, intuitive experience in Visual Studio that balances traditional Synergy paradigms with standard Visual Studio constructs.
To this end, we have created traditional Synergy project types and tools that are similar in name and function to what is already available in Workbench. But where appropriate, these items have been redesigned to have a decidedly better interface for Visual Studio. For instance, the Synergy/DE Options dialog in Workbench has been refactored into Compile and Build property pages in the Visual Studio Project Designer. And you won’t find a separate Prototype configuration page in Visual Studio because the functionality is handled entirely by our implementation of the build tools.
Moving Workbench projects to Visual Studio might be enough for those of you who build your sources separately from the editing environment. But we wanted to make the experience complete, so we made the new project types buildable with MSBuild inside and outside of Visual Studio. Each traditional Synergy project is a separate buildable entity that ties into the dependency build system. Project references between traditional Synergy project types are supported, so you can use the familiar Reference Manager dialog in Visual Studio to add project references or individual library file references and let SDI detect changes and build the dependencies. We have also ensured that traditional Synergy projects can coexist with Synergy .NET projects in the same solution. This enables you to group projects together, even if they don’t actually depend on each other.
If you are familiar with Workbench and want to start developing traditional Synergy applications in Visual Studio, keep in mind that Workbench and Visual Studio are very different editing environments. The learning curve is not particularly steep, but one point of confusion you’ll encounter immediately will be the differently-named features and different default key bindings. For instance, Workbench has functionality that looks very similar to the IntelliSense feature in Visual Studio, but the Workbench implementation is split between two features called Context Tagging and Auto-Complete. A little experimentation and remapping a few key bindings might go a long way in bridging the gap and easing your transition to Visual Studio.
Project types for traditional Synergy
As stated above, the traditional Synergy project types we’ve added to Visual Studio are based on Synergy project types in Workbench. The templates for these new project types should make it easy to create projects for libraries or applications.
Traditional Application (DBR)
The Traditional Application project type is equivalent to the Synergy/DE Application project in Workbench and closely resembles a Console Application project for Synergy .NET. Essentially, a Traditional Application in Visual Studio produces a single DBR executable and provides a single entry point for running and debugging.
Executable Library (ELB)
The Executable Library project type is equivalent to the Synergy/DE Executable Library (ELB) project type in Workbench and is similar in functionality to the Class Library project type for Synergy .NET. An Executable Library project in Visual Studio includes one or more subroutines, functions, or classes to form a library of usable types and routines that can be linked to and referenced by other libraries or applications.
Object Library (OLB)
The Object Library project type is equivalent to the Synergy/DE Object Library (OLB) project in Workbench. An Object Library in Visual Studio includes one or more subroutines, functions, or classes to form a library of object files that can be linked to and referenced by other traditional Synergy libraries and applications.
Unlike an ELB project, source modules in an OLB project are built individually before being added to the library, and you can rebuild individual sources without rebuilding all sources in a library. Using a Visual Studio “Build” option with this project type will build only source modules that have changed or been added since the last build operation. “Rebuild” builds all. So, for example, if you remove a source module, you’ll need to use the “Rebuild” option to make sure that the library is rebuilt from scratch.
Multiple Mainline (DBR)
Last, but not least, we’ve added a Multiple Mainline project type, which is similar to a type of project you can get in Workbench by changing some project options for the Synergy/DE project type. This project type enables you to create a project that houses dozens, hundreds, or even thousands of mainline applications that have identical build requirements (a common scenario in traditional Synergy). Rather than creating an individual Traditional Application project for each mainline program, you can create a single project and then build all the mainline programs in a single “Build” action. As with an OLB project, when you build a multiple mainline solution, SDI can fairly accurately determine which projects need to be rebuilt, rather than rebuilding all programs whenever one program changes. A “Rebuild”, on the other hand, forces all programs to be rebuilt. And we’ve added a third build option, a “Build” context menu entry for rebuilding and running an individual program from the Visual Studio Solution Explorer:
Fellowship of the
In addition to the project types and tools we’ve added to SDI, keep in mind that you now have access to the thriving ecosystem of extensions and external tools available for Visual Studio. From replacement diff systems, to enhanced editor experiences, to key binding presets (Vim emulation users rejoice!), most of the Visual Studio environment can be extended and improved. You will also be able to make use of Visual Studio’s source control integration to manage source code and projects.
There’s one aspect of this new functionality that we haven’t touched on in this article: migrating existing traditional Synergy projects into Visual Studio. That subject will be addressed in an upcoming issue of Synergy-e-News, but you can get started sooner by attending the workshop on this topic that follows the upcoming Synergy DevPartner Conference. Bring your traditional Synergy projects to the workshop, and we’ll work through the process of migrating them to Visual Studio together.
Bugs shall not pass!
Since the first release of SDI and Synergy .NET, we have endeavored to open the door to Synergy development in Visual Studio (and the entire .NET Framework). And in the few years we’ve had SDI, those of you who have adopted it have given us great feedback and helped us improve the developer experience with Visual Studio. We have already released over 1,100 work items for new development and bug fixes. Now you can help us improve this new functionality by letting us know about your experiences using traditional Synergy in Visual Studio. Remember, this is a new product, so all comments and questions are welcome.