Building Windows 8
As Microsoft’s new Build Windows conference draws ever closer the rumor mill about what the focus of the conference will be is gathering momentum. This is due in no small part to the fact that with the conference only two weeks away there is still no published agenda. But that doesn’t seem to have deterred people from attending, I would estimate that there are generally over 10,000 delegates at these events, and this conference has been sold out since early August!
That being said it’s not too hard to figure out from the name of the conference that the focus will be on the next version of the Windows operating system, which Microsoft have “code named” Windows 8! What might be a surprise to a lot of people however is the scale of the change that is on the way next year, because from all available information it’s looking like the default Windows 8 experience will be VERY different from anything that Windows users have experienced in the past.
This suspicion was confirmed recently when Microsoft posted a video entitled “Building Windows 8 – Video 1” on one of their development team blogs. The video was also uploaded to YouTube, and I’ve embedded it in this post … take a look:
As you can see the default Windows 8 experience is very different, and is sure to bring some new challenges for developers who want to deploy applications that take advantage of the new capabilities of the platform. From Microsoft’s demonstration it is clear that traditional Windows applications will continue to be supported, so there is no need to panic, but as software developers we all need to be thinking about how a change of this magnitude could affect our businesses.
For some time now Microsoft has touted WPF and Silverlight as the flagship technologies of choice for building UI’s for .NET applications. But with Windows 8 is all that about to change? The video makes it clear that the primary UI technologies used to build Windows 8 applications are HTML5 and JavaScript, neither of which have a particularly strong toolset presence in Visual Studio 2010. So for many of the developers at the Build Windows conference the main question will be “what’s new in Visual Studio 2012 and .NET Framework 4.5 that will help me build applications for Windows 8?”.
Clearly Microsoft believe that mobile and tablet devices are going to become far more predominant in the future, and are actively planning for this by merging the various operating systems that are used on the various types of computing platforms. And of course they are not alone in this endeavor as Apple’s recent release of OS X Lion also somewhat takes this approach, although not quite to such a radical degree.
Of course there is another group of people who also have a bunch of work to do, and that’s the hardware vendors. If Windows 8 is to be successful one would assume that the default for personal computer and laptop screens will need to change to be predominantly touch-enabled devices. While it is clearly stated in the video that the new UI will work just fine with a mouse and a keyboard, I for one am very skeptical about how WELL it will work in that mode! And of course the availability of the hardware is only a part of the story … we must also consider how long it will take companies to replace existing hardware with new touch-sensitive devices.
Now don’t get me wrong … I’m not suggesting for one minute that there will be a big rush to do so, and I’m absolutely suggesting that a major change of this type could take many years … but for some of us, with certain types of applications, in certain market places, adopting these new capabilities could offer significant rewards.
By the way, I’m not a betting man but I’d lay good money on the fact that there will be a setting to disable the new Windows 8 UI in favor of reverting to Windows 7’s Aero UI, and I’d also be comfortable predicting that many corporations will be doing just that. So again, don’t panic! While the new UI may make for a fabulous demo, and may be a fantastic way of interacting with photos and videos, and browsing the web, will it really provide a suitable platform for presenting business software to commercial users? Actually, in some cases the answer will be a resounding YES … but in other cases the more traditional approach to presenting applications will continue to be far more appropriate.
Of course in order for Synergy developers to be ready for Windows 8, Synergex must be ready first. I will be attending the Build Windows conference, as will three of my colleagues from the Synergy Development team. We’ll do our best to keep you informed about what we learn.
By the way, if you’re interested in keeping track of what’s going on with Windows 8 then a good place to start is Microsoft Development’s Building Windows 8 BLOG. The blog has some interesting articles, and already has several more videos discussing these new features.
In: Industry News · Tagged with: .NET, Events, HTML5, Industry News, Visual Studio, Windows 8
All Hooked Up. (Circa 1957, Elvis Presley)
Back in the day, Elvis Presley shook up a bit of a stir when his gyrating hips and dulcet tones came over the airways onto our little black and white TVs (so I was told, I’m not old enough!). Today, Synergex is defining a development that will shake the Synergy world when it’s released with an upcoming version! And it’s a development that we’ll all be hooked on.
In the specification phase at the moment is the ability to “hook” user definable logic against operations within the SDBMS file IO system. This proposal offers the ability to perform logic when any operations on any SDMBS file (index or relative) are executed.
For example, you can hook up a Synergy method that will be called “before” a record is read from a file, or before a record is stored into a file. A method can be hooked up and executed when a record lock is encountered, records deleted or updated.
The possibilities are truly endless. You could use this capability to debug your applications. For example, you may have a system that occasionally encounters corrupt data – and you have no idea when the data got corrupted. By implementing pre-store and pre-write event hooks you could validate the data and log to a file if it’s not valid. Because it’s a Synergy method, in the calling stack, you can use routines like MODNAME to record the full stack trace and pinpoint the problem.
Implementing hooks for the pre-store and pre-update events can allow you to ensure that default data is correctly set.
Hooking up post-events could allow you to record modifications to your SDBMS data that you wish to replicate somewhere – in a third party relational database for example. Or you could actually record the data being sent to a file for transaction/logging purposes.
All hooks will be on a per-channel basis, so if you currently have a generic file open routine you’ll be well placed to begin to implement this new exciting capability. If you don’t, now’s the time to start thinking of adding one!
One thing to remember, performance! Once you have bound a hook to an event then every operation of that type will cause your logic to be executed, so keep the code concise, specific and efficient!!
This development, for me, is on a par with the .NET API – it’ll open up a whole new world of possibilities. I can’t wait to get hold of the alpha release so I can blog about it, and watch out for the early videos showing you the full power of this great new development. And the best bit is that it’ll be supported on ALL platforms, so you won’t have to be a .NET guru to take full advantage! I can already feel an SPC session in the making.
I’m hooked, line a sinker!
In: Software Development · Tagged with: IO Hooks, Synergy 9.5
Hosting WCF Services in an ASP.NET Web Application
There are several ways that you can use Synergy/DE tools to expose WCF services, but regardless of which way you decide to create a service, the next decision you have to make is how to host it. By hosting a WCF service you expos the service and make it possible to use it from other applications. In this post I will introduce you to one way that WCF services may be hosted, via an ASP.NET web application and an IIS web server. In a later post I will show you how to host WCF services without this requirement for an IIS web server.
This is the third in a series of posts relating to the various ways in which Synergy developers can use of Windows Communication Foundation (WCF) when building their applications. The posts in the series are:
- Building Distributed Apps with Synergy/DE and WCF
- Exposing WCF Services using xfNetLink .NET
- Hosting WCF Services in an ASP.NET Web Application (this post)
- Exposing WCF Services using Synergy .NET Interop
- Self-Hosting WCF Services
- Exposing WCF services using Synergy .NET
A WCF service is simply a collection of one or more classes in an assembly, but the whole point of implementing a WCF service is to make those classes available to be used by other applications. And those applications will often be located on different networked systems from the service itself. So, in order for a WCF service to be useful, it needs to be “hosted” somewhere, and that somewhere needs to be available on a network.
There are three basic ways that WCF services can be hosted:
- Inside a Web application located on a Web server.
- Using Windows Process Activation Services (WAS). This mechanism was introduced in Windows Server 2008 and provides a mechanism for hosting WCF services without requiring a Web server.
- Services can be “self” hosted by some custom .NET application. For example, developers often host WCF services inside a Windows Service application.
In this post I will show you the basics of hosting a WCF service in an ASP.NET web application. In a future post I will go on to show how to self-host services.
Setting up basic hosting for a WCF service inside an ASP.NET Web application is very easy, but as Synergy .NET doesn’t have support for creating Web applications you’ll have to use another .NET language, either C# or VB.NET. However, don’t worry about that too much, because there won’t actually be any code in the Web application!
- Start Visual Studio 2010 and create a new ASP.NET application:
- From the menu, select File > New > Project.
- Under Installed Templates, select Visual C# > Web > ASP.NET Empty Web Application.
- Chose the name and location for your new Web application.
- Click the OK button to create the new project.
- Add a new WCF Service to the project:
- From the menu, select Project > Add New Item.
- Under Installed Templates, select Visual C# > Web > WCF Service.
- Enter the name for your new service. The name will be part of the service endpoint URI that the client connects to, so pick something meaningful. For example, if your service allows orders to be placed then you might name the service something like OrderServices.svc.
- Click the Add button to add the new service to the project.
You will notice that three files were added to the project:
In addition to the service (.svc) file that you named, you will see two C# source files. These files were added because Visual Studio provided all of the files that you would need in order to expose a new WCF service that would be manually coded in these files. But what we’re trying to do is host a WCF service that already exists in another .NET assembly.
- Delete the two C# source files by right-clicking on each and selecting delete.
In order to expose a WCF service that exists in another assembly, the first thing we need to do is add a reference to that assembly, to make the classes it contains available within the new Web application.
- From the menu select Project > Add Reference and then select Browse.
- Locate and select the assembly containing your WCF service and add a reference to your project.
- If the assembly you selected was created using xfNetLink .NET then you will also need to add a reference to the xfnlnet.dll assembly, as is usual when using xfNetLink .NET
You’ll need to know that namespace and class name of the WCF service in your assembly. If you can’t remember this that double-click on the assembly that you just referenced and then use Object Browser to drill into the assembly and figure out the names. All that remains is to “point” the service file at your WCF service class.
- Double-click on the service (.svc) file to edit it. You should see something like this:
Edit the file as follows:
- Change Language=”C#” to Language=”Synergy”.
- Change Service=”…” to Service=”YourNamespace.YourWcfClass” (obviously replacing YourNamespace and YourWcfClass with the namespace and class name of your WCF service).
- Remove the CodeBehind=”…” item … there is no code-behind, the code is all in the other assembly.
- Save the file.
So you should now have something like this:
If your service is based on an assembly created using xfNetLink .NET then you have one final configuration step to perform. You need to tell xfNetLink .NET how to connect to xfServerPlus. You can do this by using the Synergy xfNetLink .NET Configuration Utility (look in the Windows Start Menu) to edit the new web applications Web.config file. If your xfServerPlus service is not on the same machine as your new web application then you must specify a host name or IP address, and if xfServerPlus is not using the default port (2356) then you must also specify a port number. When you’re done, the Web.config file should contain a section like this:
That’s it, you’re done. You should now have a working WCF service!
- To see if the service has really been hosted, right-click on the service (.svc) file and select View In Browser.
You should see the service home page, which will look something like this:
If you see this page then your service is up and running. By the way, the URI in your browsers address window is the URI that you would use to add a “Service Reference” to the service in a client application … but we’ll get on to that in a later post.
Of course, all we have actually done here is set up a web application to host a WCF service, but we’re using Visual Studio’s built in development web server (Cassini) to actually host the service. If you were doing this for real then you’d need to deploy your new web application onto a “real” IIS web server.
We’re not done with the subject of hosting WCF services; in fact we’ve only really scratched the surface. One step at a time!
In my next post in this series I will show you how to Expose a WCF services using Synergy .NET Interop.
In: Software Development · Tagged with: .NET, ASP.NET, Silverlight, SPC, Synergy/DE 9.5, Visual Studio, WCF, Web Development, Web Services, xfNetLink, xfServerPlus
Exposing WCF Services using xfNetLink .NET
Following a recent enhancement to the product in Synergy 9.5.1, developers can now use xfNetLink .NET to create and expose Windows Communication Foundation (WCF) services. In this post I will describe how to do so.
This is the second in a series of posts relating to the various ways in which Synergy developers can use of Windows Communication Foundation (WCF) when building their applications. The posts in the series are:
- Building Distributed Apps with Synergy/DE and WCF
- Exposing WCF Services using xfNetLink .NET (this post)
- Hosting WCF Services in an ASP.NET Web Application
- Exposing WCF Services using Synergy .NET Interop
- Self-Hosting WCF Services
- Exposing WCF services using Synergy .NET
The basic approach is pretty easy; in fact it’s very easy. In 9.5.1 we added a new -w command line switch to the gencs utility, and when you use the new switch you wind up with a WCF service. I told you it was easy!
So, what changes when you use the gencs –w switch? Well, the first thing that changes are the procedural classes that are generated, the ones that correspond to your interfaces and methods in your method catalog, change in the following ways:
- Three new namespaces (System.Runtime.Serialization, System.ServiceModel and System.Collections.Generic) are imported.
- The class is decorated with the ServiceContract attribute. This identifies the class as providing methods which can be exposed via WCF.
- Methods in the class are decorated with the OperationContract attribute. This identifies the individual methods as being part of the service contract exposed by the class, making the methods callable via WCF.
- If any methods have collection parameters, the data type of those parameters is changed from System.Collections.ArrayList to System.Collections.Generic.List. Changing the collection data type is not strictly necessary in order to use WCF, but results in a more strongly prototyped environment which is easier to use, and offers more benefits to developers in terms of increased IntelliSense, etc.
The next thing that changes are any data classes, the ones that correspond to the repository structures that are exposed by the parameters of your methods, that are generated. These data classes change in the following ways:
- Two new namespaces are imported. These namespaces are System.Runtime.Serialization and System.ServiceModel.
- Each data class (which corresponds to one of your repository structures) that is generated is decorated with the DataContract attribute. This identifies the data class as a class which can be used in conjunction with a WCF service, and which can be serialized for transmission over the wire.
- Each public property (which corresponds to a field in the structure) is decorated with the DataMemeber attribute. This attribute identifies each property within the class as one which will be serialized, and as a result will be visible to client applications which use the WCF service.
By the way, if you use a Workbench “.NET Component Project” to create your xfNetLink .NET assemblies then there isn’t currently an option in the component information dialog to cause the new –w switch to be used. So, for the time being, what you can do is add the switch to the Workbench “Generate C# Classes” tool command line. To do this you would go into project properties for the component project, go to the Tools tab, select the “Generate C# Classes” tool, then add the –w at the end of the command line, like this:
We’ll be adding a new checkbox to the component information dialog in 9.5.3 later this year.
By the way, by using the gencs –w switch you make it possible to use the resulting classes as a WCF service, but you don’t have to do so … you can continue to use the classes as a regular xfNetLink .NET assembly also. Why would you want to do that? Well, I sometimes use gencs –w just to turn my collection parameters into generic lists!
I have submitted a working example to the Synergy/DE CodeExchange, contained within the zip file called ClientServerExamples.zip. Within the example, the following folders are relevant to exposing and consuming a WCF Service using xfNetLink .NET:
|
Folder / Project |
Description |
|
xfServerPlus |
Contains the Workbench development environment for xfServerPlus and the exposed Synergy methods. If you wish to actually execute the examples then you must follow the setup instructions in the readme.txt file. |
|
xfNetLink_wcf |
Contains the Workbench project used to create the xfNetLink .NET client assembly with the WCF attributes. |
|
3_xfpl_xfnl_wcf_service |
Contains the Visual Studio 2010 solution containing an ASP.NET web application used to host the WCF service, as well as three example client applications, written in Synergy .NET, C# and VB. |
So, the gencs –w command line switch you make it possible to use the resulting classes to directly expose a WCF service, but there is still the matter of how to “host” the service in order to make it accessible to remote client applications, and that’s what I will begin to address in my next posting.
In: Software Development · Tagged with: .NET, ASP.NET, Silverlight, SPC, Synergy/DE 9.5, Visual Studio, Web Development, Web Services, xfNetLink, xfServerPlus
Optimizing your Visual Studio 2010 Experience
Visual Studio 2010 is one of the best IDE’s I have ever seen and worked with, and provides, out of the box, a truly impressive array of tools to make developers lives easier and more productive. But, as good as it already is, there is still room for improvement.
Luckily Microsoft has provided an extensible platform and an easy way for people who develop extensions to be able to publish those extensions to developers. Check out the “Extension Manager” utility that you will find on the Tools menu.
The extension manager, as suggested by its name, provides a simple UI which allows you to locate, download and install all kinds of Visual Studio extensions. The actual extensions are hosted on-line at a web site called the Visual Studio Gallery. Some extensions are written by Microsoft, some by third-parties. Some provide additional functionality throughout Visual Studio, while some are specific to a particular language. Some add new project or item templates to Visual Studio, while others add complex capabilities in a range of scenarios.
Go take a look, there are a lot of extensions to choose from. If you’re looking for recommendations then personally I think that there are two extensions that no Visual Studio 2010 developer should be without … apart from the Synergy Language Integration for Visual Studio extension of course. You’ll find these extensions in the gallery, and if you sort the list by “Highest Ranked” then they should be close to the top of the list … they are VERY popular! My favorite extensions are both published by Microsoft, and both are free. They are called:
· PowerCommands for Visual Studio 2010
I won’t even attempt to go into detail about what these extensions do, because the list of enhancements is a long one. You can click on the hyperlinks above and read all about them in the gallery. Suffice it to say that if for some reason I wind up working on a system other than my own laptop, and these extensions are not installed, I miss them both terribly!
In: Development Tools
Building Distributed Apps with Synergy/DE and WCF
At the recent SPC’s in Chicago and Oxford several of the sessions that I presented were focused on networking, and in particular on the various tools and technologies that are available to Synergy developers to allow them to build and deploy distributed software applications. In particular I spent quite a bit of time talking about a technology called Windows Communication Foundation.
This is the first in a series of posts relating to the various ways in which Synergy developers can use of Windows Communication Foundation (WCF) when building their applications. The posts in the series are:
- Building Distributed Apps with Synergy/DE and WCF (this post)
- Exposing WCF Services using xfNetLink .NET
- Hosting WCF Services in an ASP.NET Web Application
- Exposing WCF Services using Synergy .NET Interop
- Self-Hosting WCF Services
- Exposing WCF services using Synergy .NET
What is WCF
WCF is a part of the .NET framework that provides a powerful and flexible way to implement network communication between the various parts of a distributed software application. For many years Synergy developers have been able to build distributed applications using xfServerPlus and xfNetLink. Many have done so, and have deployed a wide variety of applications based on these technologies. When developing a new .NET client application developers would use xfNetLink .NET to gain access to their Synergy business logic and data.
This approach has served us well over the years, will continue to do so, and is still the most appropriate solution in some scenarios. But in some other scenarios using WCF might now be more appropriate, and could help developers to broaden the capabilities of their applications in several key areas, some of which are:
WAN Communication
Because the communication between xfServerPlus and xfNetLink uses a custom protocol which operates on a “non-standard” port, it may not be appropriate for use over wide area networks and the Internet. The primary problem here is that there is a high chance that this communication would be blocked by firewalls, some of which may be outside of your control. WCF supports multiple network transport protocols, the most basic of which is HTTP. This means that it is designed with the Internet in mind, and is very suitable for implementing applications which communicate over the Internet.
Multiple Endpoints
Another advantage of WCF is that the same WCF service can be exposed via multiple “endpoints”, and each of these endpoints can be configured to use different communication protocols and mechanisms. For example a single service could be exposed via one endpoint which uses HTTP and SOAP which would be suitable for a wide variety of client applications to be able to access from anywhere (including via the Internet), while at the same time being exposed by a second endpoint which uses low-level TCP/IP communications and binary messaging protocols suitable for use by applications running on the same local network as the service, at much higher performance. A single client application could even be configured to dynamically switch between these endpoints based on the current location of the user.
More Client Options
When using xfServerPlus and xfNetLink, client applications must be written in a programming language which is able to use one of the supported xfNetLink clients (COM, Java or .NET), but because WCF services can be interacted with via “standard” protocols such as HTTP and SOAP there are many more client application possibilities, because almost all development environments and programming languages are able to use these basic protocols.
Asynchronous Support
WCF also provides the ability to easily support asynchronous communication between clients and servers. When a client application calls an xfServerPlus method the client must wait for the execution of the method to complete, and for any resulting data to be returned, before performing any other processing. Using WCF it’s easy to support asynchronous method support, where the client application can call a method and then continue with other processing, later receiving an event when the remote method has completed its operation and when any resulting data is ready for use. This approach can make client applications appear to be much more dynamic and responsive.
Bi-Directional Communication
In many distributed software applications interaction between the client and the server is initiated by some event in the client application which requires some subsequent processing in the server application. But in some situations it is necessary for the server application to be able to, at will, initiate some processing in the client application. Unfortunately xfServerPlus and xfNetLink don’t really address this use case, but it can be addressed with WCF, because WCF service endpoints can be “self-hosted” within any type of .NET application. This means that as well as a client application having the ability to interact with a WCF service on some server somewhere, the client can also expose a WCF service, which the server application (or in fact any other application) could interact with.
WCF is an extensive subject area, and in this BLOG I’m not even going to attempt to teach you about the specifics of using WCF. Instead I’m simply going to try to make you aware of some of the reasons that you might want to explore the subject further, and make sure that you know about the various ways that you can get started.
There are several ways that Synergy developers can utilize WCF in their applications, and I’ll briefly describe each of these mechanisms below.
WCF via xfNetLink .NET
In xfNetLink .NET 9.5.1 a new feature was introduced which gives developers a lot of additional flexibility in the way that they build their applications, or rather the way that they communicate between the various parts of the application. This new feature is enabled through a new command line parameter to the gencs utility (-w). When you use this new option, two things change.
When you use gencs –w, the first thing that changes is that various attributes are added to the wrapper classes that are created by gencs. These attributes in turn allow those generated classes (and the assembly that they are compiled into) to be directly exposed as a WCF service. Previously, if a Synergy developer wanted to expose a WCF service which in turn exposed their Synergy business logic and data, they have to manually “wrap” their xfNetLink .NET procedural and data classes in other classes which in turn exposed a web or WCF service.
The second change when using gencs -w is that any collections which are exposed by the application API are transformed from un-typed “ArrayList” collections, to more useful and flexible “Generic List” collections. This change will require a small amount of re-coding in any existing client applications, but results in a significantly enhanced development experience.
This mechanism is likely to be of interest to developers who already have an existing solution using xfNetLink .NET and xfServerPlus, and want to take advantage of some of the additional capabilities of WCF, or to developers who wish to expose a new WCF service where the server application exposes code running on a UNIX, Linux or OpenVMS server.
WCF via Synergy .NET Interop
Another way that Synergy developers can expose WCF services is via Synergy .NET’s “Interop” project. The primary purpose of an Interop project is to allow developers with existing xfServerPlus applications to migrate their existing Synergy methods to a native .NET environment. By adding their method source code to an interop project they are able to execute those methods directly in the .NET environment, instead of using xfNetLink .NET and xfServerPlus to execute the methods with traditional Synergy on a remote server.
The Interop project works by generating Synergy .NET “wrapper classes” for your traditional Synergy methods (subroutines and functions) and data structures (records). The external interface of these wrapper classes is very similar to that of the C# wrapper classes produced by xfNetLink .NET’s gencs utility. The primary goal of the Interop project is to allow developers to migrate existing applications from a mixed .NET / traditional Synergy environment to a 100% .NET environment, with only minor changes to the code of existing client applications.
When you create an Interop project in Visual Studio, one of the options that you have (via the project properties dialogs) is to “Generate WCF contracts”, and as discussed earlier in this article, the effect of this is to add various attributes to the generated wrapper classes so that they can be directly exposed as a WCF service.
So again, for Synergy developers, this approach can provide a quick-and-easy way to expose a WCF service based on existing code. Again, this approach is likely to be primarily of interest to those who already have xfServerPlus based applications running on the Windows platform.
WCF via Synergy .NET
Both of the previous approaches were primarily focused on those who already use xfServerPlus, and both provide an easy way to get started with WCF. However in both of the previous scenarios, the external interface of your WCF service is directly defined by the interface to your underlying traditional Synergy methods (subroutines and functions), and the WCF data contracts that are exposed are defined by the repository structures exposed by the parameters of those methods. So, while the WCF capabilities provided by xfNetLink .NET and by the Synergy .NET Interop project are easy to use, you don’t get full control over the exposed interface and data. If you want that finer level of control, or if you’re just getting started with server application development and don’t have existing xfServerPlus methods, there is a better way to go.
The third way that Synergy developers can leverage WCF is by using Synergy .NET to create an all-new WCF service with native .NET code. This task was possible in 9.5.1 when Synergy .NET was first introduced, but has been made much easier through the introduction of a new “WCF Service Library” project template in 9.5.1a.
Creating a new WCF service via a WCF Service Library is the way to go for developers who want to write an all-new service application, or who don’t mind a little extra effort to re-work some existing code in order to factor out some of the “wrapper” layers involved with the previous two approaches. As a result you will have full control of the resulting WCF service, and the contracts that it exposes.
Wrapping Up – For Now
So, as you can see, Synergy/DE is now providing you will all kinds of new and exciting things that you can do in your Synergy applications, and I firmly believe that WCF is one of the most important, and powerful. In the near future I will be writing several additional BLOG posts which will explain these three ways of exposing WCF services in more detail, and I’ll also try to provide more detail about WCF generally. So for now, be thinking about how your existing distributed applications are built, and what things you might wish to improve about them. Or be thinking about that all-new distributed application that you’ve wanted to get started on. If you’re thinking of enhancing or implementing a distributed application, then using WCF is almost certainly the way to go.
In: Software Development · Tagged with: .NET, SPC, Synergy.NET, WCF, Web Services, xfNetLink, xfServerPlus
Lights, Camera, Action!
Now, thinking that once the Synergex Success Partner Conference (http://spc.synergex.com) is over, and we are all sat basking in the glory of the survey results (thanks to everyone who filled them in – the cheques are in the post!), sipping alcohol-free Pina Colada’s, you couldn’t be further from the truth.
Once the conference is over, that’s when the real work begins. One of the first tasks if to begin the planning for next year’s conference – honestly. It takes a full twelve months to plan, organise and deliver the SPC. Reading the conference surveys helps us to first decide where to hold the conference. Sometimes suggestions like “Somewhere sunny, but don’t tell the boss!” are not the most helpful. Based on the feedback we receive we can also begin to sketch out a proposed agenda. The agenda is also heavily influenced by future developments which introduce new features and capabilities within the language – and there are some cool features in the pipeline so keep an eye on future blogs.
But before we can start next year’s planning, we need to complete the final tasks of this year’s conference, and that’s getting all the available information to everyone who attended.
The session slides have been posted on the Synergex web site. All code samples are on the Synergex Code Exchange, and based on feedback from the Chicago conference I’ve created videos for each of my conference presentations. So, light the lights check the sound levels and get the clapper board ready…
If you want to re-visit the User Interface opportunities presentation you can see a 20 minute video at
http://www.synergyde.com/services/education/product_video.aspx?video=ui_opportunities.
This video shows the evolution of a simple Synergy cell based program from the OpenVMS/UNIX cell based environment through the UI Toolkit, Windows and WPF, to a Native Synergy.NET desktop application. The same Synergy logic is then utilised in a Silverlight Browser based client and finally a Windows Phone 7 app!
Giving your User Interface a “New Lick of Paint” is possible with Synergy and WPF. There are two presentations on this subject, and really need to be viewed in order. The first is “What, Why and How of MVVM” (http://www.synergyde.com/services/education/product_video.aspx?video=what_why_and_how_of_mvvm). This video takes you through the basics of the Model, View, ViewModel design pattern and how to implement it within your existing Synergy applications.
The second video is called “Building Targeted UI’s” (http://www.synergyde.com/services/education/product_video.aspx?video=building_targeted_uis). This builds on the first MVVM video and demonstrates what you can begin to achieve with your new Synergy based WPF applications.
My final SPC 2011 session was titled “Cool Framework Features”. During the presentation I demonstrated some simple ways to enhance your existing applications with .NET
framework features, and there are two videos to show you how. The “Cool Framework Features – PDF” (http://www.synergyde.com/services/education/product_video.aspx?video=cool_framework_features__pdf) video shows you how to fully automate the production of PDF documents using a printer driver called Win2PDF, the Synergy Windows Printing API, and the Synergy .NET API to set Windows Registry settings.
A second video from this session is called “Cool Framework Feature – XML” (http://www.synergyde.com/services/education/product_video.aspx?video=cool_framework_features__xml). This video shows how to implement the .NET Validating XML parser into your Synergy applications to load, parse and
validate an XML document given a XML schema.
Take a look at the videos and let me know what you think. If there are any subjects you’d like to see covered either at the SPC or even in video format please let me know.
In: Software Development · Tagged with: .NET Assembly API, OO Programming, Silverlight, SPC, Synergy.NET, Visual Studio
Shameless plug
I’ve just come back from the UK, where Richard Morris and myself attended DevWeek 2011. The DevWeek conference was hosted at the Barbican center in London, and covered a multitude of various Microsoft / Windows technologies. As it wasn’t hosted by Microsoft, there were no significant goodies/toys given away, but we did gain a lot of great info on developing state-of-the-art user interfaces, and lose a few pounds climbing 4 flights of stairs between sessions.
After the conference, Richard and I visited a couple of customers and had planned to spend a couple of days performing analysis work for a prospective PSG project. However, a few hours into this analysis task, we got a cry for help from another UK customer that Richard had been working with.
This customer was in the process of moving their application from OpenVMS to Windows. They had already moved the executables to Windows and were using xfServer to access the data on OpenVMS. Over the weekend that followed DevWeek, Richard had helped them do a test migration of the data from OpenVMS RMS files to Windows SDBMS isam files, and it all appeared to be working fine. However, during their testing, a few files were showing spurious data in a few fields – hence the cry for help.
It turns out that the bad data was actually caused by integer fields, that everybody had assumed were decimal fields. Now, when you unload data files, most people just use the standard isload/fconvert (or Convert on OpenVMS) to generate a sequential file, which works great for Synergy alpha and decimal fields, but when you have integer (aka binary) fields, regular sequential files no longer “cut the mustard”. One of the issues you have to deal with is this. If you have an integer field that contains the value 13, (aka a Carriage Return character) in a sequential file, the operating system assumes that it’s an end-of-record character and treats the record as truncated. So now the next part of the same record is now treated as a new truncated record, and you have two “bad” records in the file, instead of one “good” one.
The way to resolve this class of issue is to use a “counted” file. This is a special form of sequential file where the length of the record is included with each record, so when re-loading data, the application knows how many characters there are in the record, and it will ignore any “spurious” control characters in the middle of the record. Job done, you would think, but no. Being OpenVMS it wasn’t as simple as that, as we also had to use the OpenVMS Convert utility to change the sequential file into a stream file, so we can preserve the file as a counted file after it was FTP’d to Windows.
With Synergy version 9, the language supports several new data types (e.g. boolean, enum) which are really integer fields, so if you start to store these new data types in your Synergy DBMS files, you need to start using counted files, instead of regular sequential files when loading/unloading data. Fortunately, (in this case) both OpenVMS and Windows are little endian systems, so there was no issue about changing endian type, but this is something that you may need to consider, should you consider moving integer data between systems.
Now, to come back to the topic I started with of “attending conferences” (and to issue a shamless plug), if you come to the 2011 SPC in Chicago or Oxford, you’ll be able to hear all about managing binary data in Synergy DBMS files.
Hope to see you there.
In: Events · Tagged with: DevWeek, SPC
Free Stuff!
It’s a rare occasion where anything is truely free. Most of the time it’s simply a way for a marketing company to obtain information about you, so they can provide (or bombard) you with information about products that you have no interest in purchasing. However, there are some occasions when “free” really does mean that there’s no additional cost. The Synergex CodeExchange is (IMHO) one of those gems.
In may last blog, I discussed the process of validating a large number of the CodeExchange submissions with Synergy 9.5 and Synergy for .Net. In this blog, I want to highlight a couple of new submissions that you may find useful.
SynArrayList – this submission contains a couple of subroutines that allow you to sort an ArrayList in Synergy, either using a bubble sort or dynamic memory/qsort. You probably won’t need to use both methods of sorting, but they provide code examples to allow you to create custom sort routines of your own. This submission also contains an example of extending the ArrayList class, and creating a new class that processes Synergy alpha types natively. This allows you to avoid the requirement to box/unbox your alpha variables as you process a collection. Of course, the underlying arraylist still requires object types, but you don’t have to be concerned about that. And it has sort() and reverse() methods and some other ArrayList method that are part of the ArrayList class in .NET
SourceTree – this submission builds a utility that will parse your source code, and generate a data file that records the subroutine/functions in your application that call other subroutines/functions. This allows you to create documentation on where routines are used in your application. It can also be used to generate a list of routines called by a particular subroutine/function/mainline and all the routines that are called by those routines.
I’m also working on some other CodeExchange submissions – examples include a file I/O class and a utlity to create the xfNetLink attributes that can decorate your code. Watch this space!!!
In: Development Tools · Tagged with: .NET, OO Programming, Tips & Tricks
The Final Chapter
Using Synergy in all aspects of a new WPF based development is really quite exciting. But when you start to bring in code that was written many years ago you really begin to see the power of a truly cross platform capable development environment.
The task I started while working with White Knight was to create a simple application that managed the communications with their customer base – basically a very simple CRM system. The brief was to have a great looking windows desktop application and write it in Synergy – oh, and use all their existing library routines, data layout include files and database files.
And the solution, if you’ve followed my earlier blogs, was to utilise the new 9.5 release of Synergy. With Synergy 9.5 we have the Visual Studio Integration which, in a nut shell, is Synergy language inside the powerful Visual Studio development environment. Using this environment we can craft our user interface utilising WPF controls and Synergy language to bind to our data classes. So, that’s the UI sorted.
Using the Synergy .NET API I can continue to use my existing Synergy language routines to load my new WPF UI Library, and manage the data communication between my program and the UI controls using WPF’s powerful data binding techniques. So that’s the existing program logic and data access sorted.
And the results:
A fully functional UI, all written in Synergy and XAML (the WPF portion of the UI) managing our SDBMS data and Synergy business and validation logic.
So what about your application? If it’s in need of a bit of a user interface upgrade, download the latest 9.5 release of Synergy and let your imagination run wild. You’ll be surprised just how much you can do in a short space of time.
As we head towards the end of 2010 we’ve already started our plans for SPC2011 – watch this space for details! I’m really excited about the prospect of presenting these great new capabilities that Synergy offers. I can’t believe how quickly this year has gone by. I hope you all have a great holiday season and here’s to a bright WPF New Year!
In: Software Development · Tagged with: .NET, SPC, Synergy 9.5, WPF









