Feed on
Posts
Comments

I’ve reinstalled my machine of last night with Windows 7. I’m very happy with this new platform! Thank you Microsoft. One of the final reasons to start yesterday was that my database integration in Visual Studio was broken. Of course there where many more reasons, but that was the issue which made me do it yesterday evening.

So far so good. This morning I started of with a clean and very fast machine. Visual Studio 2008 was ready to roll. I’ve installed the Developer Edition of VSTS yesterday eve.

Today I decided to spent a little bit of time on getting the Entity Framework to work for a small, highly data-driven portal I’ve to develop. One of the issues with the portal is that it should be ready by yesterday. Not so much pressure, but I wanted to be highly productive. Unfortunately I’m highly disappointed.

While we all still claim that simplistic data driven websites should be online in a couple of hours, the truth is the opposite. I’ve got an app where you’ve got users. Users can be in a WorkGroup and some of those these users are leaders of the group. In objects:

  • User.WorkGroups –> List<WorkGroup>
  • WorkGroup.Users –> List<User> –> All users associated, incl leaders.
  • WorkGroup.Leaders –> List<User> –> All leaders

In the database you’ll store this as 3 tables: User, WorkGroup and an AssociationTable with a property ‘IsLeader’ (bit).

The database design was easily made, as I told you before, I decided to use the Entity Framework. But somehow I was absolutely unable to get this to work. I could get the User <-> WorkGroup(many to many relation) to work, but the Leader-relation couldn’t be made without modifying the generated code(or maybe the XML?). 

I’m sure one of you guys will give me the solution how to get this to work. And once again absolutely sure that this is not impossible. But I’m in general wondering why I couldn’t figure this out during the 2 hour R&D I’ve spent on it. The designer doesn’t seem to support something like that. Or it is hidden, somewhere. I’m not sure if this is just a limitation of the Entity Framework or of many O/R mappers.

I do know I generally dislike my whole process. I’ve been switching over and over between the different designers for my entities and database. This makes me wondering. What if this is your daily task? Getting a model designed by business users(interpretation I), normalize this(interpretation II), fit this into an object design(interpretation III) and maybe redo some of these part during one of the stages.

Let’s look from a perspective of a developer. I do not care about the database. It should just be stored. I care about the way I can access the data, so I want to control the types in my entities. My illusion: create a model(we’ve got a language for that: UML). Hit a button, and code + database should be ready.

Optimizations for storage and in the data access code should be done by the generation. The computer is way smarter when it comes to optimizing, it can calc all data access roads and ask if I want to flag more often used data. When I want to create a specific method(for example: GetById) I can define it in OCL.

The solution seems to be so obvious. Why can’t I find such a tool? I can find database generation tools, I can find O/R mappers. I can even find frameworks which should be O/R mappers(isn’t the Entity Framework the framework to be?). But none of these support my vision.

What can I do know? I can use a CMS to store my relational data. All my relational data, maybe thousands of records. I’ve to find a way how to store it internally as CMS’s use all kind of structures, but never a relational one.

I’ll end up in this project using an heavily modified Sitecore installation with lots of custom code to get around the limitations(I’m able to write that quickly as you can imagine). But hopefully you’ve seen my point. I gives me a huge headache in this age of data generation, web service generation for out scaling, advanced cache structures, cloud computing, etc.

Do you got a solution in mind for me?

Note: This is a post written out of my experience as an architect in many projects. I’m involved in general in Sitecore projects, but rarely I’ve got the opportunity to ‘work’ a little outside of this boxed environment. Often these high level problems arise as well in project where Sitecore is involved. I won’t blame a vendor, but I’m wondering why we smart guys are not able to solve issues like productivity without doing concessions on the business requirements.

The competent programmer is fully aware of the limited size of his own skull. He therefore approaches his task with full humility, and avoids clever tricks like the plague.

I wanted to be smart. I tried to use LINQ to XML for parsing an Atom feed. Here’s what I’ve got to read a link:

var urlElement = item.Elements(xmlns + "link")
                                .Where(link.Attribute("rel").Value == "alternate")
                                .Select(link => link.Attribute("href").Value)
                                .First();

Do you see the issues? 3 Nullpointers:

  1. Attribute “rel” in my Where
  2. Attribute “href” in my Select
  3. First() –> What if I have nothing to get the first of?

