» Publishers, Monetize your RSS feeds with FeedShow: More infos (Show/Hide Ads)
Hello portal:
Create new site:
Hi there!
Can do some stuff, maybe later
What’s inside? first-time wizard
Setup git (I’ll spare you the username/password)
The best ide ever – echo
git it
browse it
monitor it
scale it
Have you noticed the “reserved” option? you could actually scale it to a dedicated VM (or a few), using the exact same simple deployment model.
And of course it’s not only for text files. you could run PHP, node.js, as well as the more expected ASP.NET stack, on top of this.
want it
The Web Sites feature is still in preview mode. To start using Preview Features like Virtual Network and Web Sites, request access on the ‘Preview Features’ page under the ‘account’ tab, after you log into your Windows Azure account. Don't have an account? Sign-up for a free trial here
Hello portal:
Create new site:
Hi there!
Can do some stuff, maybe later
What’s inside? first-time wizard
Setup git (I’ll spare you the username/password)
The best ide ever – echo
git it
browse it
monitor it
scale it
Have you noticed the “reserved” option? you could actually scale it to a dedicated VM (or a few), using the exact same simple deployment model.
And of course it’s not only for text files. you could run PHP, node.js, as well as the more expected ASP.NET stack, on top of this.
want it
The Web Sites feature is still in preview mode. To start using Preview Features like Virtual Network and Web Sites, request access on the ‘Preview Features’ page under the ‘account’ tab, after you log into your Windows Azure account. Don't have an account? Sign-up for a free trial here
Hello portal:
Create new site:
Hi there!
Can do some stuff, maybe later
What’s inside? first-time wizard
Setup git (I’ll spare you the username/password)
The best ide ever – echo
git it
browse it
monitor it
scale it
Have you noticed the “reserved” option? you could actually scale it to a dedicated VM (or a few), using the exact same simple deployment model.
And of course it’s not only for text files. you could run PHP, node.js, as well as the more expected ASP.NET stack, on top of this.
want it
The Web Sites feature is still in preview mode. To start using Preview Features like Virtual Network and Web Sites, request access on the ‘Preview Features’ page under the ‘account’ tab, after you log into your Windows Azure account. Don't have an account? Sign-up for a free trial here
During the last year I got to meet several companies. With some I just had a chat over coffee or during a rock concert, with some ran a couple of consulting sessions, for some I did some coding work, with some I discussed maters of process management and agile adoption. With some I interviewed for various fulltime roles, and from some I got very attractive offers.
I’d like to point out a few of the most awesome ones. If you ever get a chance to work with them or for them – you won’t be wrong to take it.
Asana (http://www.asana.com/)
Suffice to say that interviewing with them was the single most difficult interview I have ever gone through. And I have been through some hairy interviews in my time. Just browse their team page, full of successful startup veterans, to understand their capacity for execution, and deep understanding of how a web company is to be build on business, tech and team spirit aspects.
Bizzabo (http://www.bizzabo.com/)
I wish they were around back when I ran IDCC ‘09. The team is super focused, and their product is great. Take a couple of minutes off this page, and go read http://blog.bizzabo.com/5-useful-tips-for-maximizing-your-exhibition.
Commerce Sciences (http://www.commercesciences.com/)
If having Ron Gross there was not enough, they recently added Oren Ellenbogen to their impressive cast. I had the immense pleasure to work with these guys for quite some time. You’ll be able to learn a ton just by being around them. If you’re not following their tweeters and blogs, go do that right now. And if all that is still not enough, the founders have long, successful history in e-commerce and global-scale web services. E-commerce analysis suddenly sounds super interesting!
Gogobot (http://www.gogobot.com/)
With an incredible ability to deliver top-quality features in virtually no-time, focus on customers, tons of talent and super fun team spirit, this gang is re-inventing social travel planning. If you’re travelling somewhere without using the service you are missing out. If you are looking for great team to work with in the Bay area – give them a call.
Windward (http://www.windward.eu/)
This was a refreshing change from all the social-web-mobile-2.0 related companies. these guys are back to basics – solving some actual problems for actual customers with actual money. Forget the long tail – we’re talking big-time clients. They are also dealing with some seriously complex data-crunching, and non-trivial tech challenges. The management crew are extremely professional, experienced and friendly. I spent a truly remarkable month with them, and I’m sure anyone who will be working with them would feel the same.
Yotpo (https://b2b.yotpo.com/)
I think that Tomer and Omri have one of the best age:matureness ratio in the business. They also appear to be able to crack down the social e-commerce formula into a compelling business model.
YouSites (http://yousites.net)
A really unique atmosphere. Working from an old villa in the relaxed Rehovot suburb, with home-cocked food and pets running around. Their sunlit garden is one of the best meeting rooms I’ve been to. With a passionate and experienced team, they got a nice thing going there. Keep an eye on them.
I might have forgotten a few others (sorry) – it has been a crazy year after all
Some of these places are hiring. If you are awesome (you probably are if you’re reading my blog) and want an introduction – ping me.
During the last year I got to meet several companies. With some I just had a chat over coffee or during a rock concert, with some ran a couple of consulting sessions, for some I did some coding work, with some I discussed maters of process management and agile adoption. With some I interviewed for various fulltime roles, and from some I got very attractive offers.
I’d like to point out a few of the most awesome ones. If you ever get a chance to work with them or for them – you won’t be wrong to take it.
Asana (http://www.asana.com/)
Suffice to say that interviewing with them was the single most difficult interview I have ever gone through. And I have been through some hairy interviews in my time. Just browse their team page, full of successful startup veterans, to understand their capacity for execution, and deep understanding of how a web company is to be build on business, tech and team spirit aspects.
Bizzabo (http://www.bizzabo.com/)
I wish they were around back when I ran IDCC ‘09. The team is super focused, and their product is great. Take a couple of minutes off this page, and go read http://blog.bizzabo.com/5-useful-tips-for-maximizing-your-exhibition.
Commerce Sciences (http://www.commercesciences.com/)
If having Ron Gross there was not enough, they recently added Oren Ellenbogen to their impressive cast. I had the immense pleasure to work with these guys for quite some time. You’ll be able to learn a ton just by being around them. If you’re not following their tweeters and blogs, go do that right now. And if all that is still not enough, the founders have long, successful history in e-commerce and global-scale web services. E-commerce analysis suddenly sounds super interesting!
Gogobot (http://www.gogobot.com/)
With an incredible ability to deliver top-quality features in virtually no-time, focus on customers, tons of talent and super fun team spirit, this gang is re-inventing social travel planning. If you’re travelling somewhere without using the service you are missing out. If you are looking for great team to work with in the Bay area – give them a call.
Windward (http://www.windward.eu/)
This was a refreshing change from all the social-web-mobile-2.0 related companies. these guys are back to basics – solving some actual problems for actual customers with actual money. Forget the long tail – we’re talking big-time clients. They are also dealing with some seriously complex data-crunching, and non-trivial tech challenges. The management crew are extremely professional, experienced and friendly. I spent a truly remarkable month with them, and I’m sure anyone who will be working with them would feel the same.
Yotpo (https://b2b.yotpo.com/)
I think that Tomer and Omri have one of the best age:matureness ratio in the business. They also appear to be able to crack down the social e-commerce formula into a compelling business model.
YouSites (http://yousites.net)
A really unique atmosphere. Working from an old villa in the relaxed Rehovot suburb, with home-cocked food and pets running around. Their sunlit garden is one of the best meeting rooms I’ve been to. With a passionate and experienced team, they got a nice thing going there. Keep an eye on them.
I might have forgotten a few others (sorry) – it has been a crazy year after all
Some of these places are hiring. If you are awesome (you probably are if you’re reading my blog) and want an introduction – ping me.
During the last year I got to meet several companies. With some I just had a chat over coffee or during a rock concert, with some ran a couple of consulting sessions, for some I did some coding work, with some I discussed maters of process management and agile adoption. With some I interviewed for various fulltime roles, and from some I got very attractive offers.
I’d like to point out a few of the most awesome ones. If you ever get a chance to work with them or for them – you won’t be wrong to take it.
Asana (http://www.asana.com/)
Suffice to say that interviewing with them was the single most difficult interview I have ever gone through. And I have been through some hairy interviews in my time. Just browse their team page, full of successful startup veterans, to understand their capacity for execution, and deep understanding of how a web company is to be build on business, tech and team spirit aspects.
Bizzabo (http://www.bizzabo.com/)
I wish they were around back when I ran IDCC ‘09. The team is super focused, and their product is great. Take a couple of minutes off this page, and go read http://blog.bizzabo.com/5-useful-tips-for-maximizing-your-exhibition.
Commerce Sciences (http://www.commercesciences.com/)
If having Ron Gross there was not enough, they recently added Oren Ellenbogen to their impressive cast. I had the immense pleasure to work with these guys for quite some time. You’ll be able to learn a ton just by being around them. If you’re not following their tweeters and blogs, go do that right now. And if all that is still not enough, the founders have long, successful history in e-commerce and global-scale web services. E-commerce analysis suddenly sounds super interesting!
Gogobot (http://www.gogobot.com/)
With an incredible ability to deliver top-quality features in virtually no-time, focus on customers, tons of talent and super fun team spirit, this gang is re-inventing social travel planning. If you’re travelling somewhere without using the service you are missing out. If you are looking for great team to work with in the Bay area – give them a call.
Windward (http://www.windward.eu/)
This was a refreshing change from all the social-web-mobile-2.0 related companies. these guys are back to basics – solving some actual problems for actual customers with actual money. Forget the long tail – we’re talking big-time clients. They are also dealing with some seriously complex data-crunching, and non-trivial tech challenges. The management crew are extremely professional, experienced and friendly. I spent a truly remarkable month with them, and I’m sure anyone who will be working with them would feel the same.
Yotpo (https://b2b.yotpo.com/)
I think that Tomer and Omri have one of the best age:matureness ratio in the business. They also appear to be able to crack down the social e-commerce formula into a compelling business model.
YouSites (http://yousites.net)
A really unique atmosphere. Working from an old villa in the relaxed Rehovot suburb, with home-cocked food and pets running around. Their sunlit garden is one of the best meeting rooms I’ve been to. With a passionate and experienced team, they got a nice thing going there. Keep an eye on them.
I might have forgotten a few others (sorry) – it has been a crazy year after all
Some of these places are hiring. If you are awesome (you probably are if you’re reading my blog) and want an introduction – ping me.
Just one year ago, I was working for Sears Israel, living in Raanana and being generally happy with my life.
Since then I left my job, met, consulted and worked with a few awesome startups, and finally joined Microsoft and moved with my family to Redmond, WA.
And had a new baby.
So tons of things were going on, lets see if I can capture some thoughts on them:
Central Israel vs. Seattle suburbs
Life here on the “east-side” are much more relaxed. The amazing scenery, the very low honk/minutes-on-road ratio, switching from an 60 years old tiny apartment to a 20 years old house, cool, drizzly weather vs the hot and moist middle east. We do miss our families very much, but we also have much richer social lives here, with many friends, and plenty of play-dates and outdoor activities for the kids.
Startups vs. Corporate
I’ve been working with and for startups for many years now. The move to a ~100,000 strong company is a huge change. Half a year in, and I am still struggling to adapt to the big-company way of thinking. There is also a big sense of responsibility knowing that my work now will soon be affecting a serious amount of customers globally, a thing that in many cases in startup world is not entirely true.
Startups are also often times between financially promising, and money-down-the-drain. Microsoft is in business for many decades, and still manages to net tons of money every year, and every year do so more than the last one.
I also need to re-prove myself. When I was employed full-time in the past I was holding top positions such as Architect, Dev manager, and was offered a few VP R&D and CTO jobs. As a busy consulted, I way actually paid to come in and voice my opinions out loud. In corporate land I started much lower, and now need to work very hard to get my voice heard. Especially when I am surrounded with a really talented and experienced bunch of people. I see it as a challenge and as an opportunity to grow and learn. Being a Lion’s tail beats Wolf’s head almost any day of the year. And it is full of Lions around here.
One kid vs. two
Given W[n]<=>work required for n kids, and F[n]<=>fun gained from n kids, it is sad that
F[n+1] = F[n] * 2, while W[n+1] = W[n] 2
Totally worth it though.
Settling down
It has been a heck of a year, with so many things to do that it kept me busy from engaging the OSS and dev community activities as I did in the past. I only gave two short tech presentations (on git and on NoSQL data stores), did very little OSS contributions, and wrote no blog posts for seven months!
Now that the whirlwind slowed down, I find myself getting back to these things. I already have tons of things to write about, and a few session proposals to send out to conferences.
As far as this blog goes - the year of changes has just ended, and the year of new and exciting (at least for me) content begins. Stay tuned.
Just one year ago, I was working for Sears Israel, living in Raanana and being generally happy with my life.
Since then I left my job, met, consulted and worked with a few awesome startups, and finally joined Microsoft and moved with my family to Redmond, WA.
And had a new baby.
So tons of things were going on, lets see if I can capture some thoughts on them:
Central Israel vs. Seattle suburbs
Life here on the “east-side” are much more relaxed. The amazing scenery, the very low honk/minutes-on-road ratio, switching from an 60 years old tiny apartment to a 20 years old house, cool, drizzly weather vs the hot and moist middle east. We do miss our families very much, but we also have much richer social lives here, with many friends, and plenty of play-dates and outdoor activities for the kids.
Startups vs. Corporate
I’ve been working with and for startups for many years now. The move to a ~100,000 strong company is a huge change. Half a year in, and I am still struggling to adapt to the big-company way of thinking. There is also a big sense of responsibility knowing that my work now will soon be affecting a serious amount of customers globally, a thing that in many cases in startup world is not entirely true.
Startups are also often times between financially promising, and money-down-the-drain. Microsoft is in business for many decades, and still manages to net tons of money every year, and every year do so more than the last one.
I also need to re-prove myself. When I was employed full-time in the past I was holding top positions such as Architect, Dev manager, and was offered a few VP R&D and CTO jobs. As a busy consulted, I way actually paid to come in and voice my opinions out loud. In corporate land I started much lower, and now need to work very hard to get my voice heard. Especially when I am surrounded with a really talented and experienced bunch of people. I see it as a challenge and as an opportunity to grow and learn. Being a Lion’s tail beats Wolf’s head almost any day of the year. And it is full of Lions around here.
One kid vs. two
Given W[n]<=>work required for n kids, and F[n]<=>fun gained from n kids, it is sad that
F[n+1] = F[n] * 2, while W[n+1] = W[n] 2
Totally worth it though.
Settling down
It has been a heck of a year, with so many things to do that it kept me busy from engaging the OSS and dev community activities as I did in the past. I only gave two short tech presentations (on git and on NoSQL data stores), did very little OSS contributions, and wrote no blog posts for seven months!
Now that the whirlwind slowed down, I find myself getting back to these things. I already have tons of things to write about, and a few session proposals to send out to conferences.
As far as this blog goes - the year of changes has just ended, and the year of new and exciting (at least for me) content begins. Stay tuned.
Just one year ago, I was working for Sears Israel, living in Raanana and being generally happy with my life.
Since then I left my job, met, consulted and worked with a few awesome startups, and finally joined Microsoft and moved with my family to Redmond, WA.
And had a new baby.
So tons of things were going on, lets see if I can capture some thoughts on them:
Central Israel vs. Seattle suburbs
Life here on the “east-side” are much more relaxed. The amazing scenery, the very low honk/minutes-on-road ratio, switching from an 60 years old tiny apartment to a 20 years old house, cool, drizzly weather vs the hot and moist middle east. We do miss our families very much, but we also have much richer social lives here, with many friends, and plenty of play-dates and outdoor activities for the kids.
Startups vs. Corporate
I’ve been working with and for startups for many years now. The move to a ~100,000 strong company is a huge change. Half a year in, and I am still struggling to adapt to the big-company way of thinking. There is also a big sense of responsibility knowing that my work now will soon be affecting a serious amount of customers globally, a thing that in many cases in startup world is not entirely true.
Startups are also often times between financially promising, and money-down-the-drain. Microsoft is in business for many decades, and still manages to net tons of money every year, and every year do so more than the last one.
I also need to re-prove myself. When I was employed full-time in the past I was holding top positions such as Architect, Dev manager, and was offered a few VP R&D and CTO jobs. As a busy consulted, I way actually paid to come in and voice my opinions out loud. In corporate land I started much lower, and now need to work very hard to get my voice heard. Especially when I am surrounded with a really talented and experienced bunch of people. I see it as a challenge and as an opportunity to grow and learn. Being a Lion’s tail beats Wolf’s head almost any day of the year. And it is full of Lions around here.
One kid vs. two
Given W[n]<=>work required for n kids, and F[n]<=>fun gained from n kids, it is sad that
F[n+1] = F[n] * 2, while W[n+1] = W[n] 2
Totally worth it though.
Settling down
It has been a heck of a year, with so many things to do that it kept me busy from engaging the OSS and dev community activities as I did in the past. I only gave two short tech presentations (on git and on NoSQL data stores), did very little OSS contributions, and wrote no blog posts for seven months!
Now that the whirlwind slowed down, I find myself getting back to these things. I already have tons of things to write about, and a few session proposals to send out to conferences.
As far as this blog goes - the year of changes has just ended, and the year of new and exciting (at least for me) content begins. Stay tuned.
Thanks to http://support.microsoft.com/kb/321185 and to Ariel (@Q) who have read it more carefully than I did, I learnt that there is a SERVERPROPERTY that you can query:
SELECT SERVERPROPERTY ('edition')
I expected to find Developer, but found Express instead.
Thanks to http://support.microsoft.com/kb/321185 and to Ariel (@Q) who have read it more carefully than I did, I learnt that there is a SERVERPROPERTY that you can query:
SELECT SERVERPROPERTY ('edition')
I expected to find Developer, but found Express instead.
Thanks to http://support.microsoft.com/kb/321185 and to Ariel (@Q) who have read it more carefully than I did, I learnt that there is a SERVERPROPERTY that you can query:
SELECT SERVERPROPERTY ('edition')
I expected to find Developer, but found Express instead.
MySQL is weird
The weirdest problem happened to a college today.
When creating the database schema during integration tests run, he got “Cannot create table FOO error 105” from MySQL.
There *used* to be a table named FOO with a VARCHAR primary key. The schema then changed so that the primary key of FOO became BIGINT. There is also a second table in the system (call it BAR) which has a foreign-key into FOO’s primary key. A classic master/details scenario.
However, the table BAR was obsoleted from the schema.
The integration tests runner is dropping all tables and recreating them before running the test suite. It is inferring the schema from the persisted classes using NHibernate’s mapper and the Schema creation feature of NHibernate.
Sleeves up
We cranked open the mysql console and started to look around:
- When doing “SHOW TABLES”, the FOO table was not listed.
- CREATE TABLE FOO (`Id` BIGINT) - fail with error 105.
- CREATE TABLE FOO (`Id` VARCHAR) – success !!
- huh?
- DROP TABLE FOO – success
- encouraging !
- CREATE TABLE FOO (`Id` BIGINT) - fail with error 105 – again
- huh ???
- DROP TABLE FOO – fail with “cannot delete … foreign key …”
- but SHOW TABLES still does not list FOO
- huh ?????
- DROP DATABASE dev; CREATE DATABASE dev;
- now everything works.
Back to work
Luckily this was not a production database, and even more lucky – the said DB change (change that PK from VARVHAR to BIGINT) would need to run on production within a separate DB instance that can be recreated on deploy.
And while we’re at it
Way can’t MySQL store non-indexed columns in an index?
MySQL is weird
The weirdest problem happened to a college today.
When creating the database schema during integration tests run, he got “Cannot create table FOO error 105” from MySQL.
There *used* to be a table named FOO with a VARCHAR primary key. The schema then changed so that the primary key of FOO became BIGINT. There is also a second table in the system (call it BAR) which has a foreign-key into FOO’s primary key. A classic master/details scenario.
However, the table BAR was obsoleted from the schema.
The integration tests runner is dropping all tables and recreating them before running the test suite. It is inferring the schema from the persisted classes using NHibernate’s mapper and the Schema creation feature of NHibernate.
Sleeves up
We cranked open the mysql console and started to look around:
- When doing “SHOW TABLES”, the FOO table was not listed.
- CREATE TABLE FOO (`Id` BIGINT) - fail with error 105.
- CREATE TABLE FOO (`Id` VARCHAR) – success !!
- huh?
- DROP TABLE FOO – success
- encouraging !
- CREATE TABLE FOO (`Id` BIGINT) - fail with error 105 – again
- huh ???
- DROP TABLE FOO – fail with “cannot delete … foreign key …”
- but SHOW TABLES still does not list FOO
- huh ?????
- DROP DATABASE dev; CREATE DATABASE dev;
- now everything works.
Back to work
Luckily this was not a production database, and even more lucky – the said DB change (change that PK from VARVHAR to BIGINT) would need to run on production within a separate DB instance that can be recreated on deploy.
And while we’re at it
Way can’t MySQL store non-indexed columns in an index?
MySQL is weird
The weirdest problem happened to a college today.
When creating the database schema during integration tests run, he got “Cannot create table FOO error 105” from MySQL.
There *used* to be a table named FOO with a VARCHAR primary key. The schema then changed so that the primary key of FOO became BIGINT. There is also a second table in the system (call it BAR) which has a foreign-key into FOO’s primary key. A classic master/details scenario.
However, the table BAR was obsoleted from the schema.
The integration tests runner is dropping all tables and recreating them before running the test suite. It is inferring the schema from the persisted classes using NHibernate’s mapper and the Schema creation feature of NHibernate.
Sleeves up
We cranked open the mysql console and started to look around:
- When doing “SHOW TABLES”, the FOO table was not listed.
- CREATE TABLE FOO (`Id` BIGINT) - fail with error 105.
- CREATE TABLE FOO (`Id` VARCHAR) – success !!
- huh?
- DROP TABLE FOO – success
- encouraging !
- CREATE TABLE FOO (`Id` BIGINT) - fail with error 105 – again
- huh ???
- DROP TABLE FOO – fail with “cannot delete … foreign key …”
- but SHOW TABLES still does not list FOO
- huh ?????
- DROP DATABASE dev; CREATE DATABASE dev;
- now everything works.
Back to work
Luckily this was not a production database, and even more lucky – the said DB change (change that PK from VARVHAR to BIGINT) would need to run on production within a separate DB instance that can be recreated on deploy.
And while we’re at it
Way can’t MySQL store non-indexed columns in an index?
The scenario:
Given a blog application, with the following layout![]()
with two possible usages – a post page: ![]()
and a homepage:![]()
Let’s define the view model:
PostData: string Title string Body PostView PostData Post; HomepageView PostData[] Posts LayoutView Tuple<string, int>[] Archive Tuple<string, int>[] TagCloud string[] Similar
The views:
- _Layout.cshtml – obvious
- Post.cshtml – given a PostData instance will render Title and Body
- PostPage.cshtml – given a PostData, will call Post.cshtml and then render “add comment” form
- Homepage.cshtml – given PostData array, will iterate and call Post.cshtml for each post
How data moves around:
- Controller is passing PostView (or HomepageView) *along with* LayoutView to the views
- Post.cshtml should only see its parameters, not the layout’s (which are passed but are not interesting within the post template).
- same goes for the other views
- All views should be able to “see” a shared parameter named “IsCurrentUserAdmin”
Given that I want typed access to the view parameters in the view (for the sake of intellisense and refactorings), how would I model and pass the data around?
I’ve pseudo-code-grade written two options: the first is to use inheritence in the view model to achieve type-ness, on the expense of flexibility (composition is difficult with class hierarchy, and you need to be aware of and grab the viewModel instance in various places). The second is flexible (use the ViewData dictionary) but getting type-ness is cumbersome and partial (strings scattered around, casting needed etc.)
see https://gist.github.com/1272269 if the gist widget does not load in-place
I do have a solution that works for me
With the many years that I’ve been writing complex web apps using various ASP.NET frameworks and almost always with c# based, static-typed view engines, I have a solution that works very nicely for me.
But I want to be aware of the MVC3 canonical / textbox way
So for all you MVC3 ninja’s out there – please describe your way of doing it.
I will describe my approach in an upcoming post and I’d appreciate any input on it
The scenario:
Given a blog application, with the following layout![]()
with two possible usages – a post page: ![]()
and a homepage:![]()
Let’s define the view model:
PostData: string Title string Body PostView PostData Post; HomepageView PostData[] Posts LayoutView Tuple<string, int>[] Archive Tuple<string, int>[] TagCloud string[] Similar
The views:
- _Layout.cshtml – obvious
- Post.cshtml – given a PostData instance will render Title and Body
- PostPage.cshtml – given a PostData, will call Post.cshtml and then render “add comment” form
- Homepage.cshtml – given PostData array, will iterate and call Post.cshtml for each post
How data moves around:
- Controller is passing PostView (or HomepageView) *along with* LayoutView to the views
- Post.cshtml should only see its parameters, not the layout’s (which are passed but are not interesting within the post template).
- same goes for the other views
- All views should be able to “see” a shared parameter named “IsCurrentUserAdmin”
Given that I want typed access to the view parameters in the view (for the sake of intellisense and refactorings), how would I model and pass the data around?
I’ve pseudo-code-grade written two options: the first is to use inheritence in the view model to achieve type-ness, on the expense of flexibility (composition is difficult with class hierarchy, and you need to be aware of and grab the viewModel instance in various places). The second is flexible (use the ViewData dictionary) but getting type-ness is cumbersome and partial (strings scattered around, casting needed etc.)
see https://gist.github.com/1272269 if the gist widget does not load in-place
I do have a solution that works for me
With the many years that I’ve been writing complex web apps using various ASP.NET frameworks and almost always with c# based, static-typed view engines, I have a solution that works very nicely for me.
But I want to be aware of the MVC3 canonical / textbox way
So for all you MVC3 ninja’s out there – please describe your way of doing it.
I will describe my approach in an upcoming post and I’d appreciate any input on it
The scenario:
Given a blog application, with the following layout![]()
with two possible usages – a post page: ![]()
and a homepage:![]()
Let’s define the view model:
PostData: string Title string Body PostView PostData Post; HomepageView PostData[] Posts LayoutView Tuple<string, int>[] Archive Tuple<string, int>[] TagCloud string[] Similar
The views:
- _Layout.cshtml – obvious
- Post.cshtml – given a PostData instance will render Title and Body
- PostPage.cshtml – given a PostData, will call Post.cshtml and then render “add comment” form
- Homepage.cshtml – given PostData array, will iterate and call Post.cshtml for each post
How data moves around:
- Controller is passing PostView (or HomepageView) *along with* LayoutView to the views
- Post.cshtml should only see its parameters, not the layout’s (which are passed but are not interesting within the post template).
- same goes for the other views
- All views should be able to “see” a shared parameter named “IsCurrentUserAdmin”
Given that I want typed access to the view parameters in the view (for the sake of intellisense and refactorings), how would I model and pass the data around?
I’ve pseudo-code-grade written two options: the first is to use inheritence in the view model to achieve type-ness, on the expense of flexibility (composition is difficult with class hierarchy, and you need to be aware of and grab the viewModel instance in various places). The second is flexible (use the ViewData dictionary) but getting type-ness is cumbersome and partial (strings scattered around, casting needed etc.)
see https://gist.github.com/1272269 if the gist widget does not load in-place
I do have a solution that works for me
With the many years that I’ve been writing complex web apps using various ASP.NET frameworks and almost always with c# based, static-typed view engines, I have a solution that works very nicely for me.
But I want to be aware of the MVC3 canonical / textbox way
So for all you MVC3 ninja’s out there – please describe your way of doing it.
I will describe my approach in an upcoming post and I’d appreciate any input on it
My blog has moved to AppHarbor, and while doing that I also changed the engine for a completely custom thing (running on custom-y stuff like WebOnDiet and NTemplate), to a wee bit more conventional codebase based on MVC3 and Razor, with lots of nuget packages replacing custom code that I wrote myself.
The packages file now contains AntiXSS, AttributeRouting, Castle.Core (for my good pal DictionaryAdapterFactory), elmah, MarkdownSharp, mongocsharpdriver, XmlRpcMvc and XmlRpcMvc.MetaWeblog (awesome!)
BTW, expect a post on using the DictionaryAdapterFactory to make handling Controller=>View data transport truly awesome.
What’s missing here? IoC !
yeah I did not bother with that now. I have my tiny 15LOC thing and this blog does not need anything of this sort.
Some things might still break. Files I used to host for downloading would probably won’t work now. I will fix that soon I hope, time permitting.
note to self – reshuffle the tags here on the blog. I need to re-tag may entries. Maybe I’ll let site visitors suggest tags?
My blog has moved to AppHarbor, and while doing that I also changed the engine for a completely custom thing (running on custom-y stuff like WebOnDiet and NTemplate), to a wee bit more conventional codebase based on MVC3 and Razor, with lots of nuget packages replacing custom code that I wrote myself.
The packages file now contains AntiXSS, AttributeRouting, Castle.Core (for my good pal DictionaryAdapterFactory), elmah, MarkdownSharp, mongocsharpdriver, XmlRpcMvc and XmlRpcMvc.MetaWeblog (awesome!)
BTW, expect a post on using the DictionaryAdapterFactory to make handling Controller=>View data transport truly awesome.
What’s missing here? IoC !
yeah I did not bother with that now. I have my tiny 15LOC thing and this blog does not need anything of this sort.
Some things might still break. Files I used to host for downloading would probably won’t work now. I will fix that soon I hope, time permitting.
note to self – reshuffle the tags here on the blog. I need to re-tag may entries. Maybe I’ll let site visitors suggest tags?







