Programming blogs containing .NET, C#, LINQ, Objective-C and Delphi experiences
Wednesday, October 27, 2010
Developing for the iPad
I can tell you that developing for the iPad is a total different experience compared to Delphi and Visual Studio. Never the less it is great fun! Besides the fact that it is a fun platform to work on it is even more fun to learn a new platform, language and IDE.
The tools: XCode and Interface builder
We decided to go the hard way and develop with Apples native IDE XCode. As .NET developer an easier approach would be to choose for a Mono solution like MonoTouch, however we felt that we had to know 'the metal' first.
The main tools you use developing for iPad are XCode and Interface builder. XCode is a good to work with IDE, however compared to Visual Studio it lacks some features. (Must say I still find new features, even today). One annoying point of XCode is that it opens every file in a new window (when double clicking on a file) so after a while it can be hard to seperate the trees from the forest with all that open files. However if you click once you can keep them in one window but for some reason that is hard to persist.
A big plus for XCode, in my opinion, is that it helps you to work in the MVC design pattern way which gives you clean code.
XCode does not offer an integrated form designer like VS does instead you make your views (forms) with Interface builder.
The language Objective-C
The language, Objective-C, looks at first very weird with all that brackets but there are great resources online that helped us to get started.
If you would like to start iPad development take a look at some resources we gathered along the way:
Apples developer website (Get yourself a free account)
Stanford University lectures on iTunes U (Highly recommended!!!!)
Cocoa Dev Central - Learn Objective-C
It is likely that I will write some more blogposts about this new adventure in the future.
Tuesday, August 17, 2010
Fooling around with TWebbrowser compilation post
In the statistics of my blog I find a lot of people searching for Delphi’s TWebbrowser solutions and examples. I wrote a few post about some TWebbrowser specific problems and possible solutions.
Because they are in seperated, non related, posts I thought it would be nice to compilate all the knowledge in one blogpost. Well here it is. :)
Fooling around with TWebbrowser #1
Describes how to use TWebbrowser for editing HTML
Fooling around with TWebbrowser #2
Describes how to retain the browser session within you application
Describes some TWebbrowser basics like how to get the right popwindowsize, how to fill up a combobox with visited websites, how to enable/disable navigate buttons etcetera.
Fooling around with TWebbrowser #4
Describes two solutions for the Enter key problem.
Posting data with TWebbrowser
Describes how to post data to websites using TWebbrowser
Saving TWebbrowser content with IPersistFile
Describes two ways to save the content of the current loaded document in the browser.
Two way interaction with Javascript in Winforms using Webbrowser
Although about Winforms C# this should be compatible with Delphi TWebbrowser.
Enjoy!
Wednesday, May 19, 2010
Using Extension methods on Lists to make it fluent
Since C# 3.0 you can write extension methods on any class that you want, even if you don’t have the source code of the class. In other words you can extend a class with your own methods.
Extension methods can only be declared in static classes as static methods.
Extensions on List<T> classes can be very handy and make your code more readable and fluent.
Suppose you have this mixed Animal list with Dogs and Cats from this blogpost.
List<Animal> animalList = new List<Animal>();
animalList.Add(new Dog("Dog1", ConsoleColor.Red));
animalList.Add(new Dog("Dog2", ConsoleColor.Green));
animalList.Add(new Dog("Dog3", ConsoleColor.Red));
animalList.Add(new Cat("Cat1", ConsoleColor.Black));
animalList.Add(new Cat("Cat2", ConsoleColor.Black));
animalList.Add(new Cat("Cat3", ConsoleColor.Black));
(Never mind the ConsoleColor for the animal ;-) )
Suppose we want all the red dogs from the animalList, we could write our code like:
//Get the Red docs
List<Dog> redDogList = animalList.OfType<Dog>().Where(n => n.Color == ConsoleColor.Red).ToList();
This works, however everytime we want to get some colored animal we would get the same type of code. We would probably write some static methods to avoid this :
List<Dog> redDogList = ListUtils.GetTheDogs(animalList);
Even better is to make this static extension methods so that the functionality looks to be encapsulated by the list its self. We can then also make the method names more readable, for instant not “GetTheDog”, but “WhichAreDog”.
For example:
public static List<Animal> WhichAreDog(this List<Animal> animalList)
{
return animalList.OfType<Dog>().Cast<Animal>().ToList();
}
public static List<Animal> HavingColor(this List<Animal> animalList, ConsoleColor color)
{
return animalList.Where(n => n.Color == color).ToList();
}
The “this” before the first parameter of the method indicates that this is an extension method on this parameter, in this case the list with animals.
Now getting the red dogs looks like this:
List<Animal> allRedDogs =
animalList.WhichAreDog().HavingColor(ConsoleColor.Red);
Much more readable and fluent!
Monday, May 03, 2010
Exploring LINQ #3
LINQ keeps amazing me in its power and beauty. So much that for each problem I have to solve (coding problem that is) I find myself wondering can this be done with LINQ, and how.
I am working on a rewrite of an old application to C#. For some reason the original designers had put some ‘model’ data into a none relational database. Instead of making a good relational data model the data has been put as follows (simplified record from the database) :
Option1 = “1;2;3”
Option2 = “A;B”
Value = 1
In other words foreach possible combination of option1 and option2 there is a value. (1-A-1, 1-B-1, 2-A-1 etc.) I would prefer a relational set up, but to honor the past this will have to stay that way. For use in our program it is required to have all possible combinations into a single flat list which we then can query with LINQ.
Of course it easy to construct some code that would knock this down into a flat list though I don’t think any will be as elegant and as fast to produce as this LINQified solution.
Suppose we read the raw data from the database into a list with raw objects looking like this:
List<Raw> rawList = new List<Raw>();
rawList.Add(new Raw() { Option1 = "1;2;3",
Option2 = "A", Value = 1 });
rawList.Add(new Raw() { Option1 = "4;5",
Option2 = "A;B", Value = 2 });
rawList.Add(new Raw() { Option1 = "1;2;3",
Option2 = "C", Value = 3 });
Using LINQ it is easy to combine the original raw list with the “;” splitted list (arrays in fact) from the fields Option1 and Option2. From that a flat list can be constructed which holds all the combinations:
List<Raw> flatList = (from n in rawList
from opt1 in n.Option1.Split(';')
from opt2 in n.Option2.Split(';')
select new Raw
{
Option1 = opt1,
Option2 = opt2,
Value = n.Value
}).ToList();
flatList.ForEach((n) => Console.WriteLine(n.Option1 +
"-" + n.Option2 +
"-" + n.Value.ToString()));
Resulting in a ‘flat’ list:
1-A-1
2-A-1
3-A-1
4-A-2
4-B-2
5-A-2
5-B-2
1-C-3
2-C-3
3-C-3
Querying this list is now child’s play:
int Result = (from n in flatList
where (n.Option1 == "4") && (n.Option2 == "B")
select n.Value).FirstOrDefault();
Tuesday, March 09, 2010
Two way interaction with JavaScript in Winforms using Webbrowser
In a recent project I had to integrate Google maps into a Winforms application. To use Google Maps from a desktop client you must be able to call the Javascript in webpage, which can be done with the Webbrowser component.
Calling JavaScript from C#
Calling JavaScript in a Webbrowser component is very easy. JavaScript is exposed through the IHTMLWindow2 interface which can be referenced from the IHTMLDocument2 interface through the parentWindow property.
doc = webBrowser1.Document.
DomDocument as IHTMLDocument2;
doc.parentWindow.execScript("createMapMarker
("52.3738007, 4.8909347", 1);", "JavaScript");
Calling C# from JavaScript
Calling C# code from JavaScript can be done using the ObjectForScripting property of the Webbrowser component. The object can be called in JavaScript using window.external. The communication is established through COM interop so the class should be visible for COM.
//Class example
[ComVisible(true)]
public class ExternalApplication
{
public string GetApplicationName()
{
return "The application";
}
}
//Connect it to the webbrowser
webbrowser1.ObjectForScripting
= new ExternalApplication();
From JavaScript call the external application, our C# app, like this:
(Google maps click event example)
function createMapMarker(lat, lng, html) {
var point = new GLatLng(parseFloat(lat),parseFloat(lng));
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
var appname = window.external.GetApplicationName();
alert(appname);
});
map.addOverlay(marker);
return marker;
}
For Delphi equivalent code take a look at Steve Trefethen blog serie about Google Maps / Delphi integration here.
Wednesday, January 20, 2010
Connecting (struggling) to Oracle database
This week I have been working (read struggling) on connecting a C# .NET application to Oracle. In the end I was trapped between 32 bits vs 64 bits, .NET Oracle providers and 32 bit OLE DB providers.
First of all I challenged this task, not bothered by any knowledge about Oracle. I did know that if you want to connect to an Oracle database you have to install the Oracle Client on the client machine. This only 1,7 Gb (!) download (Oracle 11g) happily told me that my Windows 7 version (real version 6.1, 64 bits) was not certified for the job. Only Windows 6.0 was.
Huh, now what?
After some googling found this blogpost about how to trick the setup to install on Window 7 (6.1) anyway.
After that it installed gracefully (some warnings…), time to startup VS to give it a spin!
Well not. That app that I am writing connects besides Oracle and SQL Server to an Access database. Because the Jet OLEDB driver for Access is 32 bits only I am doomed to target the x86 platform for now. No problem, however the 64 bits Oracle client can not connect targeting the x86 platform. Getting a BadImageFormatException:
[InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.]
(Still having the feeling it is the other way around, because I have the 64 bit Oracle client components installed)
Huh, now what?
Because the ADO.NET provider for Oracle from Microsoft suits well in the other technologies I tried to google more information. As it seems this driver is by the coming of .NET 4.0 deprecated. So on second thoughts not a good choice after all. Using the .NET provider from Oracle (ODP) then? Can I install 32 bits Oracle client on 64 bits machine? Who knows.
Fortunately Twitter came to rescue someone pointed out that there are third party solutions, which can connect to an Oracle database even without the Oracle Client.
So I tried Devarts dotConnect, which indeed can connect without the Oracle Client, isn’t that just great! Within 5 minutes I was connected (either 32 or 64 bits).
So if you want to connect to Oracle on .NET, keep some sparetime afterwards, I would suggest using third party components for it!
Friday, November 06, 2009
Casting lists using LINQ #2
In my previous post I showed the LINQ way to cast List<SomeDeriveType> to List<SomeBaseObject>.
IEnumerable<BaseObject> baseObjects
= DerivedList.Cast<BaseObject>;
As @jamiei commented this will raise an exception if the cast fails. OfType<T> will return only the elements of type T despite the fact that you have different derived types in one list. So suppose you have an Animal class and a Cat and Dog class that derive from Animal you could do something like this:
List<Animal> animalList = new List<Animal>();
animalList.Add(new Dog("Dog1"));
animalList.Add(new Dog("Dog2"));
animalList.Add(new Dog("Dog3"));
animalList.Add(new Cat("Cat1"));
animalList.Add(new Cat("Cat2"));
animalList.Add(new Cat("Cat3"));
//Get the dogs
IEnumerable<Dog> dogList = animalList.OfType<Dog>();
//Get the cats
IEnumerable<Cat> catList = animalList.OfType<Cat>();
LINQ makes it very easy to seperate the Dogs from the Cats!
Wednesday, November 04, 2009
Casting lists using LINQ #1
One thing that floated around my head a while was the problem that you can't cast a List<SomeDerivedObject> to List<SomeBaseObject>.
A poorman's solution to this was to loop the objects from the one list into the other list. Not an elegant solution though.....
I discovered that you can do this easily with LINQ. When you use a IEnumerable<T> you can do this like this:
IEnumerable<BaseObject> baseObjects
= DerivedList.Cast<BaseObject>;
Where DerivedList holds objects that inherit from BaseObject.
With a List<T> you could do something like this(copy):
List<BaseObject> baseObjects =
new List<BaseObject>(DerivedList.Cast<BaseObject>());
A great LINQ resource is 101 LINQ samples on MSDN.
Wednesday, August 05, 2009
Go see Delphi 2010
The first Delphi 2010 sneak peek video's showed up on the Internet. The first sneak peek shows some new IDE features like IDE insight, an everywhere context sensitive IDE navigation system.
Anders Ohlsson has a nice sum up of all the related Delphi 2010 blogposts.
Tuesday, June 30, 2009
CodeRush for free, not for Delphi Prism
As blogged before you know that I think DevExpress CodeRush totally rocks!
Did you know that you can get a lot of this functionality for free?
Mark Miller has got a very nice list of features that are available in CodeRush Xpress for C# and Visual Basic inside Visual Studio 2008. All for free!
In the full product you will get even more, check out the differences in this article: Moving up from CodeRus Xpress to CodeRush
Delphi Prism
The downside of all this good stuff is that Delphi Prism is not supported. The fact that the original CodeRush was a pure Delphi IDE product, I can not believe that it will not be supported in the future.
Monday, June 29, 2009
The future of Delphi
I haven't had much time lately to follow everything on the Delphi side of the fence, but there is a lot going on.
Stefaan Lesage has a nice write up on this future, The future of Delphi looks brighter than ever before.
A very nice read, sums up everything that is cooking in the labs, including the roadmap.
Monday, May 18, 2009
Applying Domain-Driven Design - Book review
Before this weekend I got my copy of Applying Domain-Driven Design and Patterns by Jimmy Nilsson.
Althought the title, in my opinion should be "Applying Domain-Driven Design, Test Driven Design and Patterns", because beside DDD it covers a great deal of TDD also.
Design patterns for me were always a bit fuzzy, something from far-far-away land. However lately I am having more and more interest in Test Driven Devleopment and that software design method drives you towards better, testable, design, and Domain Driven Design seems to being just doing that.
Back to book
When you order a book about Design Patterns you expect it to be more a reference then a complete read, because the stuff looks to be boring ('dry stuff' as we say here), without trying it out.
In this book however the author takes you on a journey of software architecture, design and decisions. The book gives lots of "Aha!", "Huh?" and "Done that" moments which, I guess, keeps you awake.
It is loaded with lots of solutions for particular (recognizable) software problems, not just pushing Design Patterns, but making you think more about the right solutions, which always depends....
In just three days I have read half of the book already! For me that is rare.
So if you are interested in better software design I can highly recommend this book, it reads like a breeze!
Friday, April 24, 2009
Exploring Test Driven Development
A few weeks ago I attended a software event organized by the dutch Software Developer Network SDN. This time I followed a few sessions about Test Driven Development presented by (among others) Alex Thissen, Thomas Huijer and Dennis Doomen.
I must admit that before this sessions I was convinced that automated unit testing was a plus, but it would take just too much time (at least that is what I thought) so that I never actually used it. Triggered by this sessions I started to explore TDD and slowly but surely I am convinced by its pros.
So what is it?
TDD is not strictly about testing, but it is a software design method build upon testing. Check the TDD wiki for all the details, but basically it drills down to the following:
Every new feature in an application starts with building a test around one unit of code (a method or property), because of the fact that the real feature is not yet written that test will fail. After making the test you write the actual method which correctness can be checked by running the test.
Kind of strange huh? First test, then code. But when you think about it a little more it is a great way to improve your code quality.
Consider the following:
- By building a test you are triggered to think more about the specifications, heck by building the test you 'persist' the specifications in your code. (If specification changes, the test changes)
- It doesn't matter who writes the actual method, as long as the test fails he/she did not comply to the specifications.
- New features and specifications, which leads to refactoring your code, will be checked against your tests. If the test passes you will be fine.
In fact in TDD you will first change/refactor your test before refactoring the real code.
- You will try to keep test as small as possible, thus making smaller methods in your applications, thus making it less complex.
Less complex means more maintainable in the future. (Less time/costs)
“I don't care how good you think your design is. If I can't walk in and write a test for an arbitrary method of yours in five minutes its not as good as you think it is, and whether you know it or not, you're paying a price for it.”
Michael Feathers
Testing in Visual Studio
Visual Studio 2008 now offers unit testing. You can add a test project in your solution that refers your application/code library.
Making a first TDD application
Suppose we have some class Calculator with methods like Add, Divide etcetera.
Step 1
Create two test methods for the Add and Divide methods. A test method's result is stated by either an Assert, or an expected Exception:
[TestMethod]
public void Add()
{
int Int1 = 2;
int Int2 = 3;
int Result = calculator.Add(Int1, Int2);
Assert.AreEqual(5, Result);
}
[TestMethod]
public void Divide()
{
int Int1 = 6;
int Int2 = 3;
double Result = calculator.Divide(Int1, Int2);
Assert.AreEqual(2, Result);
}
[TestMethod]
[ExpectedException(typeof(DivideByZeroException))]
public void DivideByZero()
{
int Int1 = 6;
int Int2 = 0;
double Result = calculator.Divide(Int1, Int2);
}
In the test unit we created our Calculator class which we will test. Of course without the actual code this will not compile, so we create the initial method stubs, which will throw a not implemented exception.
Step 2
Run the tests. No supprise they will fail.
Step 3
Write the real methods:
public int Add(int Int1, int Int2)
{
return Int1 + Int2;
}
public double Divide(int Int1, int Int2)
{
return Int1 / Int2;
}
}
Step 4
Run the test. They succeed! Because the not so well choosen parameter names you could easily mismatch them in the method Divide, but your test will check for that!
What is next?
This example is rather simple. Complex codes, with for example database interaction will require some more coding for which you will write fakes and mocks. I will explore them in another post.
Conclusion
Although you might think that Test Driven Development takes a lot time in the process I am convinced (now) that it will pay back further on in the development process. Beside that it will boost the quality of your code and give you a base to safely refactor it in the future.
The examples where build in C#. I am not sure if this works in Delphi Prism as well, but I expect that it does.
Wednesday, April 08, 2009
CodeRush, when code smells...
At the beginning of this month Devexpress released the new version of their DXPerience products for .NET (Version 2009.1)
With the release of this components they also released a new version of their coding assisting tool CodeRush and Refactor Pro.
We use CodeRush for a couple of years now in Visual Studio for our C# work. Strange enough this new version somehow managed to trigger the "wow" factor once again.
I will not explain every new feature here, (You will find some resources at the end of this post) but one that is awesome in particular is Code Issues.
The Code Issues feature analyses your source code while your are working in your code. It gives you hints for Unused namespace references, unused methods, undisposed local vars etc, etc.
How does it work?
Hints appear in a bar near the scrollbar of the editor when you hover the mouse over the colored lines (each color is a hint category):
In this particular example, which seems to be extracted from some farmer application ;-), Coderush hints that a line of code where two strings are concatenated, could be refactored using string.format.
When you hover the code line, it shows you what you could do to improve your code: (or make it smell better)
This is really an impressive cool feature, that will boost the quality of your code.
Delphi Prism
Unfortunately CodeRush only supports C# and VB.NET at this moment. It would be very nice if CodeRush would support Delphi Prism as well.
Conclusion
Beside the fact that CodeRush helps you to boost your productivity with lots of code templates, it also helps you to track code smells and refactor them out of your software which will eventualy increase the quality of it.
You can find more resources on CodeRush here:
The Devexpress website
Mark Miller blog post "What's new in CodeRush & Refactor Pro"
This blogpost by Rory Becker
Thursday, March 12, 2009
New release for Delphi Prism
There is a new release of Delphi Prism available, according this edn article. The Delphi Prism February 2009 release (Build 3.0.17.591) as it is called (Wasn't it already March? ;-) ) contains the following changes.
Wednesday, January 07, 2009
TIOBE language of the year not Delphi
In october Jim Mckeeth reported that Delphi could well be the language of the year in the TIOBE Community language index.
Unfortunately this has not happened despite the efforts of the Delphi community putting "Delphi programming" on webpages.
In january Delphi is fallen slightly one place back to position 10. (Nothing to worry about). Remarkable is that Pascal went up 3 places compared with last year, now holding the 15th position. I predict that Pascal will become the language of the year 2009! ;-)
Language of the year 2008: C
For what it is worth........
What is your prediction?
Tuesday, January 06, 2009
LINQ with Delphi Prism #2 : Deferred Execution
As said in this previous post Delphi Prism supports LINQ all the way so all the LINQ feature just work in Delphi Prism.
Deferred Execution
One of the key features of LINQ is Deferred Execution. That means that a LINQ query does not execute until data is demanded, for except by an iteration through a list. This makes it possible to make a complex query without execution each part of the query seperately.
However, there is one exceptions to the rule, a LINQ query executes immediately when you use a function that must iterate over the list for its result like, for example Sum(), Count(), ToList() etc.
//Example of deferred execution or lazy execution
//-------------------------------------------
var Numbers := new List<integer>;
Numbers.Add(1);
var DoubledList : sequence of integer
:= Numbers.Select(n->n*2);
// Query not yet executed!
// Add another number to the list
Numbers.Add(2);
//At this point query is executed
//Result "2--4"
for i : Integer in DoubledList do begin
Result := Result + i.ToString + '--';
end;
MessageBox.Show(Result);
//Example of direct execution
//-------------------------------------------
var Numbers := new List<integer>;
Numbers.Add(1);
Numbers.Add(2);
//Query executed here
var Sum := (Numbers.Select(n->n*2)).Sum();
Numbers.Add(3);
Numbers.Add(4);
//Would expect 20, but result is only 6
MessageBox.Show(Sum.ToString);
Monday, January 05, 2009
LINQ with Delphi Prism #1 : Sequences
I have been digging into LINQ this christmas. LINQ is a cool way to query data, whether it is an array, a list or a remote datasource.
LINQ is a new feature of C# 3.0 that comes with Visual Studio 2008, but guess what, Delphi Prism, also supports LINQ all the way.
If you want to play/test LINQ queries syntax you can download and install LinqPad, a free tool to use LINQ querys against a SQL Server database. (You could drop Management Studio for that).
The only disadvantage I found (IMO) on LINQ so far is that quering remote datasources is bound to Microsoft SQL Server database. (Maybe this will be extended in the future)
That involves, the so called "LINQ to SQL" methods, which is, I believe, allready deprecated.
As said before Delphi Prism completely supports LINQ. Starting a 3.5 framework application will give you a reference to System.Linq, the namespace, where LINQ lives.
In this series I will explore LINQ using Delphi Prism:
1. Using LINQ on a sequence
LINQ, in Delphi Prism, works on so called sequences, which is a new type described in the Delphi Prism Wiki as:
Sequences are a special type in the language and can be thought of as a collection of elements, similar to an array.
Declare a sequence like this:
var
Names : sequence of String :=
['Mickey', 'Dick', 'Roland', 'Delphi', 'Harry'];
With LINQ it is very easy to query a collection, like this sequence. You can do this in two ways, namely:
1. Using Lambda expressions
2. Using query comprehension syntax (Query Syntax)
With Lambda expressions you can write rather small expressions to query the data, with the query syntax they become more readable (read less magic ;-)).
By the way the compiler (at least in C#) will translate the query syntax into lambda expressions. Both techniques are complementary. (I think the Oxygene compiler also does this....)
Suppose we want to have all the names from our sequence which have more then 4 characters, containing an "a" and sorted in upper case.
//Using Lambda syntax
var FilteredNames := Names
.Where (n -> (n.Length >= 4)
and n.Contains('a'))
.OrderBy (n -> n)
.Select (n -> n.ToUpper());
//Using query comprehension syntax
var FilteredNames := from n in Names
where ((n.Length >= 4)
and n.Contains('a'))
order by n
select n.ToUpper;
//Note we don't have to declare FilteredNames
Iterate through the filterednames to show them in a messagebox:
for s : string in FilteredNames do begin
FilteredOnes := FilteredOnes + s + "--"
end;
MessageBox.Show('FilteredOnes: ' + FilteredOnes)
Note that the original collection, Names in this case, is still holding all the elements.
Conclusion LINQ is a, in basic, simple way to query collections the SQL way. Delphi Prism supports them complete. Choosing Lambda expression or Query syntax will be mostly a personal preference.
Thursday, November 20, 2008
DevExpress will support Delphi Prism
Now that Delphi for .NET (now Delphi Prism) has become a Visual Studio plugin it is possible to use all the .NET components out there.
DevExpress, which btw started as a Delphi shop, has a great component set called DXperience for ASP.NET and Winforms development. Until now they only supported the Visual Studio IDE's.
You could use this components also in Delphi for .NET however they were not officialy supported. (No installation and technical support)
According to this blogpost by Julian Bucknall the CTO of DevExpress, it looks like they will support Delphi Prism in the official sense of the word.
The story is that we shall be supporting Delphi Prism with DXperience and we're evaluating what we need to do to make that work. As it happens: not very much -- it installs just fine and, on first blush, seems to work just fine. There are more exhaustive tests to complete, obviously.
Of course this is not an official statement......
We use the DXPerience components daily in our C# projects, and they are just great. We feel that Visual Studio with C#/VB.NET/Delphi Prism + DXPerience gives the developer the same power as Delphi for Win32 as we know it for so long. (For Winforms developement).
In my opinion this is great step for Delphi Prism in the .NET world.
Monday, October 27, 2008
Delphi Prism, some first thoughts
Added: Interview with marc hoffman, Chief Architect at Remobjects on Bitwise Magazine.
After five years of several solutions and directions, it looks like Delphi for .NET has finally found a good home.
Although Delphi .NET only exists for only about four years, there have been a lot of changes in the strategy executed by Borland, Borland/CodeGear and now Embarcadero. So let's take a brief look at the Delphi for .NET history:
2004 - Delphi 8 (Borland)
Delphi for .NET is born for the .NET Framework version 1.1. Delphi for .NET is positioned as a first class .NET citizen. It offers .NET 1.1 development for Winforms, ASP.NET and VCL.NET, which is the .NET variant of the VCL, offering a highly compatible framework based on .NET.
2005 - Delphi 2005 (Borland)
Delphi 2005 offers the same as Delphi 8 but Delphi 2005 has a lot improvements in quality.
2006 - Delphi 2006 (Borland)
Delphi 2006 still has support for the .NET Framework 1.1 (Winforms, ASP.NET and VCL.NET) Delphi 2006 offers a stable IDE for this developments. The fact that it does not support .NET 2.0 shows the trouble that Borland had to keep up with Microsoft.
2007 - Delphi 2007 (CodeGear/Borland)
Delphi 2007 finally supports .NET 2.0, but unfortunately the Winforms support is dropped. (Only ASP.NET and VCL.NET is supported)
2008 - Delphi 2008 (Embarcadero)
Delphi 2009 has become a Visual Studio Plugin based on Oxygene (formely known as Chrome) offering support for all available Microsoft .NET technology's (2.0, 3.0, 3.5))
Unfortunately it looks like VCL.NET is dropped.
It is not likely that the Delphi for .NET product strategy will be nominated for best executed product strategy ever.
However this is a very strong sign of the new spirit that Embarcadero is bringing to Delphi. It proofs that the buyout by Embarcadero is the best thing that happened to Delphi (and of course CodeGear) in the last five years.
Back to Delphi Prism:
Delphi Prism the pros
1. Instant support for all Microsoft .NET technologies.
2. The Delphi language is now at same level as C#, VB.NET, so the choice for the Delphi language can be made much easier. (Hack it is the same IDE)
3. Delphi for Win32 can focus on Win32 again, will not be hold back by .NET technologies.
Delphi Prism the cons
1. Less compatibilty with Delphi Win32 technologies, due to pure .NET and languages changes/additions. (Compared to VCL-VCL.NET, VCL-Winforms)
2. After Winforms, now VCL.NET dropped, and that will not please every body.
All with all the pros weigh more than the cons in my opinion.
Why use Delphi Prism?
This question is not answered easily. I think a lot of Delphi developers went for C# in the last four years. For example we decided in 2007 to standarize our .NET development on Visual Studio C# due to the dropping of Winforms in Delphi 2007 (Basicaly due to the mixed/confusing messages by Borland).
Conclusion
Although we don't know all the ins and outs yet (sure will hear a lot more the coming week) this is by far the best thing ever that happened to Delphi for .NET.
Use an image as your UIBarButtonItem
Using an image as your UIBarButtonItem in your navigationcontroller bar can only be achieved by using a common UIButton as the BarButtonItem...
-
How to get, for example, all the hyperlinks from a webpage, which is loaded in your iPhone app using the UIWebView control? (Xcode's web...
-
Using an image as your UIBarButtonItem in your navigationcontroller bar can only be achieved by using a common UIButton as the BarButtonItem...
-
In ASP.NET it is easy to set the prefered authentication method in the web.config file. For external websites this is set mostly to Forms ...