Once again this underlines what Edsger W. Dijkstra said in the quote written above. You try to be smart by using the latest stuff, coolest tools, etc. But the limitations are never described, you’ll only experience them while debugging.

Another lesson learned.

Small update: Those who are using Resharper will get notified about the first 2 nullpointers, but not about the third. On the other hand, solving that in the where clause doesn’t fix the value analysis (seems to be hard in lambda’s).

Sometimes when you’re updating item in hooks, you’ll receive strange error messages in the client. The reason for this is quite clear. Sitecore has an event system divided in 2 parts: the regular events such as item:created. The other one is the NotificationContext. This particular class is used by the Sitecore client to get notified before time intensive actions such as event broadcasting is done.
You can use this functionality as well by simply subscribing to the delegates in Sitecore.Context.Notifications.

But what if you’re updating or manipulating your repository triggered by a client action? Exactly, the client has subscribed to a specific action, but when the event will be triggered, a collection has changed or a DataContext is missing. The solution is easy: use Sitecore.Data.BulkUpdataContext in a using statement:

using(new Sitecore.Data.BulkUpdate())

{

//Your update code

}

Nobody gets notified, but important events(configured in the web.config/include files) will get triggered.

Have fun coding!

You can feel it everywhere! Lord of the Rings starts with these sentences.
So does my new project. I’m not going to reveal anything. But some parts might be interesting for you. On January 1st 2009, I’ll start of with a new website. This website is rather a project then just a single website. It all has to do with Web 2.0, Social Networking, but also Sitecore. It’s all about experiencing what goes around on the web these days. And how to take advantage of it.

On technical side: I’m developing a close integration of Sitecore with all kinds of social networks / web 2.0 services. When I’m talking about close, we’re talking this time about tight! Using Sitecore as data aggregator in several ways. But also a web 2.0  portal and main distribution channel.

Expect my sources to be published on our shared source repository somewhere February. When everything is stable.

More info upcoming later this week.

Sitecore is alive and kicking. A lot is happening internally on product development. New modules and integrations with technology partners get released at the same speed as Bugatti Veyrons get sold ;) . In new (even emerging) markets such as Australia, South Africa, Israel, Asia and New Zealand, Sitecore becomes the standard for Web Marketing.
Yeah that’s right: Web Marketing. More then ever Sitecore becomes a tool for the Marketers. Once again: yes, just the tool. IT grows up, we are more then often just the tool to reach goals. Information goals, conversion goals and even more physical commercial goals such as direct sale.

All of this doesn’t mean that Sitecore forgets where we came from. Very often Lars Fløe Nielsen and I have talks about the incredible number of developers who work with Sitecore, other Sitecore technical numbers like our implementations but also namespaces, classes and methods in our product(s). Both Lars and I are very proud when we look at Sitecore as a company. Almost 50% of our colleagues are involved in Product development. When I’m talking about involved, this doesn’t mean that they contribute code to the repository, but rather talk on a daily base about product directions. We supply our feedback, feeded by our outstanding power team of partners and customers, in a well formed way to product development. In this way there’s no way for them to find excuses for such another outstanding improvement in the product. We provide the exact reason, the pain and possible solution. Together with the right business case supplied by you out there, we’re able to remain world leading in innovative content management :) .

This morning in the train I’ve been thinking how to address some of the issues of our developer customer around the world. The guys who are writing and rewriting code on a daily base. A lot of you have made us famous inside your company. So we should listen to you guys as well. Like I said, we try to do this always, but sometimes, it’s good to trigger people. So please! go ahead, react on this post. Tell us what we should do better, what we should different, what’s working what not. I’m particular interested in what makes your process less time intensive and more efficient.
Should we come up with a Visio shape for designing your data? Or should we deliver you a templated WebControl for our advanced types? Is a part undocumented what should be documented? Please let me know.
But please note one thing: I’m looking for feedback, not for a flame war. This is my first try to do this. Hopefully we can start a dialogue more often.

So please go ahead!

This Thursday, Christian Daems is showing the world of Content Management and Internet Innovation in Bruxelles, Belgium. A real cool event.

Sitecore is one of the biggest sponsors of this event. I’ll be there together with some of my Danish colleagues and a handful of partners. Please drop by our boot when you want to get to know more about Sitecore. Or in case you want to share some thoughts with me.

Lars Nielsen, one of our Vice Presidents, is opening this event as a keynote speaker.

