You are browsing the archive for RemObjects.

Avatar of marc

by marc

Data Abstract, RemObjects SDK and Hydra “Spring 2014” Releases

March 31, 2014 in .NET, Cocoa, Data Abstract, Delphi, Hydra, Java

On Friday, we released the latest updates to our Data Abstract and RemObjects SDK products for all five platforms, as well as for Hydra. Like always, a whole bunch of fixes and improvements across the product lines are gathered together in this release.

For Data Abstract and RemObjects SDK, this is also our last planned release for the 7.0 product version, as we prepare for a major new product cycle — codenamed DA8 — starting with our summer release in May. As such, this update focuses mainly on bug fixes and smaller enhancements (of which there are many).

The new release also includes official support for use with our recently released RemObjects C#, including project templates and IDE improvements to let you build .NET, Cocoa and Java apps with RO/DA using our C# implementation, as well as building managed hosts and plugins for Hydra.

As always, the new update is free for all users with an active subscription, and available on the customer portal. Our free 30-day trial downloads have also been updated to the new version.

If your subscription has elapsed, then now is a great time to renew. Renewing will not only give you access to the new 7.0 update, but also access to the beta versions of DA8 that will become available over the course of April, as well as the first (and future) DA8 or RO8 releases throughout the year.

If your previous subscription ended a while ago, you will be happy to hear that we recently updated our online shop to automatically grant “amnesty renewals”. That means you can be assured that your renewed license will always cover the current product and at least six months of future updates from your renewal date.

If you have or are considering getting a Suite subscription, remember that the Suites for .NET, Cocoa and Java now also include RemObjects C# — so you get been more value at the same great price as before (and you can always up-renew from RO or DA to the Suite, of course).

But enough talk, i’m sure you’re anxious to try out the new bits. We’re happy to have this new set of updates out to you now, and we’re extremely excited about what we have coming for DA8 and RO8 this summer and beyond.

yours,
marc hoffman
Chief Architect

Avatar of marc

by marc

Using iOS 7.1 SDK with RemObjects C# or Oxygene

March 11, 2014 in Nougat, Oxygene

As you’ve probably seen, iOS 7.1 is out — and with it, a new SDK. Anxious to use iOS 7.1 with RemObjects C# or Oxygene? No problem. our Importing a New or Beta SDK for Use with Elements for Cocoa article on the wiki explains how to do it:

Launch FXGen by right-clicking CrossBox:

Once you have downloaded/updated to Xcode 5.1 from the App Store, find the Xcode.app in in your /Applications folder and drag it into the app:

Select iOS 7.1 from the dropdown:

Click “Start Import”

FXGen will run a for a short while, and then you have .fx files for the iOS 7.1 SDK you can use. Just copy them to the “C:\Program Files (x86)\RemObjects Software\Elements\Nougat\SDKs” folder in your PC or VM, and you’re off running.

Of course these same steps will also work for importing beta SDKs (which we won’t be able to tell you about, because of NDAs) – for example when Apple starts seeing iOS 8.0 or the next version of OS X later this year. This way, you can start working with the cool new stuff right away — without having to wait for anyone to create wrappers for you.

It goes without saying that now that iOS 7.1 is officially out, our next release (and Friday’s upcoming beta) will include the .fx files for iOS 7.1 out of the box.

Enjoy,
marc

Avatar of marc

by marc

Announcing the Oxygene “January 2014″ Update

February 5, 2014 in Oxygene

Ahh, it feels like forever since i have written one of these, with the holidays and a long-overdue vacation in January. But it’s really just been a little over six weeks, and the time has come again:

Last friday, we shipped the latest update for Oxygene. The January 2014 release is a minor bugfix release for our 6.x compiler line, versioned as 6.1.61.1441. While it contains no major new features over what we shipped in November, it does have a wide range of fixes across all areas of the product, and is a recommended update for all users (of course ;)).

January 2014 also marks the last update for our 6.0 compiler line, and with that, the last release with Oxygene standing alone. We’re hard at work to finalize “Elements 7.0”, our next major release coming around the end of February – and with that release, not only does Oxygene get a major version bump again, it will also gain a sibling: our new Hydrogene language (which we’ll start talking a lot more about over the next few weeks).

