Saturday, 24 July 2010

An intro to what OpenWrap is

I vowed not to come out too early with loud propaganda on what OpenWrap is, but many have told me that they want to see it happen now rather than together with a beta, and I’ve been coding away for long enough that the code may be of interest to some. So, without further do, I announce my latest venture in world OSS domination called OpenWrap.

What’s OpenWrap

OpenWrap is currently classified as a package management system. In reality, it’s an export management system. The reason for OpenWrap existing is to deliver stuff to whatever environment is needing it, be it at development time within Visual Studio, at deployment time when pushing an OpenRasta or MVC web-site, or at run-time for a rich client.

What’s Stuff?

An application is usually made of a bunch of stuff. Some are components, some are static files, some are executable tools, and some may be an energy pattern that needs to go from point A to point B.

OpenWrap is a simple packaging format that deals with separating those stuff things into exports. An export is whatever you want, and only the consumer of an export need to know and understand a certain kind of export.

An example of exports: assembly references and build files

One of the many exports that everyone is focusing on at the moment is binary assembly distribution. You want to easily add a component built by someone else, without the hassle of having to download binaries and all their dependency hell yourself. I hear you! While projects like horn have attempted to take away some of the pain by automating cross-trunk version building, the lack of binary distribution and versioning has made using the tool a hit-or-miss, because of the nature of how open-source software is built more than because of what horn is.

So, in OpenWrap, you can use the OpenWrap shell, called o.exe, to issue a bunch of commands. So if you want a reference to nhibernate, you’d do

o add-wrap nhibernate

OpenWrap will try and find the package called nhiberante, and all the packages it depends on, and install them in your system repository. At build time, each package you depend on will automatically get its references added to your project. There’s even a ReSharper plug-in to make it real-time.

In your package, which happens to be a simple zip file, each dll present in the /bin-netXXX folder will be automatically resolved. Why the XXX? Because in OpenWrap, the binary exports are dependent on the version of .net you’re running under. That means that if you run under .net 2.0, you’ll get all the DLLs present in /bin-net20, but if you’re under .net 3.5, you’ll get the ones in /bin-net35.

Want to provide architecture-dependent code? Just put the same dll and the same API in both /bin-x86-net20 and /bin-x64-net20, and OpenWrap will figure out which of the versions to use.

Another example of exports: commands

In OpenWrap, commands are also a type of export, that live in /commands. Want to provide command-line commands to execute as part of your project? As long as your package is present in a solution, all of the commands you create will be available from the command-line. XCopy command-line extensibility is the feature used by openwrap itself to execute its own commands, so you have the guarantee that only the version of OpenWrap (and other packages) you have in your project repository will be the ones executed when you are running the shell.

The sky is the limit

Of course, package exports are extensible, so if you want for your project a custom export, or if you feel (like me) that web applications should share a same export for things like jQuery, then you can integrate yourself with that and make it your own.

Repositories

There’s a few repositories in OpenWrap. The System repository is the one living in your /Users/UserName/AppData/Local/OpenWrap/wraps folder. Anytime you execute an OpenWrap command anywhere that’s not an OpenWrap folder, it will come from your system repository.

As you may have guessed by now, each of your projects will also have its own repository. You can consider that an equivalent to your vendors folder in Rails. In each of your projects, all exports (commands, assemblies etc) come from your project repository first.

And of course, multiple repositories can exist. The repository at http://wraps.openwrap.org is maintained by myself, and you should be able to upload your own packages there very soon. If you want to add your own repository, the openwrap-server will provide you with a full-fledged repository you can install locally. You then only need to issue a o add-remote myRepository http://myRepository.com command to add your own.

Versioning

Whenever you execute the o add-wrap xxx command in a project, a line will be added to your descriptor file. This file is the description of what your application does, what other packages it depends on and what versions it needs to execute. The end-result in your file would add a line. Here’s a typical package descriptor, to give you a sense of what things look like. (note the syntax is slightly different than what is on the wiki, those changes are coming up on github in the next few days as we ramp up for release).

openbong.wrapdesc

Depends: nhibernate >= 2.0.0 and < 3.0 Depends: openfilesystem = 1.0.0 Description: A wiki system based on the textile language and using GIT as a repository.

Versions are very simple, you decide what your package is compatible for. When it comes to dependencies, only [Major[.Minor[.Build]]] are taken into account. If you add the fourth number, the revision, openwrap will always update the package to the latest revision.

Of course, you can update all packages in one go automatically by doing o update-wrap. This will update the project repository to the latest compatible version of packages, as described in your wrap descriptor file.

Building

One of the things I don’t want to address just yet is building packages. There’s an MSBuild task that makes building the zip files easier, but I don’t want to go down the route Horn got and turn a dependency manager into dependency hell. So for now, people are expected to build their own zip files. It’s only temporary however, as I do expect in the next few versions for OpenWrap to not be built from a build script anymore, which may end up being the default convention. Who knows? For now, OpenWrap integrates itself in your existing projects by replacing the target import by openwrap’s one.

