Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
IStartup
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonathan Channon  
View profile  
 More options Aug 7 2012, 11:18 am
From: Jonathan Channon <jonathan.chan...@gmail.com>
Date: Tue, 7 Aug 2012 08:18:34 -0700 (PDT)
Local: Tues, Aug 7 2012 11:18 am
Subject: IStartup

I've begun using IStartup instead of a Bootstrapper. I've been told that
only one Bootstrapper should exist in one environment and the library that
I'm writing is not going to be the direct host so it should go into
IStartup.

I've done this but I need to move the below into IStartup:

Func<TinyIoCContainer, NamedParameterOverloads, IDocumentSession> factory = (ioccontainer, namedparams) => new DocumentSessionProvider().GetSession();

container.Register(factory);

In IStarup there are

IEnumerable<CollectionTypeRegistration> CollectionTypeRegistrations { get; }
IEnumerable<InstanceRegistration> InstanceRegistrations { get; }
IEnumerable<TypeRegistration> TypeRegistrations { get; }

Firstly I'm not sure which one I should put this logic into, I assume TypeRegistrations but then I'm not sure how to configure it to create a new TypeRegistration and pass in the Func. There does not seem to be any documentation on IStartup

Thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Channon  
View profile  
 More options Aug 7 2012, 2:45 pm
From: Jonathan Channon <jonathan.chan...@gmail.com>
Date: Tue, 7 Aug 2012 11:45:30 -0700 (PDT)
Local: Tues, Aug 7 2012 2:45 pm
Subject: Re: IStartup

The reason I ask is that I have a module such as below that needs a session
injecting into it:

public class PostModule : NancyModule
    {

        private readonly IDocumentSession DocumentSession;

        public PostModule(IDocumentSession documentSession)
            : base("/posts")
        {
            DocumentSession = documentSession;

            Get["/"] = parameters => "Hi";
        }
    }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Prabir Shrestha  
View profile   Translate to Translated (View Original)
 More options Aug 7 2012, 4:08 pm
From: Prabir Shrestha <prabirshres...@yahoo.com>
Date: Tue, 7 Aug 2012 13:08:29 -0700 (PDT)
Local: Tues, Aug 7 2012 4:08 pm
Subject: Re: IStartup

i think IStartup and got renamed to IApplicationStartup in 0.12 and does
not contain CollectionTypeRegistration and those properties you listed.

You can just override ConfigureRequestContainer or
ConfigureApplicationContainer in bootstrapper.

container.Register<IDocumentSession>((c,p) => new
DocumentSessionProvider().GetSession());


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Channon  
View profile  
 More options Aug 7 2012, 5:22 pm
From: Jonathan Channon <jonathan.chan...@gmail.com>
Date: Tue, 7 Aug 2012 14:22:59 -0700 (PDT)
Local: Tues, Aug 7 2012 5:22 pm
Subject: Re: IStartup

It does look like that for 0.12 which means where do I put them as I can't
put them in a BootStrapper


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Channon  
View profile  
 More options Aug 7 2012, 5:26 pm
From: Jonathan Channon <jonathan.chan...@gmail.com>
Date: Tue, 7 Aug 2012 14:26:37 -0700 (PDT)
Local: Tues, Aug 7 2012 5:26 pm
Subject: Re: IStartup

It looks as if there is a IApplicationRegistrations now with the previous
properties I mentioned so the original question still stands.

Thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Håkansson  
View profile  
 More options Aug 7 2012, 5:35 pm
From: Andreas Håkansson <andr...@selfinflicted.org>
Date: Tue, 7 Aug 2012 23:35:35 +0200
Local: Tues, Aug 7 2012 5:35 pm
Subject: Re: [nancy-dev] Re: IStartup

That kind of logic does not work in IStartup (which will be
IApplicationStartup and IApplicationRegistrations in 0.12) because nether
will give you access to the container. Not quite sure of your context so
not sure
what to suggest as an alternative. Why can't you put it in the bootstrapper?