But first things first: The January 2014 release is of course, as always, a free update for all users with an active subscription. You can find it for download in your Licensed Downloads area, as well as on the public Trials page. It (optionally) includes the still-new Visual Studio 2013 IDE.

If your subscription has lapsed, there has never been a better time to renew than now to get both the new release and everything we have planned for the next year (and beyond). As always, you can renew your Oxygene license for a mere $499 per user. And we also have a special “up-renewal” that lets you renew Oxygene and add Hydrogene, for only $699.

If you’re a Prism user, abandoned by Embarcadero, chances are you might be entitled to extended Oxygene for .NET releases from us. Check our Prism FAQ for details, or contact us if you have questions.

January 2014 is a great release – and we’re even more excited about what we have in store for you for the rest of the year. Let us know what you think!

Enjoy!

Avatar of Scotty

by Scotty

Setting Up For Android Development with Oxygene

January 9, 2014 in Android, Cooper, Oxygene, Uncategorized, Visual Studio

The purpose of this article is to help you set up Oxygene ready to develop Android applications. It assumes you have already installed Oxygene, but will walk you through installing the Java and Android SDKs, as well as setting up a virtual Android device and configuring your physical device for development. If you have already been developing for Android using another platform or have already set these things up independently, you do not need to read this article.

Android is an operating system for devices such as mobile telephones and tablet computers developed by the Open Handset Alliance led by Google. Application development is focused on targeting the specialized Dalvik Virtual Machine (VM), which is a mobile-optimized VM similar to the Java VM. Oxygene ships with templates for creating Android projects, and produces both native Java JAR files and the Android APK file necessary for deployment to an Android device.

The Pre-Flight Check

Each time you create an Android project with Oxygene, it will do a ‘pre-flight check’ to ensure that it can locate the things it needs, notably the JDK and the Android SDK.

Java Pre-Flight Check

If you’ve installed them into custom locations and it fails to find them, this gives you an opportunity to specify the installation folders by selecting the “Manually Specify The JDK Path” link from the dialog.

Java SDK Paths

Java SDK

Oxygene requires version 6.0 or later of the Java Development Kit (JDK) to be installed. For Windows, we recommend installing the “x86″/”i586″ release of version 7 JDK.

If you have not yet installed the JDK, you can download it from here.

Installing the JDK simply involves downloading the installer and running it, accepting all the defaults.

Install JDK

Once the JDK is installed, click Retest on the Pre-Flight Check dialog. If all has gone well, the dialog should change to report that the Android SDK is missing.

Android SDK

To create Android applications, Oxygene requires the Android SDK to be installed, in addition to the JDK.

If the JDK is installed, but not the Android SDK, the Oxygene pre-flight check will report this.

Android Pre-Flight Check

Download The Android SDK

The Android SDK can be downloaded here.

For Windows, we recommend using the .exe installer available under the “SDK Tools Only” section that is displayed when you expand the “Download for Other Platforms” area of the SDK download page , as it will automatically register the Android SDK with the system so that Oxygene can find it.

Android SDK Download

NOTE: If you download the .zip version of the SDK and manually extract it, you will need to manually configure the path to the Android SDK in the IDE options, as described further down on this page.

NOTE: If the Android SDK installer complains that the JDK cannot be found, that may be because you have the x64 version of the JDK installed (see above). Simply install the x86 (i.e. 32-bit) as well to solve this problem.

Once you have downloaded the Android SDK Installer, run it and accept all the defaults.

Android SDK Installer

After installing the Android SDK, setup will automatically offer to launch the Android SDK Manager. Leave this checked.

Android SDK Installer Finished

The SDK Manager

In the SDK Manager, check to install the “Android SDK Platform-tools” and at least one API version (usually the newest) and click “Install Packages” to install.

Android SDK Manager

In the subsequent dialog you will need to accept any licenses that apply and press “Install” again.

Android SDK Manager License

You should periodically run the SDK Manager to check for any updates to the tools and platforms.

Android Virtual Devices

When the tools and platforms are all installed, you might want to create an Android emulator, also known as an Android Virtual Device or AVD. This will allow you to test your application, in case you don’t have an actual device (or don’t want to use your device for development).

AVD’s are created from the Android Virtual Device Manager, which is accessible from either the SDK Manager by choosing Tools – Manage AVDs or by starting the AVD Manager program directly or from the Oxygene Visual Studio tool bar.

