tag:blogger.com,1999:blog-371715902024-03-23T03:14:37.587-07:00Onur Gumus's BlogOnur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-37171590.post-65410276144658624302011-02-13T23:34:00.000-08:002011-02-13T23:45:34.546-08:00Wikipedia guy deletes programming articles.Recently one of my friends notified me that the article for the programming language <a href="http://nemerle.org">Nemerle </a>has been deleted from Wikipedia. And I am very upset about it . This language is still very active and widely used in russian communities and I myself is one of the developers. I also have production projects with it. Here you can read the discussion<br /><a href="http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Nemerle ">http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Nemerle </a><br />It seems this Monsanto guy <a href="http://monsan.to/">http://monsan.to/</a> is one of the power abusers, and despite all the discussion he has deleted it with no solid reason. Shame on him, shame on wikipedia for this action. <br /><br />I always thought wikipedia is one of the most neutral (at least trying to be ) places to gather info but this sensorship , this irresponsiblity or what ever you call is totally unacceptable. You can tell me it is a non notable language so has no right to exist in wikipedia. We could debate about it. But the lanaguage has 8 years of constant effort of developers, how would you feel if your baby is treated like this ?<br />Here you can see all the checkin history of nemerle:<br /><a href=" http://code.google.com/p/nemerle/source/list "> http://code.google.com/p/nemerle/source/list </a><br />and this Monsanto guy just deletes it shame on him!Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com11tag:blogger.com,1999:blog-37171590.post-75601556063340089002009-02-07T00:33:00.000-08:002009-06-17T07:43:06.523-07:00C# versus C++ versus Java performance comparisonThe performance comparison of C#, Java and C++ was always a controversial subject. Many people who are unfamiliar with JIT'ed environments claimed anything runs on JIT is too slow compared to C++. On the other hand people who actually use Java and C# usually claimed the otherwise that performance impact is negligable. Here's a nice chart I've found that a friend in freenode IRC server pointed me. <span style="font-weight:bold;">These benchmarks are done by Matt R Warren (aka Moridin8 in irc.freenode.net) and his original site is <a href="http://www.csharp-architect.com/">http://www.csharp-architect.com</a></span><br /><br /><br />According to below chart, choosing C++ just for the sake of performance doesn't seem very feasable to me. Remember : <span style="font-weight: bold;">Engineers are expensive and servers are not!</span><br /><br /><br /><br /><br /><img width="1000px" src="http://www.csharp-architect.com/images/benchmarksJan2009Final.gif" />Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com75tag:blogger.com,1999:blog-37171590.post-83626189462737893562009-02-01T15:19:00.000-08:002009-02-02T19:52:46.874-08:00Don't wait for C# 5, use Nemerle Now !!!Hello ,<br />I mentioned nemerle before as C# glorified <a href="http://reverseblade.blogspot.com/2008/06/c-glorified-nemerle.html">here</a> . As you know C# 5.0 will came with compiler services that allows us to run dynamic code on runtime. Mono has already have it but it is not available to Windows at the moment (you can reference gmcs on windows but with limited support only). So here's our example:<br /><br /><code><span style="color: rgb(0, 0, 255);">using</span> System;<br /><span style="color: rgb(0, 0, 255);">using</span> System.<span style="color: rgb(43, 145, 175);">Console</span> ;<br /><span style="color: rgb(0, 0, 255);">using</span> Nemerle.Evaluation.<span style="color: rgb(43, 145, 175);">Evaluator</span> ;<br /><br /><span style="color: rgb(0, 0, 255);">module</span> <span style="color: rgb(43, 145, 175);">Program</span><br />{<br /> Main() : <span style="color: rgb(0, 0, 255);">void</span><br /> {<br /> <span style="color: rgb(0, 0, 255);">def</span> function = EvaluateExpression( <span style="color: rgb(163, 21, 21);">"x => x + 1.0"</span> ) :> <span style="color: rgb(0, 0, 255);">double</span> -> <span style="color: rgb(0, 0, 255);">double</span> ;<br /> </code><code><span style="color: rgb(43, 145, 175);">Console</span></code><code>.WriteLine(function(2.0));<br /> }<br />}<br /><br />The above code outputs 3!! Simply wonderful and best of all this code is in visual studio with full intellisense as below:<br /><br /></code><a href="http://emperon.googlepages.com/nem1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://emperon.googlepages.com/nem1.png" alt="" id="BLOGGER_PHOTO_ID_5297974634497474866" border="0" /></a>Just install nemerle from http://nemerle.org and add Nemerle.Macros and Nemerle.Evaluator as reference and run the code that's it!<br /><br /><code><br /></code><br /><br /><img src = "http://emperon.googlepages.com/nem2.png"/><br /><br /><img src = "http://emperon.googlepages.com/nem3.png"/>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com6tag:blogger.com,1999:blog-37171590.post-18492804150785581202008-11-16T14:13:00.001-08:002008-11-16T14:35:43.033-08:00How to serialize Lambda ExpressionsAt times I need to serialize my Lambda Expressions, to pass to some web service . Normally this wasn't possible but I realized the <a href="http://www.codeplex.com/metalinq">MetaLinq</a> project allows it. MetaLinq actually grants us modifiable Expression trees. As you might now know Expression Trees are immutable just like strings. Anyway let's serialize and deserialize a Lambda expression within the code:<br /><br /> <span style="color: rgb(51, 102, 255);">Expression</span><<span style="color: rgb(51, 102, 255);">Func</span><<span style="color: rgb(51, 102, 255);">int</span>,<span style="color: rgb(51, 102, 255);">int</span>>> myLambda = z => z*z ;<br /><br /><span style="color: rgb(0, 153, 0);">// Create a mutable expression, we are using ExpressionBuilder namespace in MetaLinq here</span><br /> <span style="color: rgb(0, 0, 153);">var </span>mutableExpression = <span style="color: rgb(51, 102, 255);">ExpressionBuilder</span>.<span style="color: rgb(51, 102, 255);">EditableExpression</span>.CreateEditableExpression(myLambda);<br /><br /><span style="color: rgb(0, 153, 0);">// Serialize it</span><br /> <span style="color: rgb(0, 0, 153);">var </span>serializer = <span style="color: rgb(0, 0, 153);">new </span><span style="color: rgb(51, 102, 255);">XmlSerializer</span>(<span style="color: rgb(0, 0, 153);">typeof</span>(<span style="color: rgb(51, 102, 255);">EditableLambdaExpression</span>));<br /> <span style="color: rgb(0, 0, 153);">var </span>sw = <span style="color: rgb(0, 0, 153);">new </span><span style="color: rgb(51, 102, 255);">StringWriter</span>();<br /> serializer.Serialize(sw, mutableExpression);<br /> <br /><span style="color: rgb(0, 153, 0);">// Get the lambda as string, actually sw.ToString() will give us it in string form</span><br /><br /><span style="color: rgb(0, 0, 153);">var </span>sr = <span style="color: rgb(0, 0, 153);">new </span><span style="color: rgb(51, 51, 255);">StringReader</span>(sw.ToString());<br /><br /><span style="color: rgb(0, 0, 153);">var </span>anotherSerializer = new XmlSerializer(typeof(<span style="color: rgb(51, 102, 255);">EditableLambdaExpression</span>));<br /> <br /><span style="color: rgb(0, 153, 0);">// Deserialize it</span><br /><span style="color: rgb(0, 0, 153);">var </span>myex = anotherSerializer.Deserialize(sr) <span style="color: rgb(0, 0, 153);">as </span><span style="color: rgb(51, 102, 255);">EditableExpression</span>;<br /><br /><span style="color: rgb(0, 153, 0);">// Convert it to lambda expresion</span><br /> <br /><span style="color: rgb(0, 0, 153);">var </span>myNewLambda = myex.ToExpression() as <span style="color: rgb(51, 102, 255);">LambdaExpression</span>;<br /> <br /><span style="color: rgb(0, 153, 0);">// Invoke it, outputs 16 as expected</span><br /> <span style="color: rgb(51, 102, 255);">Console</span>.Write(myNewLambda.Compile().DynamicInvoke(4));<br /><br /><br />So this shows us how to convert an expression to string and restore back to expression and invoke it. DynamicInvoke used here since I assumed we don't know the type here. I hope you find it usefulOnur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com8tag:blogger.com,1999:blog-37171590.post-23426923353908972432008-06-20T23:14:00.000-07:002009-02-09T00:32:47.170-08:00Web development: Ruby on Rails versus ASP.NET , Flex, PHP and other Java stuffI've got some feedback from my earlier post on <a href="http://reverseblade.blogspot.com/2008/06/web-development-aspnet-webforms-versus.html">ASP.NET versus Others .</a> In that particular post I claimed ASP.NET WebForms works best for me and I presented my own reasons why I think that way. I might be a little biased may be so I'd like to share my opinions for the other side of the equation, namely Rails versus Others:<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.rubyonrails.org/images/rails.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 281px; height: 361px;" src="http://www.rubyonrails.org/images/rails.png" alt="" border="0" /></a><br />There is an old saying that, "Teacher will appear , when the student is ready". The fundemantal reason rails emerged was because there was a need for it, mainly from java developers. Java web frameworks generally have excellent architectures. They are clean and they follow good design practices. However following good design practices made them a bit more academic rather than practical. First the EJB 1 and 2 nightmares frustrated java developers then they settled to some ground with Spring and Hibernate. Although this solution was acceptable, the development overhead was rather large. The idea beyond rails is to compact this entire J2ee thingy to an acceptable size and replace a verbose language like java with an elegant language called ruby and we got rails.<br /><br />When I first dived into rails I really thought that was the answer I was looking for. So I loved it too much. (Then I went back to asp.net. But I wouldn't do that if there were no mono. I am biased against MS)<br /><br />Ruby had two main philosophies. "Convention over configuration" and "Don't repeat yourself". We will discuss about them. Also rails was the main push behind the <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTFUL Webservices</a>.<br /><br />Let's get to Pros and Cons of Rails:<br /><br /><span style="font-weight: bold;">Pros of Ruby On Rails:<span style="font-weight: bold;"><span style="font-weight: bold;"><br />*</span></span></span> Open Source and Community Driven<br />* Cross platform, works every where<br />* Ruby is an elegant language<br />* Extremely Scalable (a front end proxy balancer will do it)<br />* Built in unit testing and ajax support<br />* Clean seperation of layers<br />* Zero configuration (convention over configuration)<br />* Extremely flexible<br />* Main stream, good community and lot's of books<br /><br />Well this are the good things come into my mind. Looks promising right ? Let's see the other side of the equation.<br /><br /><br /><span style="font-weight: bold;">Cons of Ruby On Rails</span>:<br /><span style="font-weight: bold;">* </span>Single threaded!!! Wow this is quite intersting for a web framework. Fortunately this doesn't prevent us to build scalable applications<br />* No unicode yet. You can over come this with JRuby on Rails and IronRuby on Rails<br />* Green threads. It doesn't use real os threads. Look above.<br />* The down side of the MVC pattern. You have to type a lot of html<br />* Database abstraction is too thin. This is something I don't like. The columns in your db implictly becomes properties of your classes. Even if there is no code !!!<br />* Most software shops don't know about it. So it is unlikely that you can use it at work.<br /><br /><br />Well that's all in my mind. Let's get into one by one comparison<br /><br /><span style="font-weight: bold;">Ruby on Rails versus Java frameworks:</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggwh3Otteu9yFEEGvw5XvbQaZQIbGjbOAMJqEe4Q8BDbDMnUJfEaP4uM2mgIvOgzmXtBCXkG3_Dof7dvBjuKp5jesh0JmJHUbBlOJ5A0v77-rdeY1M0xE0iFaylEZhLbIMuMw0nw/s1600-h/java_vs_rubyonrails.miniatura.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggwh3Otteu9yFEEGvw5XvbQaZQIbGjbOAMJqEe4Q8BDbDMnUJfEaP4uM2mgIvOgzmXtBCXkG3_Dof7dvBjuKp5jesh0JmJHUbBlOJ5A0v77-rdeY1M0xE0iFaylEZhLbIMuMw0nw/s320/java_vs_rubyonrails.miniatura.jpg" alt="" id="BLOGGER_PHOTO_ID_5214770538898418578" border="0" /></a><br />Now they say a picture is worth a thousand words. That's a true comparison of java frameworks and rails. It basicly eliminates boring stuff like xml configuration of spring and hibernate. Sure Java frameworks is far more powerful than rails. But if you say who needs an 800 pounds of gorilla. Then rails is the right way to go. Note that Java also have JRuby on Rails and Groovy on Rails. This comparison excludes them but points the traditional approach of java web frameworks. I know this isn't enough for technical comparison but that's all I am gonna say about it now.<br /><br /><span style="font-weight: bold;">Ruby on Rails versus PHP:<span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><br /><span style="font-weight: bold;"><br /></span></span></span></span></span></span></span></span></span><span>Yes I am a </span><span></span><span> php basher. Compared to plain PHP rails is superior Period. Plain php is too old. It's like COBOL imho. And the irony is Facebook uses PHP. Well... But PHP has a lot of grown frameworks. Even Rails like ones like Cake or Symfony. A quick google will tell you more. But my suggestion would be to stay away from PHP unless you are dealing with legacy stuff.</span><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><br /><br />Ruby on Rails versus ASP.NET:<br /><br /></span></span></span><span> I already made a detailed comparsion</span><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"> </span></span></span></span> <a href="http://reverseblade.blogspot.com/2008/06/web-development-aspnet-webforms-versus.html">ASP.NET versus Others</a>. Telling why I found ASP.NET superior. But unlike my php comparison , I find this is a matter of personal taste. Rails is an excellent framework offers valid solutions. If you like more componentize approach with .NET/mono power then ASP.NET is the way to go. Otherwise rails may suit you better.<br />One technical thing rails is better is that it can emulate true bidirectional associations. For instance:<br />my_school.students << my_student <br />implicitly does a my_student.School = my_school<br /><br />The same situation is extremely difficult to achive with static languages like C#.In general you do explicitly<br /><br />mySchool.Students.Add(myStudent);<br />myStudent.School = mySchool;<br /><br /><br /><br /><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;">Ruby on Rails versus Flex:<br /><br /></span></span></span><span>Now this can't be a comparison because Flex is for pure front end. And you can perfectly use Flex with Rails. Even there is a book for it. </span><a href="http://www.flexiblerails.com/"><span>Flexible Rails</span></a><span>. Some people call Flex+ Rails as the RIA Nirvana. I told you I like a componentized approach. Flex is perfect for that. And rails is very good at serializing the domain data back and forth to Flex. If you can tolarate a flash thingie running inside your application (which I can't!) this is a perfect way to go. </span><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><br /><br />Others:<span style="font-weight: bold;"><br /></span></span></span></span><span>Wheather rails is a hype or not, it is a really milestone in web application programming. It inspired other web framework developers a lot. Python got Django and TurboGears, PHP got Cake and Symfony, ASP.NET got MonoRail and ASP.NET MVC.</span><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"> </span></span></span></span><span>Unfortunately I am not involved with them so I can't really compare them. </span><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><br /><br /><br />Conclusion:<br /></span></span></span></span><span>If you tried others and still not satisfied try rails. I am sure that you won't regret. And where do you start ? I personally start with the Agile book available on rails' web site. But there is a huge documentation & screen casts on web too. Good luck !</span><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><br /></span><span style="font-weight: bold;"></span><br /></span></span></span>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com9tag:blogger.com,1999:blog-37171590.post-44590524311874003622008-06-19T13:56:00.000-07:002008-06-20T05:39:07.399-07:00Java swing developer's painful moments!I've programmed swing for while when I was java programmer. And I admit it was quite painful for me. At those times, before group layout in netbeans 5 emerged, we were forced to use some silly java layouts. The reason for that was suppose to be the sake of cross platformity. I remember absolute coordinates were highly discouraged in swing world. Instead, all we had was those crappy layouts namely, spring, grid, gridbag, etc. I know some people implement their own layouts and some use things like JGoodies. But all I remember is a bad taste from swing. Now watch <a target="_blank" href="http://madbean.com/static/blog/2004/17/anim.swf">this</a> clip.<br /><br />Funny right ? Well when I watched that I saw my self in a way. I never understood why I have to suffer that much. Now let me show you something. You probably know about the <a href="http://www.mono-project.com/Main_Page">Mono</a> framework I mentioned earlier. The open source .net implementation. It also implemented Windows Forms so that it allows us to run windows forms applications on linux too. And all you need is mono and its windows forms packages. No wine nor nothing else extra needed: Here are some screenshots for NUnit and NClass running on linux:<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://nunit.com/blogs/wp-content/uploads/2006/07/WindowsForms-Screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 392px; height: 245px;" src="http://nunit.com/blogs/wp-content/uploads/2006/07/WindowsForms-Screenshot.png" alt="" border="0" /></a><br /><span style="font-weight: bold;">Nunit above running on linux</span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.mono-project.com/files/0/02/Linux4.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://www.mono-project.com/files/0/02/Linux4.png" alt="" border="0" /></a><span style="font-weight: bold;">NClass above running on linux.<span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><br /><br /></span></span></span></span></span>The interesting thing is both applications are written with windows forms (and written for windows without considering cross platformity) and windows forms uses absolute position and docking approach. So I feel pity for the moments I suffered for swing. Thank you mono!!!Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com5tag:blogger.com,1999:blog-37171590.post-50964961141132042752008-06-19T12:00:00.000-07:002008-10-28T17:16:12.729-07:00Forkwind Part 4: Domain Driven Design and Record Driven DesignForkwind is a tutorial on how to build a well designed .net application. This is the 4th part of our forkwind implementation. If you are not aware of the master thread and forkwind, please go <a href="http://reverseblade.blogspot.com/2008/06/forkwind-application-design-from.html">here</a> first for introduction.<br /><br /><br /><span style="font-weight: bold;"><span style="font-size:130%;">I</span><span style="font-size:130%;">ntroduction:</span></span><br /><br />In this part, we are going to dive in to some theory again. We are going to discuss two design methodologies. Domain driven design and record oriented design. In my honest opinion both methodologies are decent. But slowly record oriented design isbecoming obselete. Actually this discussion is not very popular in the software world beyond .net. Most of the recent frameworks like rails and java frameworks use domain driven design as de facto standard. .NET world however is quite lagging in this manner.<br /><span style="font-size:130%;"><br /></span><span style="font-weight: bold;font-size:130%;" >What is Record Oriented Development ?</span><br /><br />I am not going to make a formal definition. But in practice, record oriented development focuses on the records within the database. It is record centric in a sense. Database records are passed within layers. Records are just mere containers and having no semantic meaning. In .NET world datasets used together with datatables are good examples to this methodology. They are mostly typeless but just records. In .net 2.0 we had <span style="font-weight: bold;">Typed Datasets</span> but they are merely generated code.<br /><br />Usually the first step in record driven development is to design the database , tables and relations and build your application on top of that. If we were developing Forkwind in a record oriented manner, then first we would have created tables like Company, Product, Supplier ,etc<br /><br /><span style="font-size:130%;"><br /></span><span style="font-weight: bold;font-size:130%;" >What is Domain Oriented Development ?</span><br /><br />In domain driven development, we define domain entities to solve our particular problem. It is a more object oriented approach. For example Forkwind is an application to keep track of orders to customers and suppliers. So we create typed objects like Customer and Supplier as a first step. We generally ignore the database design to later part thanks to ORM tools and object databases. Though there is one exception to that : If the database is already created and with full of data then we have to adapt our domain entities according to that tables. This is a common and painful scenario with domain driven development.<br /><span style="font-size:130%;"><br /></span><span style="font-weight: bold;font-size:130%;" ><br /></span><span style="font-size:130%;"><br /></span><span style="font-weight: bold;"><span style="font-size:130%;">Why domain driven development is not popular in .NET ?</span><br /><br /></span>This has historical reasons. Before .NET, I was coding with MFC and pure Win32 for gui stuff in windows. Frankly speaking both MFC and Win32 was dirtier than my toilet. The api was terrible. Then came the Visual Basic 6. When VB6 emerged, my neigbour's son became a more productive programmer than I am. VB6, which I never liked, allowed developers quickly design applications. Managers liked it very much because all that matters was the software running. They are not concerned with the maintenance nightmare coming from<span style="font-weight: bold;"> "Quick and Dirty"</span> approach of VB6. I also conspire Bill Gates himself was a big pusher of Visual Basic because of his personal sympathy to BASIC. VB6 was using ADO to connect database which is completely record oriented. So when .NET emerged , record oriented approach already widely accepted in .net world. Also microsoft used this fact to sell its IDE so called Visual studio to show how easy to create an application just by dragging and dropping a database table to the screen. They made a propaganda on that this approach such that you are suppose to produce quicker (but dirtier) applications and you will save money on development costs (but lose on maintenance). The last reason is the Microsof's failed ORM Mapper called <a href="http://aspalliance.com/articleViewer.aspx?aId=248">Objectspaces</a>. Microsoft was planning to deliver this ORM mapper with Visual Studio 2005. But project failed miserably. So MS silently carried on ignoring domain driven development methodologies till 2007-2008 where we have linq to sql and ADO.NET Entity framework now.<br /><br />Enough history let's get into technical details:<br /><br /><span style="font-weight: bold;">Domain Driven Development Pros:</span><br /><br />* More Object Oriented approach<br />* Much better maintenance<br />* Sounds more correct<br /><br /><span style="font-weight: bold;">Domain Driven Development Cons:</span><br />* Less mainstream on .NET<br />* Requires skill!!<br />* You have to use things like ORM<br /><br /><span style="font-weight: bold;">Record Driven Development Pros:</span><br />* Easier for novice<br />* Visual studio tools integrates better<br />* Faster development (though pace diminishes if project grows)<br /><span style="font-weight: bold;"><br />Record Driven Development Cons:</span><br /><br />* Likely to lead maintenance nightmare!!!<br /><br /><br />Basically Domain driven development dissects a complex problem into smaller pieces. But it can be complex at times. Record driven approach is more simple, just get the records from the db and publish. Since we usually aim better design and better maintence in general , domain driven approach is favorable to me. And that's what we are doing in Forkwind.<br /><br />In the next part <span style="color: rgb(255, 0, 0);">* Forkwind Part 5: </span><span style="color: rgb(255, 0, 0);">A first visit to unit testing: <span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span> again we are back to coding. We will write our first unit tests for Forkwind. Till then stay tuned!!<br /><br /><span style="color: rgb(255, 0, 0);"></span><br /><span style="font-weight: bold;"><span style="font-weight: bold;"><br /><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"></span></span></span></span></span><span style="font-weight: bold;"><span style="font-weight: bold;"></span><br /></span>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com3tag:blogger.com,1999:blog-37171590.post-17489716817222425522008-06-19T02:34:00.000-07:002008-06-19T02:38:28.548-07:00Real Human Face with 3D FlashNow isn't this fantastic!!! Just move your mouse and it follows:<br /><br /><iframe src="http://www.motionportrait.com/about/TIminoriHair.swf" frameborder="0" height="500" scrolling="no" width="520">&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;</iframe><br /><br /><br /><br />The original site is :<a href="http://motionportrait.com/">http://motionportrait.com/</a>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com8tag:blogger.com,1999:blog-37171590.post-45012302935393991552008-06-18T10:26:00.000-07:002008-06-19T12:52:53.427-07:00Forkwind Part 3: Creating the domain model :This is the 3rd part of our forkwind implementation. If you are not aware of the master thread and forkwind, please go <a href="http://reverseblade.blogspot.com/2008/06/forkwind-application-design-from.html">here</a> first.<br /><br /><span style="font-weight: bold;">Introduction<br /><br /></span>After discussing about modules and assemblies in part 2, we can again get our hands dirty with the code. Once the project skeleton up , the next thing is to implement the model or the domain model.<br />Technically the domain model has nothing to do with code but this is something you should be able to generate while thinking about the problem or discussing with the customer. For instance, the Forkwind application is a solution for tracking orders from suppliers and customers. So considering these, what concepts are being visualized in our minds ? We have a supplier and we have a customer. We also have orders. Since we have orders, we have also products. This is a very basic abstraction but it is extremely useful. We should also be able to tell the relationship type between these entities. For instance a supplier has many products<br /><br />You should be able to do this just by thinking or with a piece of paper and pen. The rest of the implementation is just filling the gaps and details.<br /><br /><span style="font-weight: bold;">Forkwind Domain Model:<br /><br /></span><div style="text-align: left;">Since we have modelized the basics, we can fill the gaps by simply scetching an informal class diagram. I use a small program called <a href="http://www.gnome.org/projects/dia/">dia</a> but a piece of paper is just good. No need for fancy uml software.<br /><br />Here's my diagram:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg8wx6R0CDD3Vdf2nU_fpIsyfrhyphenhyphenV2bqQIwtE7JS9cDCmuTTdSFQ9FqQgN5ld3WcTOftoXTJv0Iy0AR0hWM_EKUSqTlwPLw21_sLnFrkP0bLanzc1vY80NgirxjS3T05sViPiYiQ/s1600-h/forkwinddomainuml.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg8wx6R0CDD3Vdf2nU_fpIsyfrhyphenhyphenV2bqQIwtE7JS9cDCmuTTdSFQ9FqQgN5ld3WcTOftoXTJv0Iy0AR0hWM_EKUSqTlwPLw21_sLnFrkP0bLanzc1vY80NgirxjS3T05sViPiYiQ/s320/forkwinddomainuml.jpg" alt="" id="BLOGGER_PHOTO_ID_5213276364980895746" border="0" /></a><br /><br />If it it doesn't make sense to you you can follow it from the source where I posted at the end of this post.<br />Here's my solution explorer:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLyHrAFVb1ZsJkM_Y7QAx805DMU3qjcDiW4Eqj8U6-U-qtWUHBFSm-Jgx23Pibe-e8k_6NV-Bu0uGCX1pii-k139Dhw5hzqDDb1GekHoGOssQ0XF8lGv8ESYMnDqi0Z5z1UCm8gg/s1600-h/SolutionDomain.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLyHrAFVb1ZsJkM_Y7QAx805DMU3qjcDiW4Eqj8U6-U-qtWUHBFSm-Jgx23Pibe-e8k_6NV-Bu0uGCX1pii-k139Dhw5hzqDDb1GekHoGOssQ0XF8lGv8ESYMnDqi0Z5z1UCm8gg/s320/SolutionDomain.jpg" alt="" id="BLOGGER_PHOTO_ID_5213278129606781730" border="0" /></a><br />When you look at the code you will see all properties marked as virtual. This is due to we will use NHibernate in the next posts and in order to do lazy loading properties must be virtual. Don't worry we will come to that.<br /><br />Let's go each of these classes briefly:<br /><br /><span style="font-weight: bold;">DomainObject: </span>This is the base class for all our entities. This is the place we can put common code. Currently it has an Id field. This for mostly nhibernate but it is practical to have an Id for each of our domain entites (I would use a guid type for an object database like db4o). It's type is long.<br /><br /><span style="font-weight: bold;">Company:</span> This is the base type for suppliers and customers since we assume they are companies. It has general properties like Name, Adress etc. <span style="font-weight: bold;">A company has one address.</span><br /><br /><span style="font-weight: bold;">Customer : </span>This is derived from company and represents our customers. Also <span style="font-weight: bold;">a customer has many customer orders.</span><br /><br /><span style="font-weight: bold;">Supplier : </span>This is dervied from company and represents our suppliers. Also <span style="font-weight: bold;">a supplier has many supplier orders </span>and <span style="font-weight: bold;">a supplier has many products</span>.<br /><br /><span style="font-weight: bold;">Product: </span>This represents a product type actually not the product itself. This is a common confusion when developing our models. Our product has a property called Quantity. But for an instance of the product the quantity would be always one. But in general we model the product type as model. <span style="font-weight: bold;">A product can belong to many categories </span>and <span style="font-weight: bold;">a product belongs to a supplier.<br /><br />Category:</span> This is for categorizing our products. It is hierachical. <span style="font-weight: bold;">A category has one parent category </span>and <span style="font-weight: bold;">a category has many children categories </span>and <span style="font-weight: bold;">a category has many products.<br /><br /><span style="font-weight: bold;">Order: </span></span>This is the base class for <span style="font-weight: bold;">SupplierOrder </span>and <span style="font-weight: bold;">CustomerOrder</span>. Why I seperated those into two ? This is completly with instict. I just presume they might have different behaviorus and properties depending on your company policy. <span style="font-weight: bold;">An Order has many OrderLineItems.<br /><br />SupplierOrder: </span>Derived from Order. <span style="font-weight: bold;">A SupplierOrder has a supplier<br /><span style="font-weight: bold;"><br />CustomerOrder: </span></span>Derived from Order.<span style="font-weight: bold;"> A CustomerOrder has</span> <span style="font-weight: bold;">a Customer<br /><br />OrderLineItem:</span> This represents an each line in our <span style="font-weight: bold;">Orders</span>. <span style="font-weight: bold;">An OrderLineItem has a Product.<br /><br />OrderStatus:</span> This is basically an enum represents the state of our orders. It can be pending (by default this is set in the <span style="font-weight: bold;">Order's</span> constructor), cancelled or completed<br /><br /><span style="font-weight: bold;">Address:</span> Represents an address used by a company.<br /><br />This is pretty much about our domain model. It looks okay to me and it is ready to be cooked. Sure we might refactor it. One thing you should notice, we haven't done anything about database. Because this is domain driven design, it is the domain that derives our design and we completely ignore the database unlike the traditional approach.<br /><br />The code is <a href="http://emperon.googlepages.com/Forkwind-Part3.rar">here</a>. In the next part <a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-4-domain-driven-design.html"><span>Forkwind Part 4: Domain Driven Design and Record Driven Design</a> <span style="color: rgb(0, 0, 0);"> we will get into some theory and investigate why we have chosen domain driven design over a database driven design. Till then stay tuned!</span></span><br /><a href="http://emperon.googlepages.com/Forkwind-Part3.rar"><span style="font-weight: bold;"></span></a><span style="font-weight: bold;"><br /></span><br /><br /><br /><span style="font-weight: bold;"></span></div><span style="font-weight: bold;"></span>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com0tag:blogger.com,1999:blog-37171590.post-6942991232516505522008-06-17T10:37:00.000-07:002008-06-18T11:22:26.287-07:00Forkwind: Part 2: Modularity, .NET Assembly and NamespacesThis is the 2nd part of our forkwind implementation. If you are not aware of the master thread and forkwind, please go <a href="http://reverseblade.blogspot.com/2008/06/forkwind-application-design-from.html">here</a> first.<br /><br /><span style="font-weight: bold;">Introduction </span><br /><br />In this article, I'll briefly dig modularity and how it maps into .NET assemblies. Modularity is simply dividing our applications into smaller modules. The benefits are obvious: Debugging is easer, and multiple people in the team can work in different modules without affecting each other. Finally, modules are rather isolated so further modifications can be made to one module without breaking the system. This provides us good maintainability for a particular project.<br /><br />In .NET world, our assemblies act as modules (formally, a module is a code file in .NET but we will ignore this fact to prevent confusion). Each project we create in Visual Studio corresponds to an assembly. It can be a dll or it can be an exe. Even for a web application (and not for a website!) all we get is a dll along with some aspx files. .Net assemblies also provide us additional benefits like versioning, security and ease of deployment.<br /><br /><br /><span style="font-weight: bold;">Assemblies in Forkwind</span>:<br /><br />In Forkwind, in <a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-1-creating-skeleton-of.html">Part 1</a> as you remember we have generated several projects/assemblies. This may seem natural to you since we have a layers: a gui layer , a test layer etc. But why did we create separate projects ? It is technically possible that we could have created a web application project and we could build all our code right into that (and even including unit testing). Is it to reduce the pain of an environment with multiple developers ? Certainly not. If you read above my informal definition to modularity, you will understand the reason. We are looking for good design! And good design dictates us building our application in modules. In some case it is perfectly valid to have a single assembly and in some cases using multiple assemblies can be overkill. Only experience can tell when to use what.<br /><br />Specifically talking on .NET my rule of thumb is<span style="font-weight: bold;"> if I expect a layer to be replaceable with another equivalent code, I create an assembly for that</span>. So my repository implementation might change in the future , thus I create an assembly for that particular layer. If not I would lean towards a more monolithic design. Is this my only criteria no ? For a plug-in like system again you have to create assemblies so that you can load them on runtime without stopping your main executable. Finally an assembly like Forkwind.Test should be seperate. Because it doesn't belong to code. It is ony useful for testing. It has no business within the production environment to create excessive code. So for optional components again I create an assembly. Finally when there are issues of versioning, or a different security setting is concerned I create an assembly for that again. The rest really depends on your taste.<br /><br /><span style="font-weight: bold;">What about namespaces ?</span><br />From time to time, I see some novice developers are confused about a namespace and the assembly name. This is due to mainly relying on Visual Studio's intellisense. Namespaces and assemblies has nothing to do with each other actually. They are apples and oranges. A namespace's solely purpose is to prevent Class name clashes. It is NAME-SPACE ! An assembly is more like a module. And just because you can use a namespace like System.Configuration appears with intellisense in Visual studio, it doesn't mean that you are actually making use of the System.Configuration assembly. In deed, all you see is the System.Configuration namespace within System assembly!<br /><br />One exception to this , namespaces have another use in C# 3.0 which allows resolution for extension methods.<br /><br />So that's it for part 2. No new code in this part. But we will get our hand very dirty in next part:<br /><a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-3-creating-domain-model.html"><span >* Forkwind Part 3: Creating the domain model</a> <span style="color: rgb(0, 0, 0);"><br /><br />Stay tuned!!!<br /></span></span>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com3tag:blogger.com,1999:blog-37171590.post-21674525759125928922008-06-17T02:19:00.000-07:002008-06-17T11:19:43.673-07:00Forkwind Part 1: Creating skeleton of the application layers as . net assembliesThis is the first part of our forkwind implementation. If you are not aware of the master thread and forkwind, please <a href="http://reverseblade.blogspot.com/2008/06/forkwind-application-design-from.html">here</a> first<br /><br />As being pragmatic without diving into deep theoretical discussions we first create our project skeleton.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyxde8xQRzk3YYUAtMWXFODzZxfV3Rkrec0MlHEbhs6ewnD3NmAuGKhVIeX3tymtLDvVUFkCWGxMHeyo9WEZWg_8BTGXsdSaR2LWxql8CSiripAqnt2cZ654GDw-uo_LckJnltqw/s1600-h/ForkwindSolutionExlorer3.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyxde8xQRzk3YYUAtMWXFODzZxfV3Rkrec0MlHEbhs6ewnD3NmAuGKhVIeX3tymtLDvVUFkCWGxMHeyo9WEZWg_8BTGXsdSaR2LWxql8CSiripAqnt2cZ654GDw-uo_LckJnltqw/s320/ForkwindSolutionExlorer3.jpg" alt="" id="BLOGGER_PHOTO_ID_5212781617621171826" border="0" /></a>As seen in the picture our forkwind implementation consists of 8 projects which are also assemblies. If you are unfamiliar with assembly concept just hold your breath a while that we will discuss modularity and assemblies in the next part <a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-2-modularity-net-assembly.html"><span style="color: rgb(255, 0, 0);">Forkwind: Part 2: Modularity, .NET Assembly and Namespaces.<br /></a><br /><br /><span style="color: rgb(51, 0, 51);">Let's go through each assembly and discuss why we need them briefly:<br /><br /><span style="font-weight: bold;">Forkwind.Core: <span style="font-weight: bold;"></span></span>Obviously this is our core assembly. We are planning to put most of our business logic , our domain entities service layers here. One key point is Forwind.Core should not depend any other assemblies but be able to self compiled. In this case it only uses Forkw</span></span><span style="color: rgb(255, 0, 0);"></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"></span><br /></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Forkwind.Repository: </span>The name repository may look unfamiliar to you. But this is simply an evolutioned version of your old data access layers or DAO's or what ever you call it. Why I call it Repository ? The simple answer for now is we have domain objects and one of our aims is to encapsulate data access as internals so that our application is unaware of the datasource. More details will come in following parts. Don't worry about it at the moment.<br /><br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Forkwind.Presenter: </span>This is our presenter layer. If you are unfamiliar for presenters their main job is to bridge the core layer and the gui. They prevent business logic leaking to UI layer.<br />It's mostly modeled after Martin Fowler's model view presenter. And again we will discuss it throughly. For the time being it provides a GUI agnostic backend , also enables us to unit test our guis.<br /><br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Forkwind.Test: </span>This is for unit testing obviously. I will use nunit but anyother unit test framework is ok.<br /><br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Forkwind.Util: </span>This is for general utility stuff. We can make use of C# 3.0 extension methods here as well. All other assemblies may make use of this assembly.<br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Forkwind.Web: </span>This is our assembly for the web application (and not web site!!).<br /><br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Forkwind.Console: </span>This is our assembly for a console application which make uses the same backend. It's mainly demonstrative purposes so that it proves our implementation is GUI agnostic. </span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);">But you can further improve it as you like</span></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Forkwind.Windows : </span>This is our assembly for a windows application which make uses the same backend. It's mainly demonstrative purposes so that it proves our implementation is GUI agnostic. But you can further improve it as you like.<br /><br /><span style="font-weight: bold;">SharedLibraries:</span> This is not a project but a pile of third party libraries to be used by other projects.<br /><br />Well that's it. Let's see the dependecy of our assemblies:<br /><br /></span></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-a4Z3p6f0hvVxNCjnZuQLr4kNtWeRDmhUB_eAqElz9qKfiY6eUNUAl0ztUXISGOb9K60j2AzN7dNcJnACBOl22D_UMQnZzWXjq5jU0mf_jjmGgvm9XO1CLhzqyGuw50djPB2q2g/s1600-h/forwinddia.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-a4Z3p6f0hvVxNCjnZuQLr4kNtWeRDmhUB_eAqElz9qKfiY6eUNUAl0ztUXISGOb9K60j2AzN7dNcJnACBOl22D_UMQnZzWXjq5jU0mf_jjmGgvm9XO1CLhzqyGuw50djPB2q2g/s320/forwinddia.png" alt="" id="BLOGGER_PHOTO_ID_5212794742125774802" border="0" /></a><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);">For simplicity I removed console from diagram but same as Windows and web. All assemblies except references Util. And Test references all other assemblies.<br /><br />In old designs typically we have GUI -> Business -> Data Dependency. But this doesn't sound correct to me. If business depends on data then any changes on the data layer may break our business layer as well. This is totaly unacceptable. This is why the dependency is inverted here. And our core assembly is stand alone (except it makes use of util). This way it won't be affected of any changes happening in any other assemblies. We will get into details in the following parts so stay tuned!<br /><br />Code is attached for this section <a href="http://emperon.googlepages.com/Forkwind-Part1.rar">here</a><br /><br /><br />Next part is : </span></span><a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-2-modularity-net-assembly.html">Forkwind: Part 2:Modularity, .NET Assembly and Namespaces </a><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 51);"><br /><br /></span></span>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com0tag:blogger.com,1999:blog-37171590.post-44146901559909067142008-06-17T01:09:00.000-07:002008-06-19T12:54:36.180-07:00Forkwind: Application Design from Beginner to PRO with .NET and Mono<span style="font-weight: bold;">Introduction:</span><br />The purpose of this article is to demonstrate one of the good ways for application design with .NET and Mono. I will be using .NET and C# 3.0 through this but I will be also careful for mono support so your application will be running everywhere. We will develop an application called "Forkwind" which is an imaginary company:). We will do a lot of discussion on the mean while. Feel free to correct me at any point if you disagree with something. Additionally I am not claiming my methodology is the best. It's just something I am happy with it. Lastly this is not my own design. I gathered this information around web. I am inspired Mainly Billy's excellent article<br /><a href="http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx">http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx.</a><br /><br />But i will slightly diverge from his way and try to do a lot of in depth theoretic discussion. I am expecting this to be a very long series so I'll divde it into some sub parts and , I'll try to implement it every day if I can.<br /><br />What we are going to do, is to design and code an application called Forkwind. Forkwind does not have to be a web application. The aim is making it so flexible that a console gui or a windows forms will also fit. Forkwind will be a simple crud application but feel free to extend it.<br /><br />This is the master post for other sub articles so visit this post frequently and I will update and implement articles. Generally I'll first implement the practice then the second post will include the theoretical discussion. Oh yes and I will post real sample code. !!!<br /><br />Here are the topics:<br /><br /><span style="color: rgb(255, 0, 0);"><a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-1-creating-skeleton-of.html">* Forkwind Part 1: Creating skeleton of the application layers as . net assemblies:</a> <span style="color: rgb(0, 0, 0);">(Updated on Jun 17, 2008)<br /><a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-2-modularity-net-assembly.html"><br /></a></span></span><a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-2-modularity-net-assembly.html"><span>* Forkwind: Part 2: Modularity, .NET Assembly and Namespaces:</span></a> <span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">Updated on Jun 17, 2008)<br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"></span></span><br /><a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-3-creating-domain-model.html"><span>* Forkwind Part 3: Creating the domain model :</span></a> <span style="color: rgb(0, 0, 0);">(Updated on Jun 18, 2008)<br /><br /></span><a href="http://reverseblade.blogspot.com/2008/06/forkwind-part-4-domain-driven-design.html"><span >* Forkwind Part 4: Domain Driven Design and Record Driven Design :</a> <span style="color: rgb(0, 0, 0);">(Updated on Jun 19, 2008</span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind Part 5: </span><span style="color: rgb(255, 0, 0);">A first visit to unit testing: <span style="color: rgb(0, 0, 0);">(Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind Part 6: </span><span style="color: rgb(255, 0, 0);">Why unit testing is so important : <span style="color: rgb(0, 0, 0);">(</span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind Part 7: </span><span style="color: rgb(255, 0, 0);">A first visit to persistence and database stuff in Forkwind: </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)<br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"></span></span><span style="color: rgb(255, 0, 0);"><br /></span><span style="color: rgb(255, 0, 0);">* Forkwind Part 8: </span><span style="color: rgb(255, 0, 0);">Repository pattern , DAOs and DAL: </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind Part 9: </span><span style="color: rgb(255, 0, 0);">What are my persistence options in .net and which one I should use: </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(</span></span><span style="font-weight: bold;"> </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind Part 10: </span><span style="color: rgb(255, 0, 0);">Log4Net putting logging into work: <span style="color: rgb(0, 0, 0);">(</span></span><span style="font-weight: bold;"> </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">Not Available at the moment).</span></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 11: </span><span style="color: rgb(255, 0, 0);">Dependency Injection in Forkwind With Castle Windsor: <span style="color: rgb(0, 0, 0);">(Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 12: </span><span style="color: rgb(255, 0, 0);">Benefits of Dependency Injection, connecting decoupled pieces: </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(</span></span><span style="font-weight: bold;"> </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 13: </span><span style="color: rgb(255, 0, 0);">Fowler's Dependency Inversion and Assembly dependence </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(</span></span><span style="font-weight: bold;"> </span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 14: </span><span style="color: rgb(255, 0, 0);">Alternatives to CastleWindsor: Spring .NET, Sturcture Map and unity : <span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 15: </span><span style="color: rgb(255, 0, 0);">The need for Service Classes: <span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 16: </span><span style="color: rgb(255, 0, 0);">Unit testing revisited ,mocking comes into the scene: <span style="color: rgb(0, 0, 0);">(Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 17:The GUI</span><span style="color: rgb(255, 0, 0);">: <span style="color: rgb(0, 0, 0);">(Not Available at the moment)<br /></span></span><br /><span style="color: rgb(255, 0, 0);">* Forkwind 18: Model View Presenter:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span> <span style="color: rgb(255, 0, 0);">* Forkwind 19: Model View Presenter Continued:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 20:</span><span style="color: rgb(255, 0, 0);"> Unit Testing the GUI:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><span style="color: rgb(255, 0, 0);">:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)<br /></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 21:</span><span style="color: rgb(255, 0, 0);"> Databinding to ASP.NET:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"></span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"></span></span><br /><span style="color: rgb(255, 0, 0);">* Forkwind 22:</span><span style="color: rgb(255, 0, 0);"> A Console and Windows GUI:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 23:</span><span style="color: rgb(255, 0, 0);"> NHibenate in Depth:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><br /><span style="color: rgb(255, 0, 0);">* Forkwind 24:</span><span style="color: rgb(255, 0, 0);"> Active Recording With Castle ActiveRecord:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><br /><br /><span style="color: rgb(255, 0, 0);">* Forkwind 25:</span><span style="color: rgb(255, 0, 0);"> Active Recording With DB4O:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)<br /><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 26:</span><span style="color: rgb(255, 0, 0);"> AOP and limitations of C# :</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 27:</span><span style="color: rgb(255, 0, 0);"> Compacting the application:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span><br /><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><br /></span></span><span style="color: rgb(255, 0, 0);">* Forkwind 26:</span><span style="color: rgb(255, 0, 0);"> Final Words:</span><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">(Not Available at the moment)</span></span>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com0tag:blogger.com,1999:blog-37171590.post-26391865202915894772008-06-16T11:05:00.000-07:002008-06-17T00:59:29.817-07:00Some history for ubuntu and worst releasesCanonical releases a new ubuntu every 6 months and time to time it does a LTS (long term support) release which is suppose to be most stable. So far Canonical made 2 LTS releases: Ubuntu 6.06 dapper and 8.04 hardy. Ironically,in my personal experience , they are the worst releases of ubuntu. In detail I am having lots of program crashes in gnome and I am not even telling what happened when I first turned off my computer after upgrading to hardy. In general ubuntu releases have hiccups at very beggining and after 1 week from the release they run quite good. But this didn't happen with hardy. Today, I made a simple google search that verified my thoughts.<br /><br />I googled <span style="font-weight: bold;">ubuntu xxx "worst release"</span> where I put, dapper, edgy, fiesty, gutsy and hardy . I know this isn't a relaible test. But results were almost all telling dapper and hardy worst releases. I saw 1 search result for fiesty.<br /><br />Dapper actually was the first release that ubuntu maturized. Before dapper ubuntu had 3 releases called: warty , hoary and breezy ( I am not selecting the names!). They were nice but too amateurish (frankly I never used warty but I started with hoary but I guess same applies to warty). Dapper were 2 months late to it's normal schedule. And it was so terrible that canonical released an 6.0.6.1 version. And july 3, 8.04 will give a 8.0.4.1 release. And both of these are LTS and both are terrible.<br /><br /> Earlier I was using Suse 9.3 till it wiped out my disk. When I switch to ubuntu I really like it. They become a major push for innovation in my honest opinion. And I am delighted with its great community. I use Ubuntu since 2005 as my primary desktop machine. I've upgraded my current laptop as 6.10 -> 7.04 -> 7.10 -> 8.04 without formatting almost 1.5 years (which is some achivement compared to windows considering you have to format it every 6 months and pay another licence fee every 3 years for a new version!). However it seems this time I am going to give opensuse 11 (on gnome!!!) another shot.Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com0tag:blogger.com,1999:blog-37171590.post-72959809268747101342008-06-14T08:55:00.000-07:002008-06-15T12:23:04.560-07:00C# Glorified : Nemerle!<div class="smallfont"> <strong><br /></strong> </div> <hr style="color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);" size="1"> <!-- / icon and title --> <!-- message -->Nemerle is a CLR based programming language. Just like C#. It works on .NET and mono. It can reuse libraries written with C# and vice versa. Basically it is C# glorified in my honest opinion. I've encountered <a href="http://nemerle.org/Main_Page" target="_blank">nemerle</a> a long time ago and it was quite matured since then. As a developer I was looking for more power and nemerle gave me what I want. It is definitely not a newbie language but is very very powerful. It is basically unification of C# and OCALM with enhanced macro support. Here are some features:<br /><div class="vbclean_msgtext" id="post_message_4988524"><br />* <b>Cross platform: </b> Nermele is an open source CLR based language, it runs on mono / linux and .net platforms.<br /><br />* <b> C#/Java like syntax (statically typed):</b> The syntax is similar to C#.<br /><br /><br />* <b> Functional </b>: Nemerle is functional.<br /><br /><br />* <b> Macros :</b> This is what makes nemerle very powerful. Basically it allows you to invent your own keywords. The language normally does not have constructs as if. But instead they are created as macros.<br /><br />Here is how or a reverse loop implemented basically:<br /><br /><div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:</div> <pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 98px; text-align: left;">macro ReverseFor (i, begin, body)<br /><span style="color: rgb(51, 51, 255);">syntax</span> ("ford", "(", i, ";", begin, ")", body)<br />{<br /><[ <span style="color: rgb(51, 51, 255);">for</span> ($i = $begin; $i >= 0; $i--) $body ]><br />}</pre> </div>then you can use this :<br /><br /><div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:</div> <pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left;">ford (i ; n) print (i);</pre> </div>You see! "ford" is on our own keyword.<br /><br /><br />* <b> Type inference with Generics </b>: Unlike C#/Java, this syntax works:<br /><div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:</div> <pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 98px; text-align: left;"><span style="color: rgb(51, 51, 255);">def </span>d = <span style="color: rgb(51, 51, 255);">Dictionary </span>();<br />d.Add ("Ala", 7);<br /><span style="color: rgb(51, 51, 255);">foreach </span>(s <span style="color: rgb(51, 51, 255);">in </span>args) {<br />...<br />}</pre> </div><br />* <b> Builtin Design By Contract </b>:<br /><div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:</div> <pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 66px; text-align: left;"><span style="color: rgb(51, 51, 255);">public </span>Substring (startIdx : <span style="color: rgb(51, 51, 255);">int</span>) <span style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 0, 51);">:</span> string</span> <span style="color: rgb(51, 51, 255);"><br />requires </span>startIdx >= 0<br />{ ... }</pre> </div>Here we say startIdx must be =>0 . Contracts are builtin!<br /><br /><div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:</div> <pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 50px; text-align: left;"><span style="color: rgb(51, 51, 255);">public </span>Length () : <span style="color: rgb(51, 51, 255);">int ensures </span>value >= 0</pre> </div>This ensures the property returns >= 0 values otherwise an exception is thrown (we can also customize that exception).<br /><br /><br /><div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:</div> <pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 82px; text-align: left;"><span style="color: rgb(51, 51, 255);">Class </span>Vector [T] <span style="color: rgb(51, 51, 255);">invariant </span>position >= 0<br />{<br /><span style="color: rgb(51, 51, 255);">private mutable </span>position : <span style="color: rgb(51, 51, 255);">int </span>= 0;<br />....</pre> </div>Here, we say for the life time of this class , position can't be less than zero !<br /><br /><span style="font-weight: bold;">Speed : </span>Ironically nemerle compiler is written with nemerle itself which is CLR language. Because of Runtime JIT'ing the speed is somewhat close to (average about 80% levels) to native C code.<br /><br />* <b> Interop </b> : nemerle can interop with any CLR language. You can use windows.net libraries or mono libraries, you can intermix your code (in seperate assemblies of course ) with C# or you can reuse your nemerle libraries from C#<br /><br />For more details go to here: <a href="http://nemerle.org/Features" target="_blank">http://nemerle.org/Features</a></div>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com2tag:blogger.com,1999:blog-37171590.post-10715710653677360442008-06-13T11:20:00.000-07:002008-06-17T00:58:29.077-07:00Web development: ASP.NET Webforms versus Rails, Flex, PHP and Java stuff.<span style="font-weight: bold;"><br />Some History:</span><br />I am a long time web developer and making a living from it. For my entire programmer life, I looked for perfection for developing applications. I remember back in 2002, I was struggling about if thick clients or web clients were better for typical form processing. At that time richness of thick clients were more attractive than these days since we did not have all ajax goodies, flex, silverlight etc.<br /><br />Time passed and I decided to go for web apps. and I have no regrets so far. Not that I am claiming it is a better way but I am just happy for my personal development.<br /><br />Then came the next question: I need to go with some platform/framework etc. I've worked with a lot of technologies: ASP, ASP.NET, PHP, Java frameworks (Wicket, struts, Echo, plain JSP) , Flex, silverilght, Perl CGI. I felt uncomfortable with the number of choices since it is impossible to specialize all of them and it was extremely hard to predict which of these technologies have a future (and even now). Selecting a technology is difficult, you need a very good eye for that. Common sense says: "use right tool for right job". And yes frameworks are tools. But unlike that analogy, these days frameworks are so powerful that most of them claims to be suitable for "every job". For instance, you can write executables with PHP, you can write desktop applications with Flex via AIR and with .NET and Java you can do almost everything you can imagine and even you can write operating systems with them ( <a href="http://www.sharpos.org/">SharpOS</a>, <a href="http://www.gocosmos.org/index.en.aspx">Cosmos</a>, <a href="http://research.microsoft.com/os/Singularity/">Singularity</a>, <a href="http://jnode.org/">Jnode</a> ).<br /><br />I started web programming with Perl /CGI then I quickly moved to PHP and then Java and then as a requirement of my job I first met with ASP.NET 1.1. And I hated it. Then came ASP.NET 2.0. I was extremely impressed with ASP.NET 2.0 at that time. It really seemed to me that<br />MS really did a good job with it. But after sometime passed, I missed neatness and good design in Java frameworks. ASP.NET 2.0 was very practical but it completely ignores good design practices which leads to unmaintainable crappy code. Specifically talking about webforms since it was the only thing running on ASP.NET.<br /><br />Finally, I've met Ruby on Rails. I've done some projects with rails and I really really liked it! Everything smells correct with rails. And it is much easier than java or .net. I also like linux so I thought I was finally off the MS lock in. However, later while dealing with ruby, I start to feel uncomfortable on things like dealing HTML manually , unicode problems, and green threads. It was painful to use a multi select html selectbox with rails where you use nested arrays for that and it looks ugly.<br /><br />Finally I returned back to ASP.NET forms but with a different eye! I quit following MS practices ,instead I applied things that I learn java and rails. I feel much happy now and Webforms is my favorite platform. This article will be comparison of webforms with "others" based on my personal experience. I might be wrong so feel free to correct me.<br />But first lets dispell some myths:<br /><br /><span style="font-weight: bold;">Myths for ASP.NET Web Forms:</span><br /><br /><span style="font-weight: bold;">ASP.NET runs only in Windows</span>: This is a major problem to many people. I am a linux fan and I use linux and develop on linux everyday. And we have great <a href="http://www.blogger.com/www.mono-project.com/">Mono</a> project runs asp.net successfully on every platform. It is quite up to date too. Everything works there including Ajax, Ajax control toolkit, asp.net futures, asp.net mvc (although illegal to do so) . The only missing parts is Web parts and the new listview control (listview implementation is underway!).<br /><br /><span style="font-weight: bold;">ASP.NET Web Forms are easy:</span> Unlikely the demos made by MS, dragging and dropping stuff, ASP.NET is extremely complex, but also powerful.<br /><br /><span style="font-weight: bold;">You can only use C# and VB with ASP.NET:</span> You can use C#, VB.NET, IronPython, IronRuby, Boo, Nemerle with ASP.NET. There are possibly others but these are the ones I know working.<br /><br /><span style="font-weight: bold;">Pros for ASP.NET Webforms:<br /></span><ul><li>It uses .NET platform so entire .NET library is at your command.</li><li>Extremely well documented and main stream</li><li>Cross platform. With mono it works everywhere</li><li>Mono ASP.NET is open source</li><li>Component and Event Driven, so you are not usually messing with Javascript and HTML</li><li>Ajax is extremely easy. Use an updatepanel and you are good to go</li></ul><span style="font-weight: bold;">Cons for ASP.NET Webforms:<br /></span><ul><li>Can be extremely complex. Loading dynamic controls on runtime , view state issues , custom controls , ASP.NET Page Life Cycle are too complex. I mean it!!!<br /></li><li>Viewstate! It helps a lot to emulate a stateful web. But it can be a true performance killer if you are not careful</li><li>Generated HTML : ASP.NET generates complex html that doesn't play with other things easily. You can catch yourself dealing with ctl100_xxx_yyy type of Id's. CSS and Javascript can be painful too. But ASP.NET webforms philosophy is different. you have to get it really!!!</li><li>Hard to unit test. I was really puzzled for this. Unit testing is important. I invented my own Model View presenter pattern to get around this issue.</li></ul>Even though that cons I still like ASP.NET Webforms best. It is extremely powerful if you know how to use it correctly.<br /><br />And now the comparisons:<br /><br /><span style="font-weight: bold;">ASP.NET WebForms versus Rails</span>:<br />I really think asp.net is superior to rails. Firstly, when you develop an n-tiered web application, it doesn't have to be a web application at all in future. That's why we have n-tieres. We could replace the UI layer with any other thing. You can convert it to a thick client application a socket server or what ever you like. Rails is a web framework period! You develop a web application and you have to live with it. Most of the time this is not a big deal since your purpose is developing a web application anyway. But I like the flexiblity of n-tiers.<br /><br />Secondly, Rails, actually ruby has no real threads and it is 200x slower than C code. In fact,this has never annoyed me in practice but I feel more relaxed that I could use real threads with .NET. Additionally, unicode is breeze with .NET where rails fail miserably.<br /><br />Rails use a template approach that if you intended to generate html pages, which gives you a nice clean seperation of your ui from controllers. But you have to type a lot of html and yes I am aware of <a href="http://en.wikipedia.org/wiki/Haml">HAML</a>. ASP.NET allows you to build components and those components can talk each other with events only. This leads to a very good isolated design. Also things like output caching allows you partially cache some parts of your pages. I see no equivalent of this in rails.<br /><br />Furthermore, Rails' Ajax is not as easy as asp.net. You deal with RJS templates although you can use things like JQuery or Ext or YUI , that way you make a language switch.<br /><br />Ruby is a better language than C# imho. C#, although 3.0 version is fantastic is a bit verbose compared to Ruby. But I still like C# very much. But if you want power there are much better languages than ruby in .NET/Mono world like <a href="http://boo.codehaus.org/">Boo</a> and <a href="http://nemerle.org/">Nemerle</a>. They are extremely powerful and you can develop asp.net apps. with them.<br /><br />And for backend, Rails has ActiveRecord but so does ASP.NET: <a href="http://www.castleproject.org/activerecord/index.html">Castle ActiveRecord.</a><br />And even with .NET you have something better than Activerecord . Enter <a href="http://www.db4o.com/">DB4O</a>!<br />No more mapping , with db4o you can truely ignore you persistance layer and store your objects as they are which is difficult to implement with rails.<br /><br />Another point is internationalization, and multi langauge applications are very easy with asp.net via Resources. Rails has globalize plugin for that and works well but it creates some messy tables in the db.<br /><a href="http://www.castleproject.org/activerecord/index.html"><br /></a><br /><span style="font-weight: bold;">ASP.NET WebForms versus PHP</span>:<br />I am sorry for PHP fans but syntax is really ugly. PHP doesn't feel like an OO language. PHP 4 was an hybrid lang and PHP 5 implemented full blown OO stuff. But still I don't feel OO paradigm with PHP. It also suffers the same problem with Rails. Too much dealing with HTML. PHP has rails like or even ASP.NET like libraries. But still too low level for my taste. One good thing about PHP is it's extremely wide-range of library support. Other than that I see no reason to you php except for dealing legacy applications.<br /><br /><br /><br /><span style="font-weight: bold;">ASP.NET WebForms versus Java stuff</span>: JEE versus ASP.NET is a long time debate actually. Java has a lot of decent web frameworks. They are mostly component oriented like asp.net. I can't bash them but ASP.NET Webforms looked much better than JSF, struts. and yes .NET has NHibernate and Spring .NET. Also C# is a better language than Java (just side by side language comparison not runtimes!).<br /><br /><br /><span style="font-weight: bold;">ASP.NET WebForms versus Flex: </span>Flex is extremely powerful. And it archives things that ASP.NET can only dream of. Very componentized, very elegant! The only thing I dislike about Flex and disconnected frameworks like <a href="http://extjs.com/">ExtJs</a> or Qooxdoo is that you have to serialize your Domain entities. And if you have bi-directional associations those objects cannot be serialized into JSON or XML. WCF provides a workaround for that but I doubt it will be useful with anything besides .NET. Then you have to build with DTO's. Same problem happens to be with Rails + Flex or Rails + Extjs. Rails creates DTO's on the fly with toXml or toJson thingies.<br /><br /><span style="font-weight: bold;">ASP.NET WebForms versus ASP.NET MVC or MonoRail:<br /></span>First it is illegal to run ASP.NET MVC on linux so you are locked into Windows. Second ASP.NET MVC and Monorail although can use ASP.NET components they cannot use Postback controls. Then you drop to HTML once more for many things. Ayende "The Great" (that's what I call him), rightfully complains the complexities of WebForms and he prefers MonoRail . I can totally understand him. His points against web forms are valid. But I think this is a matter of a personal preference when you compare pros and cons.<br /><br />Well this is the end. Feel free to criticize and correct me. Happy web programming !<br /><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;"></span>Onur Gümüşhttp://www.blogger.com/profile/07923423373852682999noreply@blogger.com18