« first day (3199 days earlier)      last day (1752 days later) » 

mr5
8:16 AM
 
 
3 hours later…
11:31 AM
can types be registered and resolved in the same class - (unity container)?
 
12:29 PM
I converted this into this. how accurate is my implementation of that diagram?
 
 
3 hours later…
3:03 PM
@mshwf yeah you can directly call Resolve in the container. More often than not that would be a delegate which calls Resolve, though. So it wouldn't actually be invoked until whatever you're setting up is actually run
In fact in the container is probably the only place where it's appropriate to call Resolve, otherwise the container is a service locator
 
3:21 PM
You probably answering the first question..
what I was trying to achieve (in console application) is to inject against the constructor of Program class, but where to register the service in the container since the Program is the starting class?
 
3:31 PM
You can't and it wouldn't make any difference anyway. Main is static, so it wouldn't see any members you set in the constructor.
 
 
2 hours later…
mr5
5:36 PM
I've posted again a post after some years:
0
Q: Convert dialog from chat into official Q&A post

mr5Even though I've been in SO for 6 years, I find myself visiting the Q&A home page more and more infrequently, though I always get landed directly under /questions/id section when Google searching for an answer for every specific programming questions I have. As someone working fulltime, it just ...

 
 
1 hour later…
mr5
7:02 PM
Oh look! A property feature in C++
38
A: Possible to convert C# get,set code to C++

JaredParAre you using C++/CLI? If so this is the property syntax public: property std::string Temp { std::string get() { return sTemp; } void set(std::string value) { sTemp = value; this->ComputeTemp(); } } If you are trying to use normal C++ then you are out of luck. There is no equiv...

 
 
3 hours later…
10:20 PM
hola
 
10:33 PM
you look like matt damon
 
10:52 PM
@juanvan are you thre
there
 
11:14 PM
he does!
 
11:25 PM
lol
I have a question
when creating classes for an application... besides a model and dto
are classes supposed to be or have specific terminology for field parameters vs methods i.e. would you call something a service that is a class that has methods that act upon data... etc
 
I think the word Service is quite specific
That normally implies you're going across the network to do something on another location and implicitly in your code then you accept that you have to understand the characteristics of the service
So yes calling a service that really is a service WhateverService is good stuff
Calling stuff -Utilities or -Manager or stuff like that no I don't agree with
 
well there are helpers... i thought a service was a body of code that acts upon the application itself
kinda like a helper
not a web service
 
That's not the idiom I'd use in C#
 
mmmm dependency injection uses that terminology a lot
i guess i can see it both ways
 public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            if (!string.IsNullOrEmpty(Configuration[BotOpenIdMetadataKey]))
                ChannelValidation.OpenIdMetadataUrl = Configuration[BotOpenIdMetadataKey];

            // Create the credential provider to be used with the Bot Framework Adapter.
            services.AddSingleton<ICredentialProvider, ConfigurationCredentialProvider>();
this that for example
 
I see what you mean when I think about DI examples
but I think they are using that as an example
 
11:38 PM
i guess what I am asking is... is a class, besides a model, supposed to be used for it's oo'ness or not really
 
OO in my experience tends to be over-hyped. It has its place but a deep inheritance hierarchy with all the logic in the objects, meh no
 
what do you mean exactly
 
like for example a bunch of objects you want persisted to a database. Rails calls it "Active Record", where the object you make changes to in your business logic remembers its state and is itself responsible for saving changes to a database
the opposite of POCO
 
hmmmm i am missing something
i get that but what do you mean exactly?
are you saying it's a good thing, different or something else
 
Is what a good thing?
 
11:51 PM
oo
lol you said it is over-hyped
 
Use it where it makes sense for you
 
ok i think i know what you're saying but not 100 sure
are you saying oo is a very specific thing i.e. a model
 
No
I'm not saying that
 

« first day (3199 days earlier)      last day (1752 days later) »