Launch AVD Manager From Visual Studio

The AVD Manager

The first time you launch the AVD Manager there will be no configured AVD’s.

Android Virtual Device Manager

Create an AVD

To create a new AVD, click the “New” button. You will need to give the emulator a name. The AVD manager is pretty strict about what characters you can use in an AVD name, but will warn you when you use invalid characters.

Define a Device

The quickest way to set up an AVD is to emulate an actual device the DVD Manager already knows about. If you select the Device drop down, it will offer you a number of different Google devices it can emulate along with a set of generic devices.

AVD Device Selection

If one of these predefined devices match the type of device you are targeting, then simply select it from the list.

If none of the devices in the list match the device you wish to target, you can set up all the fields in the AVD manager manually. For a full list of settings check out the AVD Hardware Options Documentation.

Select an API

You will also need to select the API level for the Target field. You can choose any installed API level, for example Android 4.4 – API Level 19.

AVD Target Selection

Device Memory

When you choose a predefined device it will set the RAM setting for the AVD to match the actual device. In practice, this number may be too high to properly emulate and you could get a warning.

AVD Memory Warning

In this case, you will probably need to adjust the RAM setting to something more appropriate. (What’s appropriate will depend on the amount of memory in your development machine.)

Save The Device

Once the AVD is defined, click OK to save it. You will be shown a dialog confirming all the settings that will be used to create the AVD.

Save Setting Dialog

On clicking OK, the new AVD should now appear in the list of available AVD’s. If the AVD seems to be fully configured correctly, it will have a tick next to it in the list.

AVD in List

Test The Device

Once you have created an AVD, you can run it by selecting it in the list and clicking the “Start” button.

You will be presented with some launch options where you can simply click OK unless you need to change something.

AVD Launch Options

The AVD will then begin to start.

AVD Start Progress

After a few seconds, a blank emulator screen will appear. From this point, depending on the spec of your development machine, it could take several minutes for your device to appear in the emulator.

AVD In The Emualtor

Testing Your AVD Setup

Now you are ready to test your setup. Leave the device running. From within Oxygene, start a new Android Application Project.

New Android Project

This will create a very simple Android Template Application. Click the “Start” button on the Visual Studio tool bar and Oxygene will build your project and deploy it to the emulator where you should be able to see it running.

New Android Project Running In Emulator

Setting Up An Actual Device

AVD’s are great for testing your application on devices you don’t own. If you do however own a device, you can test your application right on the device itself. In many ways this is preferable to using an AVD, as you get to see exactly how it will run and perform.

Enable USB debugging on your device

Before you can debug an Android application on your device, you need to enable it for USB debugging.
On Android 4.0 and newer, you need to go into Developer Options and turn it on.

NOTE: On Android 4.2 and newer, Developer options are hidden by default. To make them available, go to Settings > About phone or Settings > About Tablet and tap Build Number seven times.

Once turned on (if necessary) you can find Developer options in Settings > Developer options.

Android 4.4 Developer Options

If your device is running Android 3.2 or older, you can find the Developer options under Settings > Applications > Development.

Install USB Drivers For the Device

In order to connect to an Android device to test your applications, you need to install the appropriate USB driver. This page on the Android Developers website provides links to the web sites for several original equipment manufacturers (OEMs), where you can download the appropriate USB driver for your device. However, this list is not exhaustive for all available Android-powered devices. The page also gives information on how to install the driver once you have it.

Running Your App On The Device

Once the USB driver is installed for your device, make sure the device is connected to your machine. From Oxygene you can then choose to debug your application on your device by selecting your device from the Crossbox area of the Visual Studio tool bar.

Select Android Device

The first time you run your application from within Oxygene on your device, a dialog will appear asking for permission.

You Are Ready To Go

That’s it. You are now set up and ready to begin developing Android applications using Oxygene.

Good Luck!

Avatar of Anton

by Anton

Winter has come

December 23, 2013 in .NET, Data Abstract

By the time this blogpost will be published, the Winter 2013 release of Data Abstract will already become available. I feel that I should talk about several important features made available in it, and about a few things that will soon fade in oblivion.

So the new features first.