Installing…

I’ve not put up binary releases just yet, but when they are made available (or if you build it yourself), the shell is able to automatically install itself and retrieve the latest version of packages that it needs to run. That means that the installer is 35kb. You shouldn’t have much difficulty downloading o.exe and running with it very quickly.

Going forward

There’s a lot more to OpenWrap so far, from anchoring to the build system, but this is enough of an intro to give you a taste of what I’ve been up to for a few months.

Bar one piece of functionality on the client, which I’m in the middle of changing around (anchoring, a blog post at some point will explain what that is), we’re nearly ready for a first beta release.

Want to contribute? The site is at http://github.com/openrasta/openwrap. While it’s under the OpenRasta brand, the project is stand-alone, and I will be managing OpenWrap as an independent tool. I will however base any further OpenRasta developments on it.

I know there has been recently a lot of noise from many parties in the package management space. The only thing I can tell you is that I’m fully committed to bringing OpenWrap in the hands of developers as quickly as possible. It’s a different approach to a complicated problem, and I think it’s hitting a damn nice spot even if I may say so myself. I’ll post in a few days the first binaries (when the server is up) so you can start playing with it, open accounts and start publishing your own wraps. After that, there’s a lot of work to do to enable testing, documentation and many other scenarios.

One last word

If I was to request one last thing from you, reader, it would be the following. Package management is going to be the next Vietnam war on .net, and many people will come up with different solutions. It’s all for the best, and most projects, as they have done many times before, will die off on their own. This is to be expected. As such, I implore the .net world to let enough time for each of those projects to compete purely on the quality and functionality they provide, and let the best one eliminate naturally the other ones. Don’t succumb to the belief that standardizing early will help, or that popularity would be a distinctive factor. If we fuck-up the package management story on .net, we may never recover, so give it a bit of time and be circumspect in your analysis.

And don’t forget, my project got a cooler name anyway.

:)

Wednesday, 19 May 2010

Why I haven’t blogged about OpenWrap yet.

Because it’s not ready and I haven’t announced it yet.

I showed the state of the code-base at the progressive.net workshop, to gather feedback from smart people. There was good feedback, and the latest architectural change happened the night before, so I’m still coding.

I’m doing it in the open, you can have a look at the code but I won’t link to it.

But please, please, to some of you, get off my back! If you think your package manager is better, good, I’m glad you found a tool you like.  If you think the project is a bad idea because yours is better, please commit some code and show us the money.

Until I’ve officially announced the project, I’d be quite happy not dealing with all the negativity that has come my way since Rob’s post.

Kthxbye.

Tuesday, 18 May 2010

Chuck Norris doesn’t follow people, he is the follow process

image

Saturday, 3 April 2010

OpenRasta needs an msdn license

I don’t usually use this blog for requesting help, but I’m afraid on this one I have to.

I don’t have access to an MSDN license anymore, as the cost is too high, I’m not an MVP and the ActionPack works for my professional needs. Except it doesn’t work so well with OpenRasta.

With the upcoming Visual Studio release, and the new OSs out there, I’m out of licenses to continue testing OpenRasta on all those platforms.

So, my friends, the communnity, I’m turning to you. Do you have a spare MSDN license somewhere? Do you know someone at a vendor happy to provide such a license? Maybe even Microsoft? Now is the time to help OpenRasta!

Email openrasta-inneed@serialseb.com with your suggestions! Thanks!

Tuesday, 30 March 2010

OpenSource on .net at Microsoft TechDays

Register now at http://techdays-oss.eventbrite.com/

The .net ecosystem is rich in open-source solutions that many have already adopted as part of their business-sensitive toolkit. Come and listen about open-source web frameworks, object-relational mapping tools and other must-have frameworks the .net community has produced over the years, by the most prominent figures of the UK developer community.

Come and enjoy free food and drinks and listen to experts present you the best of breed of open-source software for Microsoft platforms.

Current program:

  • OpenRasta - A web application framework for .net

  • An introduction to IoC with Castle Windsor

  • FluentValidation, doing your validation in code

  • CouchDB, NoSQL: designing document databases

  • Testing your asp.net applications with IronRuby

  • Building a data-driven app in 15 minutes with FluentNHibernate

Thursday, 4 February 2010

Announcing the “20 days to OpenRasta” project

As some of you already know, I’m very excited that OpenRasta is being presented at Mix10 in Vegas by none other than the talented Kyle Baley. As I’ve not realised the 2.0 RTM bits yet, I thought it’d be great if we could release a fresh 2.0 RTM build for the occasion.

This is a call to action to the users, adorers and believers: OpenRasta needs you!

