DotNetGuru contributes to Mono, or the contrary 5
<span class="kwrd">using</span> Mono.Cecil;
Tonight, Cecil will leave SourceForge’s CVS to a better place, in the sun.
Cecil’s development will now be supported by Mono’s SVN. By the way, its name change a little bit. It is now Mono.Cecil, hey, sounds good no ?
Thanks to Miguel De Icaza, I have received a write access to Mono’s SVN last night. Cecil will be a top module until it is mature enough to be bundled with others Mono’s assemblies.
I’m proud, but a lot of work remains, Cecil isn’t really usable, but I hope that its new status will improve the speed of the devel, and will bring more feedbacks and bugs reports.
Last but not least, this blog may be syndicated within the Monologue, by this way the world may discovers AspectDNG, and others DNG activities I’ll blog on.
I’ll post as soon as migration is ended, to give you instructions to access Cecil’s repository. I may blog later on some screen shots of a little Gtk# application, using Cecil, that mimics ildasm, but it is really simple and limited to Cecil progress.
Isn’t the year 2005 beginning very well ?
DNG, Cecil, X-develop 1
Nom de zeus !
J'ai toujours un onglet FireFox pointant sur DotNetGuru, et quand l'envie m'en prend, j'y fait un petit F5. J'ai cru que que mon renard partait en vrille, mais non, DNG a bel et bien changé.
Bon, mon premier réflexe fut de plisser les yeux et de faire berk. Bon c'est pas ma faute, il faut croire que j'aime les couleurs tristes. En ce sens il m'allait bien l'ancien DNGn de toute façon, faut pas m'écouter, je suis pire que les vieux. Mais bon, à force de naviguer dessus depuis dix bonnes minutes, on s'y fait plutôt pas mal. Les polices sont plus smooth, et globalement on s'y retrouve. Seul manque à l'appel les anciens messages du forum, et surtout, la page sur AspectDNG. Crime ! Donc au final, je m'y fait plutôt bien, et bravo pour le switch éclair sans anicroches.
Ce post allant surement croiser ceux d'autres gens sur le même sujet, je passe à autre chose.
Cecil ma fille
J'ai mis à disposition des curieux un snapshot fraichement tiré du CVS de sourceforge, de ma petite librairie Cecil. Petite librairie, qui n'a pour ambition que de fournir une alternative complètement managée à System.Reflection, et System.Reflection.Emit. Je vous laisse regarder ici :
Alors où en suis-je ? La partie lecture des meta données est pratiquement terminée, et la partie Reflection ne va que jusqu'aux modules, mais ça laisse quand même appercevoir à quoi la librairie pourra ressembler au final. Je remercie d'avance tous les curieux et les courageux, qui mettront ici leurs commentaires sur ce petit bout de code. Petit conseil final, allez voir dans les tests pour non seulement admirer comment je debug avec des Console.WriteLine dans NUnit, mais surtout pour voir comment manipuler le "point d'entrée" de la librairie.
Au passage, je suis passé à X-develop pour développer cette librairie, et le fait est, que c'est vraiment un IDE très orienté source, et que pour mon usage, il est vraiment bien. Ma version d'évaluation se fini au cours du mois, ils ont intérêt à rallonger la licence de test si ils veulent que je continue à écrire des bugs reports.
EDIT :
La page AspectDNG est de retour, joie.
L'ancien site sera disponible à une autre adresse, joie. Que demande le peuple ?
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 ?