Private Schema tables access. Local Data Adapters (both dataset-based and DA LINQ ones) are now allowed to access Schema tables that aren’t marked as ‘public’ and thus aren’t accessible by remote clients. There is no need anymore to write additional code to access these tables using local data adapters or from Schema scripts.

Data Abstract for Portable Class Library (aka DA/PCL). Yes, this release contains a (limited) port of Data Abstract to Portable Class Library. You can now build one Class Library and then reuse it in Silverlight, Windows Phone or Windows Store application.

Unfortunately the dreaded Technical Debt monster arose and strikes from the back so the PCL library has some limitations on the desktop .NET Framework. The problem is that the RemoteLinqDataAdapter class is located in differently named assemblies in desktop .NET and in all other platforms (namely RemObjects.DataAbstract.Linq.dll and RemObjects.DataAbstract.dll). Introducing the .Linq assembly back-when was a good (and the only) way to introduce DA LINQ without breaking support of .NET 2.0. And an additional assembly wasn’t an issue until a need to create portable set of assemblies arose.

I can say that we plan to provide improve this to more seamlessly support all four .NET platforms (i.e. Windows Phone, Windows Store (WinRT), Silverlight AND desktop .NET) in the next release of Data Abstract. Stay tuned ;)

Important note: Up to this release, non-desktop Data Abstract assemblies had a platform name suffixes in their names (f.e. RemObjects.DataAbstract.Silverlight.dll or RemObjects.DataAbstract.WinRT.dll). Since this release these suffixes exist no more, so ALL assemblies have the same name.

And now to the stuff now considered obsolete.

Data Abstract provides two binary data adapters: BinDataAdapter and Bin2DataAdapter. The former one, BinDataAdapter data adapter, is now considered obsolete and will go away in the next major releases. We have Bin2DataAdapter data adapter that serves the same purpose, is way more advanced and feature-full and, unlike the BinDataAdapter, is supported by Data Abstract on platforms other than .NET and Delphi. The only reason we still shipped BinDataAdapter this long was backwards compatibility. Yet it is time to finally take a step forward and leave this obsolete data adapter behind. So, in the unlikely case that you are still using this data adapter, you really should to consider to switch to the Bin2DataAdapter data adapter. There’s no downside.

Also we have a set of ASP.NET components provided in the RemObjects.DataAbstract.Web.dll. This entire .dll will be removed in the next major release, and has been marked as obsolete. The reason behind this is that the very approach implied by these components is outdated and based on an old model of using ASP.NET. Mixing the UI (ie .aspx code) and data access results in dirty code and errors that can be detected only at runtime, thus resulting in a nightmare while supporting such apps. Believe me, I know. So if you are not using the RemObjects.DataAbstract.Web, then there is no need to worry. If you do then I’d strongly suggest you to either move to the properly layered architecture, where UI has no data access code and/or to take a look at the Data Abstract for JavaScript. It allows to create modern and robust UI and is shipped together with Data Abstract for .NET.

That’s all for now.

Still stay tuned – soon I’ll show you some exciting new features of RemObjects SDK and Data Abstract.

Avatar of marc

by marc

Reminder: Get Oxygene for .NET as part of your RAD Studio SA

November 20, 2013 in Oxygene, Prism

Hi.

i just wanted to shoot out a reminder that if you purchased “Support & Maintenance”, a.k.a Software Assurance (SA) for RAD Studio XE3 from Embarcadero, you are entitled to updated releases of Oxygene for .NET for the duration of your SA period.

Embarcadero might be telling you (if they say anything at all, that is) that Prism is discontinued or dead, but nothing could be further from the truth.

Prism has always been just a rebranded version of our Oxygene for .NET product. And while Embarcadero might no longer be delivering it to you (in spite of happily taking your SA money), Oxygene is alive and well, of course, and we here at RemObjects have decided to honor the full SA periods and provide you with the latest updates to Oxygene for .NET for the duration of your SA period – on our own dime.

What do you need to do?

Two simple things:

  1. Register an existing XE3.2 (or XE3.1 or XE3, if you never received the others) serial number with us at remobjects.com/oxygene/registerserial.
  2. Contact us at sales@remobjects.com with details about your SA contract, most importantly its coverage period, and (if not obvious from your name or email address) the username you created in Step 1.