In the next 20 days, starting from this Friday, let’s try and all commit some of our time to OpenRasta in one way or another. There’s a lot to be done and focused on, from the new web site, to updates to the code base, to enhancing the documentation.

To participate, just join the mailing list, find something interesting you’d like to be doing, and commit to work on it on a certain day.

On top of that, from this weekend, I’ll be organizing a code-a-thon on either day, with anyone that cares to join me for a day of pure pair programming coding on some of the OpenRasta code-base. Want to see extensible authentication done? Donate your day, we’ll have coffee and lunch and lots of code! Not in London? We’ll use Skype. No excuse!

As for me, I hereby promise to start posting a videocast a day for 20 days. Provided we have somewhere to host the videos and someone can help out with the encoding!

I’ll update this post with all the commitments that were made to help get a new release out of the door in time for Mix.

Thursday, 19 November 2009

OpenRasta 2.0 release party!

The time is upon us, for a release and for a party to celebrate it.

Come and join all the UK OpenRasta users, it’s on the 12th of December and in Central London.

Go register on the eventbrite site now, quick!

Friday, 30 October 2009

Derivative work for speakers, or a guide on how to use my content

I realize I’ve never clarified what you can or cannot do with my slides and my talks. So here’s a clarification for anyone that wishes to inspire themselves from my work (aka derivative works) or reuse them.

I do not release my presentations, the videos or the content / slides under any kind of open-source license. Not even creative commons. Presentations take a while to build, structure and mature, and this cost me money. If you’re going to use them, you’re effectively using my work.

Now, I’m not anal about how you use the content, it’s written to benefit the community. However, ff you want to create a derivative work, or even re-present my presentations, I’m happy for you to do so provided the following conditions are met:

  • The original work author is to be named (that’s me), together with my company name (that’s Caffeine IT).
  • It would be terribly appreciated to link to the original content, or my blog, or both.
  • You notify me that you’re going to use the content, or created a derivative work.

If you have any issue with any of that, don’t hesitate to send me an email we can chat about it.

Thursday, 22 October 2009

Announcing the first Cambridge AltNetBeers – StackOverflow edition

We are expanding, how brilliant is that! If you want to have an open-space after the Cambridge StackOverflow dev-day, you now can!

Monday, 12 October 2009

#AltNetWorkshop on CQS with Greg Young

I’m very pleased to announced that this weekend, for a day only, Greg Young will be delivering a workshop for the AltNetGroup, for free, in London, on Command-Query Separation.

3 tickets will be available daily at 2PM on the AltNetGroup site.

Thursday, 8 October 2009

AltNetBeers StackOverflow DevDays edition

The registration for the post-StackOverflow conference in London is now open at http://altnetbeers-stackoverflow.eventbrite.com/

I’m sure it’s going to be an absolutely brilliant event, so register early as space will be limited.

Monday, 5 October 2009

London GayGeekDinner – Friday 9th of October

Just a quick reminder for those not monitoring the www.gaygeekdinner.com site, our next event is this Friday, and you can register at http://london-gaygeekdinner.eventbrite.com/

It’d be great if you could do it by Wednesday so I can have an idea of numbers. :)

Monday, 21 September 2009

Announcing a new kind of events: AltNetCrossTalks, this Friday at MRM!

And there you go. When you can’t scale up, scale out! We’re creating a new kind of talks, one where communities will meet and cross the technological Styx.

The first one is on Ruby, RubyOnRails and IronRuby, the presenter is Shay Friedman, the place is MRM, the time is this friday, and the this is the link.

Wednesday, 16 September 2009

Last day to enter the raffle for a ticket to Roy Osherove’s TDD workshop

As you know, Roy is delivering the first of our AltNetWorkshops on Saturday the 26th of September. Most of the tickets are now gone, but you have the chance to enter a raffle for the last remaining ticket by sending me an email at seb@serialseb.com

Sunday, 13 September 2009

The first AltNetWorkshop with Roy Osherove on Intro to TDD

I'm very glad to announce that we launched the AltNetGroup website last week, and opened the first couple of tickets to the first AltNetWorkshop, something that I've been very keen on organizing. Roy has been generous enough, together with bbits and Onalytica, to give the first of our workshops for free. The bad news is that the event date has changed, and is now handled on the 26th of September. The good news is that there will be another 5 tickets, of which two will be released on monday, and two additional ones on tuesday. This leaves us with one last final ticket that will be picked randomly to all those sending me an email to seb@serialseb.com.

Tuesday, 8 September 2009

Alternative Network Group News – AltNetBeers #12

As the ever excellent Udi Dahan is in town, it’s only natural that I organize an AltNetBeers. So get ready for another session on the 16th of September! You can register now on the ukdotnet site.

Thursday, 3 September 2009

Seb does Ireland – 30th of September to 3rd of October

