Code sample library?

94 views
Skip to first unread message

Ian Battersby

unread,
Oct 13, 2011, 6:35:23 PM10/13/11
to FubuMVC Development Group
I know there are efforts to improve documentation and consideration
for doing FubuDinner example application but do wonder if new adopters
might most benefit from a code-sample library on fubu-project.org? My
thoughts are that a library covering common use-cases would be a
fantastic kick-starter in knowing where to start, and questions on the
mailing list could feed it's content.

Due to current delivery pressures I won't get round to FubuDinner for
some weeks but could definitely start contributing code-samples
straight away as I'm spiking like mad anyway (e.g. authorisation
policies).

Thoughts?

Ian Battersby

unread,
Oct 16, 2011, 9:27:04 AM10/16/11
to fubumv...@googlegroups.com
I'll take the silence as a negative on that idea then (smile); will move back to putting code samples in documentation format :)

> --
> You received this message because you are subscribed to the Google Groups "FubuMVC Development Group" group.
> To post to this group, send email to fubumv...@googlegroups.com.
> To unsubscribe from this group, send email to fubumvc-deve...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/fubumvc-devel?hl=en.
>

Chad Myers

unread,
Oct 16, 2011, 10:34:58 AM10/16/11
to fubumv...@googlegroups.com

I didn't understand what you meant before. I re-read it and it makes sense now.  The word "recipes" sticks out in my mind. I think that would be beneficial, yes.

It will need to be done in an actual project with tests, under CI to prevent the samples/recipes from going out of date or broken as the framework changes out from underneath it.

If you could get a repo, csproj/sln set up with a basic app shell and one recipe with a test (in the same csproj is fine) and get a rake script going to run the test(s), that'd be great.

Next we'll get it on teamcity.codebetter.com for ci and then we'll find a way to publish the recipes from that project automatically to the doc site or the main fubu project site.

Sound good?

Chad

Ian Battersby

unread,
Oct 17, 2011, 4:42:41 PM10/17/11
to fubumv...@googlegroups.com
Sure thing, leave it with me :)

smerrell

unread,
Oct 24, 2011, 11:50:38 PM10/24/11
to fubumv...@googlegroups.com
I really like that idea Ian. There is a little bit of that going on with the QuickStart project that I moved from the old documentation repository but if we could have a new one it would be so much nicer. Once  we have it as part of the build it is easy to include any section of code into the Sphinx documentation, just take a look at how I'm doing it with the Getting Started Guide[1]

Ian Battersby

unread,
Oct 25, 2011, 2:47:30 PM10/25/11
to fubumv...@googlegroups.com
Thanks Sam. I've created a repository but we haven't put anything in there, this will most likely next week along with some build scripts; perhaps after that I can get some feedback before doing any documentation.

On 25 Oct 2011, at 04:50, smerrell wrote:

I really like that idea Ian. There is a little bit of that going on with the QuickStart project that I moved from the old documentation repository but if we could have a new one it would be so much nicer. Once  we have it as part of the build it is easy to include any section of code into the Sphinx documentation, just take a look at how I'm doing it with the Getting Started Guide[1]


--
You received this message because you are subscribed to the Google Groups "FubuMVC Development Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/fubumvc-devel/-/A2arWePIRSwJ.

Sam Merrell

unread,
Oct 26, 2011, 11:23:41 PM10/26/11
to fubumv...@googlegroups.com
Nice! Looking forward to seeing some code.

Ian Battersby

unread,
Nov 20, 2011, 6:45:57 AM11/20/11
to FubuMVC Development Group
I hope to move FubuMVC.Recipes forwards in anger over the coming week
whilst on A/L; Franc has already contributed a couple of recipes to
get the ball rolling and I've now introduced buildsupport + ripple +
rake so we can ensure recipes run against the latest release. I can
immediately think of 10+ recipes to put on there but if anyone has any
specific requests then do shout and I'll get on it.

https://github.com/ianbattersby/FubuMVC.Recipes

On a side note I've also kick-started another NerdDinner clone as
discussed with Jeremy some months ago, my intention is also to
complete this next week.