We’ll update your account with access to the latest release of Oxygene for .NET covered by your SA period (which may include future releases, too), and get back to you, ASAP.

Caveats

As i mentioned above, we’re doing this on our own dime, so we need to set some cut-off date, or else we’d be shipping free Oxygene to everyone, forever, and not be able to pay our salaries.

Our official cut-off date for the above offer is April 23, 2013. On that date, Embarcadero announced RAD Studio XE4, which officially no longer included Prism.

If you purchased RAD Studio XE3 with DA, or renewed SA for RAD Studio before that date, you qualify for the above deal. If you renewed after this date, your previous SA period has already been fully covered, and your new SA period is for XE4 and does not, i’m sorry to say, include Prism anymore.

That said, if you purchased or renewed RAD Studio SA after the above-mentions date and feel in any way that you were misled or that the lack of Prism in your new purchase was mis-represented (and i’m only bringing this scenario up because we had countless people contact us with that exact concern), please email us anyway, and we will try and find a fair solution.

Our #1 goal is that every Prism customer gets a fair deal and does not feel cheated out of the product they paid for.

Full Oxygene

If you don’t have SA, or your SA has expired, of course there’s always the option (and we’ll love you for it) of just going and renewing to the full Oxygene product from us.

Not only does this give you a fresh year of updates to Oxygene for .NET, but it also gives you access to the other two platform editions, letting you build fully native no-compromise apps for iOS, Mac, Android and Java.

And if your SA is still active (and/or extended via the above offer), renewing will add an extra year on top of your current SA period – essentially giving you more than a year of updates for all three platforms.

  • If you have an extended license with us: Renew for $499 to add a year of Oxygene for .NET, Cocoa and Java, on top.
  • If you don’t have a current/non-expired subscription: Cross-grade for $599 for a fresh year of updates.(You can also cross-grade if you own any version of Delphi or any past version of Prism.)

In Summary

We’re very excited about Oxygene, what we have done with it over the past year, and what we have planned moving forward. We’re also very thankful for your patronage, and we hope that you love working in Oxygene as much as we do (and as much as we love creating it), and we look forward to what 2014 will bring, with you on board.


Party Time!

Avatar of marc

by marc

Announcing the Oxygene “October 2013″ Update

November 4, 2013 in iOS, Nougat, Oxygene

Dear readers,

we may be a day late and into November with this announcement, but we’d like you to know that the “October 2013″ update for Oxygene has been made available earlier this week.

What’s New

The October update is mostly a bug-fix release, but it also includes a couple of rather significant new features on the Cocoa front.