On Tue, Aug 7, 2012 at 11:26 PM, Jonathan Channon <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Grumpydev  
View profile  
 More options Aug 8 2012, 3:00 am
From: Grumpydev <ste.robb...@gmail.com>
Date: Wed, 8 Aug 2012 00:00:08 -0700 (PDT)
Local: Wed, Aug 8 2012 3:00 am
Subject: Re: [nancy-dev] Re: IStartup

As I said on Jabbr, you can't use a factory delegate you need to make a
factory class, register that, then take a dependency on it - if you think
about it, it's obvious that we can't support delegate factories in the
startup classes because we're container agnostic - what would happen if you
ran a container that didn't support them?

The one piece of the puzzle that *is* missing though is startup tasks per
request - we avoided adding this because nobody could give us a use case
and there may be potential perf implications, so we'd have to add that in
before this is possible, so my original suggestion of newing up the session
in the module still stands as a workaround.

*But* I still stand by my statement that persistence should be the remit of
the host app, not your library, which removes this problem altogether.

Andreas: he can't use the bootstrapper because this is a "drop in
functionality" dll, not an app.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Channon  
View profile  
 More options Aug 8 2012, 4:18 am
From: Jonathan Channon <jonathan.chan...@gmail.com>
Date: Wed, 8 Aug 2012 01:18:11 -0700 (PDT)
Local: Wed, Aug 8 2012 4:18 am
Subject: Re: [nancy-dev] Re: IStartup

Ok, so if I move the database stuff to the host app how will it work?

Here is an example of what one of the current routes does in SugarTown
(remember its just a CRUD app):

Post[Route.Root().AnyIntAtLeastOnce("id")] = parameters =>
        {
             var model = DocumentSession.Load<Post>((int)parameters.id);
             this.BindTo(model);
             DocumentSession.SaveChanges();
             return Response.AsRedirect("/posts");
        };

If I move the data storage out how to the host app I'll still need some generic interface to tell it to save the data so IDocumentSession becomes IDatabase?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
João Bragança  
View profile  
 More options Aug 8 2012, 11:18 am
From: João Bragança <joao.p...@braganca.name>
Date: Wed, 8 Aug 2012 08:18:36 -0700
Local: Wed, Aug 8 2012 11:18 am
Subject: Re: [nancy-dev] Re: IStartup
What about using a Pipeline hook to register the IDocumentSession in
Context.Items? It won't be injected into the constructor but it allows
you to control it at the request level.

On Wed, Aug 8, 2012 at 1:18 AM, Jonathan Channon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Channon  
View profile  
 More options Aug 8 2012, 11:21 am
From: Jonathan Channon <jonathan.chan...@gmail.com>
Date: Wed, 8 Aug 2012 08:21:16 -0700 (PDT)
Local: Wed, Aug 8 2012 11:21 am
Subject: Re: [nancy-dev] Re: IStartup


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Channon  
View profile  
 More options Aug 8 2012, 11:32 am
From: Jonathan Channon <jonathan.chan...@gmail.com>
Date: Wed, 8 Aug 2012 08:32:45 -0700 (PDT)
Local: Wed, Aug 8 2012 11:32 am
Subject: Re: [nancy-dev] Re: IStartup

I guess if you did that, that would be a roundabout way of
making persistence agnostic as the host app would then be responsible of
passing in a IDatabase instance to whatever storage menchanism they want to
use. Only thing left is what GrumpyDev said about performance, this is
slightly different though.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Channon  
View profile  
 More options Aug 8 2012, 11:40 am
From: Jonathan Channon <jonathan.chan...@gmail.com>
Date: Wed, 8 Aug 2012 08:40:30 -0700 (PDT)
Local: Wed, Aug 8 2012 11:40 am
Subject: Re: [nancy-dev] Re: IStartup

And the other issue is passing requests from hostapp to other app.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »