new DotNetIde("x-develop"); 1
This morning Hans Cratz announced in the Mono Devel List the preview release of the new x-develop IDE.
I’m currently trying it, and you know what ? I’m happy. I’m switching my current development to it, just to see. At least it seems to be very promising. I have to admit I’m a bit jealous, it seems that I’m not the only one to want an Eclipse#. Yes, it is cross platform, and if I’ve not tried it under my Linux box, be sure I will.
Here is a quote from the mail :
Feature showcase:
- Instant detection of errors throughout all files
No need to compile in order to find out if there are errors. X-develop checks all files in the solution on-the-fly in the background and displays errors in an instant.
- Refactoring
X-develop includes refactorings for renaming variables, methods, classes, changing method signature, extracting methods and more.
- Productivity features
X-develop boosts productivity with coding tools such as Organize imports, Usage search, Code formatting, Smart templates, Go to class, Go to symbol and more.
- VS.net 2005 compatibility
X-develop uses the solutio/project concept from VS.net 2005. Solutions/projects created for Windows can be loaded and modified with X-develop on Linux.
It rocks. I’m now playing with code templates, code metrics. There is a lot of good stuff in this. I’ve not enough time to write a complete review of it, but it’s an interesting article idea for DNG.
Go, try it, and make your own idea. My question now is will it be free ?
Some links :
Edit
I was so excited that I did not even notice that it is written in Java, but does it cares ? A little, I think an Eclipse# written in .net should be a very exciting thing.
Type 6 IOC, weaving the dependency 4
Everybody’s gone weavin’,
Weavin’ D.N.G. !
Life is a beach, let’s try a new meta aspect : ReplaceConstructorCall, and by the way, discover a new type of IOC, not constructor based, not setter based, everything is done by AspectDNG. Maybe this is not even IOC. Don’t care, it’s cool.
I’ve written this today, it’s some kind of proof of concept. It is in CVS now, but maybe it will evolve or change. IOC is one buzz word of today. In one of his (famous) article, in French, and in English, Sami Jaber describes 3 types of commonly used IOC, interface based, getter based, and constructor based. I have named this blog entry after this article on tss. Mainly because I’m not really serious. However, I think that AOP may “eclipse” IOC.
An example is coming.
The beginning, a very simple set of base classes :
<span class="rem">// base.cs</span>
<span class="kwrd">namespace</span> AspectDNG.Sample {
<span class="kwrd">public</span> <span class="kwrd">interface</span> IComplexSystem {
<span class="kwrd">void</span> DoTheWholeThing(<span class="kwrd">string</span> a);
}
<span class="kwrd">public</span> <span class="kwrd">class</span> MockSystem : IComplexSystem {
<span class="kwrd">public</span> MockSystem() {}
<span class="kwrd">public</span> <span class="kwrd">void</span> DoTheWholeThing(<span class="kwrd">string</span> a) {}
}
<span class="kwrd">public</span> <span class="kwrd">class</span> Pono {
<span class="kwrd">private</span> <span class="kwrd">string</span> m_a;
<span class="kwrd">private</span> IComplexSystem m_system = <span class="kwrd">new</span> MockSystem();
<span class="kwrd">public</span> Pono(<span class="kwrd">string</span> a) {
m_a = a;
}
<span class="kwrd">public</span> <span class="kwrd">void</span> TryTheThing() {
m_system.DoTheWholeThing(m_a);
}
}
<span class="kwrd">public</span> <span class="kwrd">class</span> EntryPoint {
<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args) {
Pono p = <span class="kwrd">new</span> Pono(<span class="str">"HELLO IOC6 !"</span>);
p.TryTheThing();
}
}
}
What can we see there ? An interface, describing a complex system we want to use, then a Mock object, that may be avoided, but that is there for type safety, and for bookmarking. After this you find a plain old .net object, that depends on our complex system. The entry point creates the Pono object, and ask him to call its dependency. If you compile that and call it, nothing will happens. Let’s weave the dependencies ! Here is my aspect :
<span class="rem">// aspect.cs</span>
<span class="kwrd">namespace</span> AspectDNG.Sample {
<span class="kwrd">using</span> AspectDNG;
[Insert(<span class="str">"module:"</span>)]
<span class="kwrd">public</span> <span class="kwrd">class</span> RealComplexSystem : IComplexSystem {
[ReplaceConstructorCall(<span class="str">"* *.MockSystem::.ctor()"</span>)]
<span class="kwrd">public</span> RealComplexSystem() {}
<span class="kwrd">public</span> <span class="kwrd">void</span> DoTheWholeThing(<span class="kwrd">string</span> a) {
System.Console.WriteLine(a.ToLower());
}
}
}
This is a concrete implementation of my complex service. I use custom attributes to describe that I want RealComplexSystem to be
inserted in the main module of the target assembly, and I use my new ReplaceConstructorCall. It’s explicit, every call to the constructor
of MockSystem will be replaced by the constructor of RealComplexSystem. It rocks no ?If I execute this, my complex system will do its job :
D:/temporary/adng>AspectDNG -dw base.exe aspect.dll D:/temporary/adng>base hello ioc6 ! D:/temporary/adng>
So, what do you think about this ?
Your very first aspect weaving with AspectDNG 1
After almost one year and a half, AspectDNG is still under heavy development.
One of the last exciting features is the full rewriting of the weaving engine. Please
thanks Thomas Gil for his work. The weaving engine is now much more faster,
and written in full C# (no more XSLT processing).
The 0.6.1 version of AspectDNG, available both on sourceforge and in the CVS,
introduce a new, and much more simple way of describing all the joinpoints using
Custom Attributes. Don’t be desappointed, let’s write a simple exemple.
Let’s write an Hello World, AspectDNG’s way.
<span class="rem">// base.cs</span>
<span class="kwrd">namespace</span> AspectDNG.Sample {
<span class="kwrd">public</span> <span class="kwrd">class</span> EntryPoint {
<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> Main() {
System.Console.Write(<span class="str">"World"</span>);
}
}
}
Now we can take a look to the aspect code :
<span class="rem">// aspect.cs</span>
<span class="kwrd">namespace</span> AspectDNG.Sample.Aspect {
<span class="kwrd">public</span> <span class="kwrd">class</span> HelloAspect {
[AspectDNG.InlineAtStart(<span class="str">"* *.EntryPoint::Main(*)"</span>)]
<span class="kwrd">public</span> <span class="kwrd">void</span> Hello() {
System.Console.Write(<span class="str">"Hello "</span>);
}
[AspectDNG.InlineBeforeReturn(<span class="str">"* *.EntryPoint::Main(*)"</span>)]
<span class="kwrd">public</span> <span class="kwrd">void</span> Emphase() {
System.Console.WriteLine(<span class="str">" !"</span>);
}
}
}
Pretty simple isn’t it ? Every meta-aspect inside AspectDNG has its own Custom Attribute.
So you don’t have to write the whole XML descriptor as you used to. By doing it this way, you introduce a dependency
between your aspects, and AspectDNG, but I’m sure it is not the worth thing you’ve ever written.
Moreover, if you want to keep your aspects clean, you can still use the good old XML way.
Much more “pure”, but a little painfull. By the way, take a look to the new jointpoint syntax that will be translated
in a xpath query. User-friendly no ? But just take a look at the process, here is a console dump:jbe@monkey:~/Devel/weave $ ls aspect.cs AspectDNGAttributes.dll AspectDNG.exe base.cs jbe@monkey:~/Devel/weave $ mcs base.cs jbe@monkey:~/Devel/weave $ mcs aspect.cs -r:AspectDNGAttributes.dll -t:library jbe@monkey:~/Devel/weave $ mono base.exe World jbe@monkey:~/Devel/weave $ mono AspectDNG.exe -dw base.exe aspect.dll jbe@monkey:~/Devel/weave $ mono base.exe Hello World ! jbe@monkey:~/Devel/weave $
AspectDNG is not ended. I’m currently rewriting the base layer. I think I may post about this new library in one or two week. This should be very exciting. By getting rid of Rail, we should increase weaving speed, and improve ILML completeness. One of the other point is the lack of documentation, you have to read the tests included in AspectDNG to see the whole thing. We are discussing about how this documentation will be written.
By the way, as you can see in the console dump, Mono is working better and better… Of course it works with Microsoft’s Framework too.
Some links :
Edit : Renaud sent me a mail indicating that it works on OS X too, thanks to Mono.
The screenshot.