And because I’m equally excited about going back to Ireland as I am going back to Scotland, I’ll be doing a bunch of things there.

Wednesday 30th September

Dublin alt.net at 8pm in Seagrass http://www.seagrassdublin.com

An intro to OpenRasta 

Thursday 1st October

Dublin

Not confirmed yet but should be a talk on agility in Dublin

Friday 2nd of October

Galway

Speaking at a conference on agility, will post about it when I get more details.

Seb does Scotland – 23rd to 25th of September

Well, it’s been a while since I’ve been a up north, and with such a great community up there, it was only a matter of time before I got back. Frankly, I was just looking for an excuse, and the guys have given me a beautiful one!

So here’s the schedule.

Wednesday 23rd September

Dundee – http://www.eventbrite.com/event/390722662/seb

When agile goes bad, how to stay calm and move forward

With applying agile methodologies comes changes in many aspects of delivering software. And with any change will come a time when something fails. How to keep everyone calm? How to provide practical solutions to prevent people from reverting back to non-agile practices at the first roadblock? Through examples gathered from personal experience and the community, we’ll explore ways to prevent the boat from sinking at the first spilled glass of water.

Thursday 24th September

Edinburgh - http://www.eventbrite.com/event/390708620/seb

An intro to OpenRasta

Everybody seems to rediscover the MVC model, and new frameworks seem to appear all the time. Most of those hide the richness of the web. Come discover OpenRasta, a very opinionated framework that help you write MVC-style web applications and data services, using a unified API.

Friday 25th September

AltNetBeers Scotland edition

The scot alt.net guys have asked me to facilitate a session of AltNetBeers, which I’m really excited about. Will update with the details when I know where it’ll be organized.

See you there!

Friday, 28 August 2009

NHibernate repository that Oren won’t like

public interface IRepository<T> : INHibernateQueryable<T>
{
ITransaction BeginTransaction();
void Delete(T item);
T Get(object id);
void Save(T target);
void Update(T item);
}
public class NHibernateRepository<T> : IRepository<T>, IDisposable
{
readonly ISessionManager _sessionManager;

INHibernateQueryable<T> _queryable;
ISession _session;

public NHibernateRepository(ISessionManager sessionManager)
{
_sessionManager = sessionManager;
}

INHibernateQueryable<T> AsQueryable
{
get
{
if (_queryable == null)
_queryable = Session.Linq<T>();
return _queryable;
}
}

public Type ElementType
{
get { return AsQueryable.ElementType; }
}

public Expression Expression
{
get { return AsQueryable.Expression; }
}

public IQueryProvider Provider
{
get { return AsQueryable.Provider; }
}

public QueryOptions QueryOptions
{
get { return AsQueryable.QueryOptions; }
}

public ISession Session
{
get
{
if (_session == null)
_session = _sessionManager.OpenSession();
return _session;
}
}

public void Dispose()
{
if (_session != null)
_session.Dispose();
}

IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}

public IEnumerator<T> GetEnumerator()
{
return AsQueryable.GetEnumerator();
}

public IQueryable<T> Expand(string path)
{
return AsQueryable.Expand(path);
}

public ITransaction BeginTransaction()
{
return Session.BeginTransaction();
}


public void Delete(T item)
{
Session.Delete(item);
}

public T Get(object id)
{
return Session.Get<T>(id);
}

public void Save(T target)
{
Session.SaveOrUpdate(target);
}

public void Update(T item)
{
Session.Update(item);
}
}

public static class CustomerQueries
{
public static IQueryable<Customer> ByName(
this IQueryable<Customer> repo,
string name)
{
return repo.Where(x => x.Name == name);
}
public static IQueryable<Customer> ByCity(
this IQueryable<Customer> repo,
string city)
{
return repo.Where(x => x.City == city);
}

}
public class MyPage
{
IRepository<Customer> _repository;

public MyPage(IRepository<Customer> repository)
{
_repository = repository;
}

public Customer UpdateCustomer()
{
return _repository
.ByCity("Aarhus")
.ByName("Sebastien")
.FirstOrDefault();
}
}
public class when_filtering_by_city
{
public void the_wong_city_is_not_selected()
{
var myTestData = new List<Customer>
{
new Customer { City = "Aarhus" },
new Customer { City = "London" }
};
var funPlaceToBe = myTestData
.AsQueryable()
.ByCity("Aarhus")
.FirstOrDefault();

Debug.Assert(funPlaceToBe.City == "London");
}
}

public class Customer
{
public string Name { get; set; }

public string City { get; set; }
}

Friday, 21 August 2009

OpenRasta 2.0 beta 2 is out

Grab the binaries at http://www.ohloh.net/p/openrasta/download?package=OpenRasta+2.0&release=Beta+2 or the code at http://svn.caffeine-it.com/openrasta/branches/2.0.2000