Most importantly, this release officially introduced 64-bit ARM support for the Apple A7 chip in the new iPhone 5S and the new iPads that came out today. Last month we laid a lot of the groundwork with 64-bit compiler support, but now [you can build](http://wiki.oxygenelanguage.com/en/Architectures_(Cocoa) your apps for your devices in 64-bit mode, as well. Very exciting.

We have also started officially shipping .fx files for the new Mac OS X 10.9 “Mavericks”, and we’ve extended the Cocoa compiler to support the new “instancetype” feature introduced/mainstreamed for Objective-C by the iOS 7 and OS X Mavericks SDK.

And of course there are a good 100 additional fixes and improvements in this update, across all three platforms.

How to get Oxygene 6.1.57

As always, this release is a free update to all active subscribers, and can be downloaded now.

If your subscription has elapsed, now is a great time to renew to get access to the latest release and all the good stuff we have cooking for the near future.

Oxygene for Prism Customers

Remember that Oxygene 6.1 is also the first release that is no longer available from Embarcadero under the Prism brand, and it will not accept Prism XE3.2 serial numbers. But as a reminder: we are committed to honoring SA contracts Embarcadero might have sold you with the promise of Prism coverage (i.e. before April 23, 2013). Please email sales@remobjects.com with your SA details, and we’ll sort you out with ongoing access to Oxygene for .NET for the remainder of your SA period. (You can read more about this here).

Of course, if you do not have SA, or if you want to take advantage of Oxygene on the Cocoa and Java/Android platforms as well, you can always renew or cross-grade to the full Oxygene package at any time.

More to Come

2013 is drawing to a close, but we’re not done yet. We’ve got one whopper of a release planned for the end of this month (and lots of cool stuff are coming in 2014 as well). So make sure stay up to date with your subscription.

Happy coding!

Avatar of marc

by marc

“Steps” for iPhone 5S — written in Oxygene

October 30, 2013 in iOS, non-tech, Nougat, Oxygene


Steps

I’m more than thrilled to let you know about “Steps“, my next/new iOS app.

Steps is a small but helpful app, which works exclusively for the new iPhone 5S, because it uses the new M7 chip that Apple has introduced with the 5S to gather motion data and let you know how many steps you are taking each day.

Whether you’re interested in that to keep track of your daily workout, or just want a fun way to explore this cool new feature of your iPhone — Steps is a great way to do it.

On first launch, Steps gathers up to 7 days of previous walking history. That’s right — Steps (or rather, the M7 chip ;) has been hard at work for you even before you bought it! So you have some data to look at immediately.

In addition to showing your daily step count, Steps (new in version 1.1) also aggregates your average daily steps for the past week and month, and it will keep track of what your personal best has been, so far — including encouragement to beat it, when you get close.

Over time, and without you ever having to think about it again, Steps will update to load in more data as you roam about, all the while keeping track of your past history. Eventually, you’ll have months and months of walking data to look at. You don’t need to launch Steps manually for this to happen (although you will want to launch it to have a look once in a while).

And because it uses the new M7 chip, Steps can do all of this without affecting your iPhone’s battery life at all.

 

It goes without saying that Steps is written 100% in Oxygene for Cocoa. And as with all my previous Oxygene iOS projects, full source code is available on GitHub at github.com/dwarfland/Steps.

So, if you have your iPhone 5S yet, make sure to grab your copy of Steps on the App Store, for only 99c. And if you’re a developer, make sure to check out the code, as well!




Originally published on subspacecables.com.

Avatar of Anton

by Anton

Code Deodorant

October 28, 2013 in .NET, Oxygene, Tools, Visual Studio

We all write smelly code from time to time. Reasons are different, from ‘I’ll rewrite this code later, I just need this feature working now somehow’ to ‘Deadline is coming and this pesky bug is still not fixed’ or some mistake from a junior developer, yet the result is always the same. Every large codebase has lines of code that smell and stink. Of course there is an ideal codebase repository somewhere that does not have a single line of dirty code, or odd reinvent-the-wheel solutions, or patterns misuse etc… But, I’m afraid, that is along the lines of a flying unicorn. In the real world, we sometimes have to sacrifice code purity to deadlines or other reasons. In this case the main goal is to keep the unclean code and the technical debt caused by it manageable. Not a simple task, when the project has more than 55k lines of code, like ROFX/.NET (i.e. Data Abstract, RemObjects SDK, Internet Pack and Script for .NET) does.

So we need a tool that analyzes our source code and helps to pinpoint code that is potentially dirty. Such tools are called Static Code Analyzers. There are several of them available for .NET and I’d like to highlight the one I like best. This particular tool is not tied to C# or VB.NET and works perfectly with Oxygene code. It also provides Visual Studio integration (including the upcoming VS 2013), and it can also be run on a build machine as a part of the build process. This awesome tool is called NDepend (http://www.ndepend.com/).

In the following, we will create a simple application and apply NDepend to it. We’ll use Oxygene, as I need to show you how to avoid some sharp edges. While C# support in NDepend is near perfect, there are some (minor) nuisances that need to be avoided for Oxygene projects.

Let’s create an Oxygene for .NET Class Library project and add some code like this:

namespace SampleClassLibrary;

interface

type
  Class1 = public class
  private
    var fUnusedField: Int32;

    method NeverCalledMethod(); empty;
  public
    constructor(); empty;
  end;


  UtilityClass = public class
  public
    class method Foo(); empty;
  end;


 SomeBaseClass = abstract class
  public
    constructor(); empty;

    method AbstractMethod(); abstract;
  end;


implementation
end.

As you can see, there are several things that are not ideal, like unused fields and methods or the public constructor of an abstract class. This is, of course, simplified code, where all such things are clearly visible. At the same time, it is very hard to find all suspicious places in a real-world codebase, where the code was created by dozens of different developers and is spread between several projects containing several hundreds of code files. Of course thorough code review would help, but it is still a question of how much efforts it would require. And the question that remains – even after the code review – is to be sure that everything is clean?.

Enter NDepend.

Attach NDepend to the current solution using the menu item NDepend -> Attach new NDepend project to current VS solution.

Because NDepend doesn’t recognize Oxygene projects out of the box, we need to reference the compiled assemblies instead of the source code project, as we would do for C# or VB.NET projects. Press the ‘Add assemblies in Folder‘ button and select the folder containing the current project’s compiled assemblies. Note that NDepend will automatically preselect the folder containing compiled assemblies for the active project.

Confirm the folder selection. Assemblies will be added to the NDepend project.

Press the ‘Analyze a single .NET assembly‘ button and the project analysis will start. After it completes (a very fast procedure, even for big full Data Abstract for .NET solution), a helper dialog will appear.

Open the NDepend rules explorer (NDepend -> Rule -> View Queries).

As you can see, some entries are marked with a warning sign. These are rules that are potentially violated and were successfully detected by NDepend.

  • The abstract class SomeBaseClass should have a protected constructor instead of a public one.
  • The UtilityClass class should be static.
  • The abstract class SomeBaseClass is potentially dead code (it has assembly-only visibility and isn’t used anywhere it this assembly).
  • The Class1.fUnusedField field is not used anywhere and is thus not needed.

Try NDepend on your project and most likely you’ll find some potentially dangerous code lines.

As you can see, NDepend is mostly language independent, so all tutorials and tips ‘n tricks found at http://www.ndepend.com/ can be used with Oxygene, too.

One last advice: For some rules you won’t be able to navigate to a method or class violating some rule by double-clicking the method’s name.

This happens because in some cases (for navigation purposes) NDepend relies on its built-in language parser (that is limited to C# only) rather than on .PDB information. This custom source code parser is used because .PDB files provide information about source code declarations of concrete methods only, so additional effort is needed to acquire information about source code for namespace and type declarations.

To make it easier to find the problematic method, modify the code validation rule output by adding the full method (or class) name. To do this, just change the “rule output statement” (usually found at the very end of each rule’s query code) from code like this (for the Methods that could have a lower visibility rule):

select new { t, t.Visibility , 
                CouldBeDeclared = t.OptimalVisibility, 
                t.TypesUsingMe }

to this:

select new { t, t.Visibility , 
                CouldBeDeclared = t.OptimalVisibility, 
                t.TypesUsingMe,
                t.FullName }

Now you’ll see the full path (including namespace and class name) of the problematic entry.

P.S.: Don’t be afraid of the NDepend query language. It is a very powerful way to define own or customize existing code validation rules. At the same time, the predefined rules set allows to use the code analyzer without even touching the query language at all (except for the above-mentioned issue).

P.P.S.: Before you say ‘Hey, this thing is way too expensive’, try to estimate how much time it will save you and your team members and how much this time costs.

Avatar of marc

by marc

Visual Studio 2013 is here (for some values of “here”)

October 22, 2013 in Data Abstract, Oxygene, Visual Studio

The time has come, and Visual Studio 2013 is officially RTMed and available on MSDN, even though the official launch event is not scheduled until November 13th.

What does Visual Studio 2013 mean for our users?

Oxygene has been ready for Visual Studio 2013 for a while now (and i personally have been using 2013 exclusively ever since i redid my development VMs earlier this year and when VS2013 was still a private CTP we weren’t allowed to talk about). Visual Studio 2013 support for Oxygene made it into our public releases back in August, and our latest September 2013 update is fully ready for the RTM version of Visual Studio 2013. SO if you have an MSDN subscription, you can download your copy now, run the latest Oxygene installer, and you’ll get the full Oxygene experience in the fresh new IDE.

We’ll be rolling out the Visual Studio 2013 Shell with Oxygene in our upcoming (major!) November 2013 release. (We got one more release coming up before, the incremental October 2013 update, but that had been locked down before the RTM was available, and also we’ve been asked to hold of shipping the 2013 Shell until after the official launch event. ;).

Data Abstract and RemObjects SDK also have been made ready for Visual Studio 2013 with the last update we shipped in September. This applies to the .NET editions, Data Abstract for JavaScript and also – if you are using Oxygene – the editions for Java and Cocoa. We’ll be doing more testing with the RTM release, and the next update might include additional tweaks and improvements to round this off.