Chad Myers

unread,
Nov 20, 2011, 3:05:50 PM11/20/11
to fubumv...@googlegroups.com
Ian, Frank:

This is great, thank you for your contributions!

The original plan, as I remembered it, was:

  • Get a repo stood up [check!]
  • csproj/sln setup with basic app shell [check! right?]
  • one recipe with a test [I think this is done, right?]
  • rake script to run the tests [done?]
  • get it set up in teamcity.codebetter.com build.fubu-project.org [I'll work with Josh Arnold on this]
  • public recipes automatically to the doc site and/or main FubuMVC site [todo]

I'm trying to remember the most frequent topics that come up that we should have recipes for:

  • Different ways of setting up HomeIs<>()
  • A simple behavior to illustrate how to make your own behavior and wire it in
  • Some simple, illustrative HTML conventions
  • Some URL conventions
  • A slightly more advanced recipe for showing how to do conditional behaviors
  • Redirects
What are some of the ones you've thought of?

I think the immediate goal should be to do an example recipe so that people can start cranking out recipes.

While that's going on and people are banging out recipes, I can work on getting the build going on the build server and start seeing about how to publish things to the doc and/or project site.

-Chad

--
You received this message because you are subscribed to the Google Groups "FubuMVC Development Group" group.

Ian Battersby

unread,
Nov 20, 2011, 6:40:21 PM11/20/11
to fubumv...@googlegroups.com
Hi Chad,

To clarify the current status;

  • Repo setup as agreed, happy to add contributor accounts upon request or move to Darth in the future.
  • Current structure is solution-per-recipe with own test projects for purposes of isolation. One-level deep directory structure to separate recipes into different areas/categories (more thought required here). *All* recipes share common packages directory for the purposes or rippling via rake build script (and as such each solution as a nuget.config to redirect).
  • It is my intention that every recipes has associated tests, I need to stress this to contributors (added tests to one today).
  • Rake script w/buildsupport git submodule done; roughly based on FubuMVC with improvised ruby to discover individual solution recipes and associated test assemblies automatically.

Outstanding;

  • Would be excellent to get this setup on build.fubu-project.org so will leave with you + Josh; the build script might need some additional magic I didn't replicate from the FubuMVC rakefile but easy enough to do I expect.
  • Do you mean "publish recipes"? If so then I hadn't thought about doing it automatically, sounds like an interesting challenge!

Recipes;

Big thanks to Franc(isco) for doing the two that are on there already; I've tweaked them slightly to align with the work above and will be adding my own from tomorrow morning now the groundwork is done. Very much agree with your suggestions, I don't have a definitive list of my own but off the top of my head;

  • Usage
    • IAuthorizationPolicy (including application via IConfigurationAction)
    • IAuthorizationFailureHandler
    • FubuContinuation (including assertions)
    • ICurrentChain
    • IRedirectable

  • Examples for
    • Asset Pipeline
    • FubuValidation
    • Handlers convention (incl. route-constrained names)
    • IFubuPage extension methods including siblings (e.g. LabelFor, InputFor, UrlFor) in Spark
    • Session management via ISecurityContext
    • File upload via Ajax
    • REST-specific (headers, etags, hypermedia, etc)
    • OWIN host (Kayak?)

In all honesty what I can't quickly rattle off is my revision list for the week. Suggest we use a Wiki page to create a to-do list? Completely agree with your suggestion about immediately creating an example recipe, I will do this in the morning and shout out for feedback :)

Joshua Arnold

unread,
Nov 20, 2011, 9:17:09 PM11/20/11
to fubumv...@googlegroups.com
Hey guys,

Catching up on emails from the weekend. Let's sync up this week and get a build going on build.fubu-project.org.

Chad, let's offline this one and I'll get you the info.

franc

unread,
Nov 21, 2011, 5:22:25 AM11/21/11
to FubuMVC Development Group
Hi,

I have these two more recipes still to upload:
1. How to create a behavior that enables your actions to response to
different formats.
2. How to upload a file via ajax

I'll upload them this week


On Nov 20, 8:05 pm, Chad Myers <chad.my...@gmail.com> wrote:
> Ian, Frank:
>
> This is great, thank you for your contributions!
>
> The original plan, as I remembered it, was:
>

>    - Get a repo stood up [check!]
>    - csproj/sln setup with basic app shell [check! right?]
>    - one recipe with a test [I think this is done, right?]
>    - rake script to run the tests [done?]
>    - get it set up in teamcity.codebetter.com build.fubu-project.org [I'll


>    work with Josh Arnold on this]

>    - public recipes automatically to the doc site and/or main FubuMVC site


>    [todo]
>
> I'm trying to remember the most frequent topics that come up that we should
> have recipes for:
>

>    - Different ways of setting up HomeIs<>()
>    - A simple behavior to illustrate how to make your own behavior and wire
>    it in
>    - Some simple, illustrative HTML conventions
>    - Some URL conventions
>    - A slightly more advanced recipe for showing how to do conditional
>    behaviors
>    - Redirects


>
> What are some of the ones you've thought of?
>
> I think the immediate goal should be to do an example recipe so that people
> can start cranking out recipes.
>
> While that's going on and people are banging out recipes, I can work on
> getting the build going on the build server and start seeing about how to
> publish things to the doc and/or project site.
>
> -Chad
>

Artem Smirnov

unread,
Nov 21, 2011, 7:41:33 AM11/21/11
to fubumv...@googlegroups.com
Would be great to have a recipe for asset management.

Ian Battersby

unread,
Nov 21, 2011, 9:51:08 AM11/21/11
to fubumv...@googlegroups.com
With so many good suggestions come in I've knocked up the Wiki page to try and get some centralised list together, out of this has also come some more thoughts on how to organise the recipes as the emerging structure doesn't wow me.

https://github.com/ianbattersby/FubuMVC.Recipes/wiki

My thinking is that it would be good if the structure mirrored the /src directory so it not only gives an indicator to the relevant source-code, in addition it's something Chad might be able to use to tie in with documentation. Any thoughts?

On 21 Nov 2011, at 12:41, Artem Smirnov wrote:

Would be great to have a recipe for asset management.

--
You received this message because you are subscribed to the Google Groups "FubuMVC Development Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/fubumvc-devel/-/M5RkoUuaxH4J.

Ian Battersby

unread,
Nov 22, 2011, 9:41:20 AM11/22/11
to fubumv...@googlegroups.com
FYI; I have now uploaded what I believe is the ideal recipe, both in structure and content - that being;
  • Contained Visual Studio solution with tests
  • Include readme.markdown with description of your recipe
  • Include nuget.config in solution directory pointing at /src/packages
  • Solution directory named "Recipe" that includes readme.markdown and nuget.config
  • Follow directory naming convention, see the Wiki headers here
  • Build successfully from command-line using Rake with no failing tests
My example is here;

On a side-note (Franc especially) I have moved the other recipes to new structure. 

I believe Josh is getting the CI build setup on build.fubu-project.org which means we effectively have regression tests ;-)

Ian Battersby

unread,
Nov 28, 2011, 8:12:57 PM11/28/11
to fubumv...@googlegroups.com
Quick word of warning for those who have already cloned this repo: 

I decided it needed some re-structing so we have something a little more coherent going forwards (and before I upload more recipes); apologies if it causes you any issues, a new empty repo might be easiest. 


On a side note I'm occasionally getting blank pages from Spark, if you see this also _please_ shout, am assuming it's local phenominimum at the moment :(

Kevin Miller

unread,
Nov 28, 2011, 10:50:55 PM11/28/11
to fubumv...@googlegroups.com
Ian, 

Regarding black pages: when using Content Negotiation (Conneg) I've gotten blank pages when I don't have a view defined or it is not binding properly. No idea if this is in play in your neck of the woods. 

A good debug technique to fight this is firing up diagnostics and looking at the packaging setup for your view. If your view cannot bind to an action for some reason it will usually be spelled out there. 

Kevin
Reply all
Reply to author
Forward
0 new messages