Hope to see you there!

At Sitecore we have upgraded our site to version 6. Because of our tightly integration with background systems it took a little moment. But finally we’re there.

As we’ve got 20+ content editors across the globe, the change affected lots of editors. I’ll show you a mail from the head of our marketing department, Paul Markun, to all the content editors:

Hello Content Editors:

Please remember there is a content freeze on Sitecore.net until this Monday, Nov 17th.

But , once you do start editing content on Monday or later, the tips that Oksana put together below for editors – specific to our implementation – may be helpful. If you experience any issues please let us know (myself and Oksana). Thanks.

——————————————————–

After switching Sitecore.net to Sitecore 6.0, you will notice the following few changes in the content editor. These changes are big functionality improvements, but some of them might be a little confusing at first, in particular because we are running in live mode. Live mode means that we use only one database for both working version and published version of the content. In live mode, the workflow is the only mechanism that controls when our changes become visible on the web. So publishing an item in live mode is equivalent to completing the workflow for it; that is, reaching the workflow’s final state.

At this point we keep the workflow for all Sitecore.net items the same as before the conversion to Sitecore 6. In this workflow, the item only has 2 states: Edited and Published. In the Published state, the latest saved version of the content item is visible to the web site visitors. In  the Edited state, the previous version of the item is visible on the web , and the latest working version is only available to the content editors, no matter how many times it is saved. When content editors feel that the latest version of an item is ready to be published, they execute the Publish command to move the item to the Published state. Once the item is moved to the Published state, its latest version becomes available on the web site.

There is no approval state in the current workflow and everyone has the ability to publish items they have write access to. In the future we might introduce a more complicated workflow for some items that will require someone else’s approval before the item can be published.

The changes you might notice are:

1. Workflow warning message:
clip_image002
This warning does not apply to the live mode, where publishing is equivalent to moving the item to the final workflow step. So just ignore it and publish the item by clicking the Publish command of the Editing state in Home/Edit menu area as you did previously in 5.3.
clip_image004

2. Validation errors
clip_image006
If you hover over the red vertical line indicating the presence of validation errors, you will see the short validation summary for this field.
Depending on how the validation rules are set up, the errors might or might not prevent you from publishing (or completing the workflow) for this item.
The best practice is to solve all validation issues before publishing your items.

3. Rich text fields are automatically validated to comply with w3c XHTML standards. You can use the Suggest Fix feature to have Sitecore automatically fix XHTML validation errors for you.
clip_image008

4. There are a number of data types that were announced deprecated (or obsolete) in Sitecore 6. These types were superseded by newer, more powerful types.

These are:
clip_image009

Even though the old types are still supported, we have found a few problems with them during our testing. For example, the regional editor would not be able to insert a link to partner’s website because the template used the old Link type.
We tried to fix as many problems as possible, but there is still a chance that there are more. So if you edit an item in Sitecore.net on version 6 and encounter a problem such as  not being able to edit a field of the above type, it is because this type has been deprecated in version 6. Please let us know and we will fix it quickly.

And of course, there is a detailed Sitecore 6 content editing reference, available on SDN: http://sdn.sitecore.net/upload/sitecore6/contentauthorscookbook-usletter.pdf.

———————————————

Best Regards,
Paul Markun

VP Marketing

As you can see, our marketing team has confidence – after this short briefing – that we’ll be able to start editing again. I think this is the right approach for your editors as well. They should start working like we do. Instructions of what’s not 100% clear can be done (on individual base) later on.

NOTE: You’re absolutely allowed to use the above description for your editors. But keep in mind that this applies to our specific Sitecore implementation. Some of the points(like Live mode) might not apply at all to your implementation.

Thanks to Paul for allowing me to post this internal email. To my audience: Good luck spreading the word!

This week I got notified that one of the Dutch developer from our partner Evident is blogging about Sitecore: Mark van Aalst.
Good work Mark and keep up posting. Hopefully a bit more then I do… ;-)

Funny, check this post on From handling by Scott Guthrie. Why exactly do we want to move away from the ASP.NET Control model to MVC? To write more code? Even creating a form becomes harder. Wasn’t MVC designed to display… Models? I might be to tired right now to understand this. But I can’t see a clear reason for me to go to MVC Form handling. Everything described was implemented together with LINQ to SQL(or Entities) in 10 minutes, with some generated classes(the LINQ stuff) and 20 lines of HTML and ASP.NET controls, and another 20 lines of boilerplate C# code. Yes I tried it.

I’m missing the clue. Are you still on track? Correct me if I’m wrong, but isn’t making this model development once again more sophisticated? I can see the purpose of MVC for large amounts of data. For a year now I’m writing notes to myself on how to create a DSL for generating this model out of Sitecore. But in ALL my notes, I’ve never mentioned form data. And the funny thing is, in this example you can only use 1 specific url to post your data too.

I don’t want to to Sitecoreish, but one of greatest things about Sitecore is that I can place my forms anywhere and reuse in on any page… I’m getting more unsure where Microsoft has designed the MVC framework for. Scott Guthrie says at the end:

Important: If you don’t like the MVC model or don’t find it natural to your style of development, you definitely don’t have to use it.  It is a totally optional offering – and does not replace the existing WebForms model.  Both WebForms and MVC will be fully supported and enhanced going forward (the next release of ASP.NET WebForms will add richer URL routing features, better HTML markup/client-side ID/CSS support, and more).  So if after reading the above post you think “hmm – that doesn’t feel natural to me”, then both don’t worry, and don’t feel like you should or need to use it (you don’t). 

Let’s say it in another way: I’ve been interesting in the MVC model since the first moment. I hoped it could improve productivity for you guys out there, writing div’s and lists on daily base. With the identical data. So far it seems to be only designed for Database driven applications, similar to phpMyAdmin, but less flexible. That’s not where I was looking for. Hopefully Scott gives us a better impression next time, right now I’m completely unsatisfied with it.

For those who mention that MVC will help us in test driven approaches. You’re 200% right. But… a test driven approach can only succeed when you create software to reach requirements. You can’t write a Unit test in part x of the application when a Unit test in part y of the application tells you the opposite. One of those will fail, certainly. The requirements of our customers are quite clear in general: we want flexible websites which can be controlled from a CMS. So far that seems to be impossible. So a test driven approach doesn’t make sense at all.
Some recent news from our R&D department proved me that I’m not 100% right in this post: we’re trying to be as less dependant of the HttpContext as possible. We’re working on ways to let Sitecore run outside of the HttpContext. No ETA’s and product announcement from me, just to inform you, that we take your requirements(even when it are quality or development requirements) serious.

You might think I’m to critical, guess I’m. But I’ll give MVC, when it will be released, another serious change. Our R&D team believes, like I do, in the pattern itself. We have to look further into it, how and under which circumstances we can support it once released. That will definitely be a nice challenge.

It’s funny, these days people are extremely pleased about the products from Apple. I’m absolutely happy with the usability of the iPhone, I like my iPod and I’m still asking Michael Seifert(our CEO) if I can get the first Sitecore Macbook Air ;) . Enough commercials. I’m a fanatic Microsoft user. Most likely you are as well. Sometimes I like it, although I’ve got my doubt about usability and release management. We’ve seen enough of that with the .NET 3.5 SP1 release.

But why for god’s sake, can’t Apple manage it to make iTunes a usable application on Windows? It’s crazy. A company so much focused on usability creates a slow unusable application with a huge memory footprint. Porting your application settings from your previous installation to a new one is a hell. And than the installer. Everyone who has to install Quicktime, iTunes or Safari is used to it:

apple update

My god, 77.25 MB’s? And now only 31.80 MB? I lost clue. Even more annoying: A while ago I decided not to install Safari. Wrong, total mistake. You get triggered all the time(sometimes on a daily base) if you want to install this browser. NO!! Ask me only once, don’t be Googlish(you know with their ugly toolbar in every open source installation).
Finally after the installation above, I received the following message:

apple restart

So, Apple, who’s always critical about Windows, can’t even create an installer which doesn’t have to restart? Although I have to give them one credit… my iPod survived a trip in the washing machine :) . Sorry for my dirt, but it seems like commercial companies of this size can’t score a positive figures on all sides. And, that’s even worst, this is nothing new, they don’t seem to care, otherwise it was fixed long ago.

Updated: thank you commenter for updating my spelling, I always welcome people to let me learn from my mistake. Unfortunately my commenter is the kind of person who accesses a public computer and doesn’t use his real email. So I’m unable to thank him. Sorry!

« Newer Posts - Older Posts »