|
The best description I ever heard of a ViewModel was "a value converter on steroids". It's meant to take in a whole bunch of model data and turn it into a form that's easily consumable by some View. Definitely not necessarily 1-1 with any particular model.
|
# ? Aug 27, 2015 16:07 |
|
|
# ? Jun 7, 2024 14:25 |
|
Gul Banana posted:the problem with MVVM is that it's incomplete. it specifies the viewmodel-view decoupled binding process, which is cool, but it doesn't give any indication of where your business logic or service access should live- there's just a vague 'models' layer which doesn't really make sense as you'd rarely want ui sections (v/vm) corresponding 1:1 to data types (m) I recently gave a talk on MvvmCross and wanted to give an MVVM precursor. This slide contains most of the points I would make: Basically, MVVM as a UI pattern is really only concerned with the View and ViewModel. It's not so much incomplete as it is open-ended. Do whatever you want with your model, whatever your application or use case requires. The UI paradigm shouldn't affect that.
|
# ? Aug 27, 2015 23:17 |
Might be wrong thread but i'll go for it - anyone here have any MS Certifications? I'm scheduled to take 70-483 Programming in C# at the end of September. About 4-5 years experience. Was it worth it? Any tips/advice/insight?
|
|
# ? Aug 28, 2015 01:13 |
|
authwiggidywack posted:Might be wrong thread but i'll go for it - anyone here have any MS Certifications? I'm scheduled to take 70-483 Programming in C# at the end of September. About 4-5 years experience. It's incredibly easy. Worth it? Not really.
|
# ? Aug 28, 2015 01:23 |
Ithaqua posted:It's incredibly easy. Worth it? Not really. Thanks for the input - are any of the certifications down the line worth getting? I've already paid for this one so I'm just going to get it and be done with it.
|
|
# ? Aug 28, 2015 02:02 |
|
authwiggidywack posted:Thanks for the input - are any of the certifications down the line worth getting? I've already paid for this one so I'm just going to get it and be done with it. Not really. I have 4 certs, and I only got them because my company needs to keep X number of people with MCSDs in order to retain our partner status. Basically, the tests are all horseshit because you can (and most do) download answer dumps and just memorize everything. They are totally meaningless. It might help you get past an HR drone, especially if you have relatively little experience, but no one on the technical side of things will care one way or the other.
|
# ? Aug 28, 2015 02:12 |
Ithaqua posted:Not really. I have 4 certs, and I only got them because my company needs to keep X number of people with MCSDs in order to retain our partner status. The answer dumps certainly don't help with the authenticity of the certifications, that is for sure. Thanks again.
|
|
# ? Aug 28, 2015 02:16 |
|
Ithaqua posted:Not really. I have 4 certs, and I only got them because my company needs to keep X number of people with MCSDs in order to retain our partner status. Yeah, I've got the old-school MCSD only because the company I was working for at the time gave us cash bonuses and also time off to study for the tests (lol) so they could keep some partner status. I consider them pretty much pointless and haven't ever gotten the impression that anyone puts much stock in them as far as candidate evaluation.
|
# ? Aug 28, 2015 03:52 |
|
One of the main reasons certifications are useful is that some tenders (especially government tenders) require you to prove that you have N people certified to work with technology X. In this sense hoarding certificates can be good for the company. Often, the same people are listed as the specialist team who will work on every tender because they have the certificates, where in reality they might never even know that such a project existed if the tender were won.
|
# ? Aug 28, 2015 06:53 |
|
Bognar posted:I recently gave a talk on MvvmCross and wanted to give an MVVM precursor. This slide contains most of the points I would make: I agree with this & with the other posters who've said something similar- my objection to the name MVVM is that it's unclear (In other uses of "MVC" acronyms the Ms are often a specific thing) and that it doesn't make it plain enough that it's only UI-concerned (again, something like ASP.NET MVC covers control logic as well). So you get a lot of new people confused by how fat their viewmodels should be, how to bind stuff together, etc.
|
# ? Aug 28, 2015 07:34 |
|
authwiggidywack posted:Might be wrong thread but i'll go for it - anyone here have any MS Certifications? I'm scheduled to take 70-483 Programming in C# at the end of September. About 4-5 years experience. I did this one as well, the problem with it is that it doesn't teach why you do stuff only how to do stuff.
|
# ? Aug 28, 2015 07:54 |
|
Mr Shiny Pants posted:I did this one as well, the problem with it is that it doesn't teach why you do stuff only how to do stuff. And it doesn't even really do that because the actual best way to get the cert is the answer dump. Even with a fair amount of experience in the subject area, the tests still have a decent amount of random esoteric crap that you might not have ever encountered.
|
# ? Aug 28, 2015 16:16 |
|
Has anyone done anything like invite codes/referred codes before? I created a free/unlimited tier for my app for partners, those that will actively promote the app and I was trying to come up with a way that they (or I) can generate an invite code and use that as part of the signup process...I'm asking as I'm a bit lost and don't want to reinvent the wheel.
|
# ? Aug 28, 2015 21:39 |
|
Uziel posted:Has anyone done anything like invite codes/referred codes before? I created a free/unlimited tier for my app for partners, those that will actively promote the app and I was trying to come up with a way that they (or I) can generate an invite code and use that as part of the signup process...I'm asking as I'm a bit lost and don't want to reinvent the wheel. I've always just used Guid.NewGuid(). Use that to generate a URL for referrals, then check for a referring user with that guid during signup.
|
# ? Aug 28, 2015 22:06 |
|
Anybody in here have experience with ASP.NET 5 beta apps on Azure? I'm getting chronic, nasty performance issues: 5 to 12 second response times when all I'm doing is reading a string from a Redis cache and shooting it on toward the client. I also get an occasional issue where my API puts out an empty web page instead of JSON. I'm not sure what to try, except maybe to downgrade to the current version of Web API.
|
# ? Aug 28, 2015 23:22 |
|
Bognar posted:I've always just used Guid.NewGuid(). Use that to generate a URL for referrals, then check for a referring user with that guid during signup. That would be my approach too. fleshweasel posted:Anybody in here have experience with ASP.NET 5 beta apps on Azure? I'm getting chronic, nasty performance issues: 5 to 12 second response times when all I'm doing is reading a string from a Redis cache and shooting it on toward the client. I also get an occasional issue where my API puts out an empty web page instead of JSON. I'm not sure what to try, except maybe to downgrade to the current version of Web API. At the risk of sounding like a smartass have you profiled it?
|
# ? Aug 29, 2015 17:43 |
|
Honestly not sure. I'm about to get with my friend who's been hosting it using his free azure credit and poke at whatever tools Microsoft provides for profiling a running app. It actually started being responsive at midnight, kept being responsive until a few minutes ago, and is now back at 6 second or so response times.
|
# ? Aug 29, 2015 18:12 |
|
Does anyone know if the ASP.NET MVC Boilerplate template that's on Visual Studio Gallery is any good? Are there any recommended alternatives?
|
# ? Aug 30, 2015 20:51 |
|
Super low-level question, I'm doing something insane with the .NET Micro Framework and apparently the "stelem" and "ldelem" instructions (specifically, the ones that accept an arbitrary type) aren't supported by it. That seemed weird, so I looked at some disassembled IL and it looks like the C# compiler doesn't emit it even when it could. Like, if I do this: code:
code:
code:
OneEightHundred fucked around with this message at 05:03 on Aug 31, 2015 |
# ? Aug 31, 2015 04:50 |
|
every time i release an update to a nuget package, now, my coworkers who're on VS2015 look at me like i shot their dogs
|
# ? Aug 31, 2015 07:30 |
|
OneEightHundred posted:Super low-level question, I'm doing something insane with the .NET Micro Framework and apparently the "stelem" and "ldelem" instructions (specifically, the ones that accept an arbitrary type) aren't supported by it. That seemed weird, so I looked at some disassembled IL and it looks like the C# compiler doesn't emit it even when it could. Totally talking out my rear end here, but stelem is specifically for arrays while stobj is for arbitrary memory locations. So, stelem performs a null reference check on the array, checks for out of bounds, and checks for array type mismatch with the stored object. If the compiler can guarantee that all of those are true, it might opt to use stobj instead since fewer runtime checks will mean better performance.
|
# ? Aug 31, 2015 15:17 |
|
I am working on a c# program that can add, update and display a table. I am able to get the program to run, enter and display the table. However the update clause is giving me trouble.code:
"string" does not contain a definition for Parameters and "string" does not contain a definition for ExecuteNonQuery(); Thanks in advance for any input or tips.
|
# ? Aug 31, 2015 16:11 |
|
joebuddah posted:The errors I am getting are keep looking at thee 3 lines: string updtCmd = "UPDATE PATIENT WHERE @id = Id SET Locaton = @location (Id,Location) VALUES (@id,@location)"; SqlConnection conn = GetConnection(); new SqlCommand(updtCmd, conn);
|
# ? Aug 31, 2015 16:23 |
|
You actually need to use the SqlCommand you created, as you do in AddPat. Currently you're calling ExecuteNonQuery on a string, which obviously can't work. Also, your SQL update syntax is incorrect. It should be: UPDATE PATIENT SET Locaton = @location WHERE Id = @id E: Also, if you just rethrow exceptions, don't use throw ex; but just throw; instead. If you don't do it this way it will create a completely new exception instead of just passing the existing one on, which kills the stack trace information you had on it. Granted, in this case it doesn't really make a difference as the stack trace would point to code inside the SqlConnection, but it's good practice to learn early anyway. SirViver fucked around with this message at 16:57 on Aug 31, 2015 |
# ? Aug 31, 2015 16:51 |
|
Bognar posted:I've always just used Guid.NewGuid(). Use that to generate a URL for referrals, then check for a referring user with that guid during signup.
|
# ? Aug 31, 2015 23:08 |
|
Having some problems with Simple Injector and PerWebRequest registration. Part of me wonders if I'm understanding DI properly because I'm new to it and this problems feels like a flaw with my entire approach. I have an MVC project that is utilising a separate library (let's call it RadLib) that I've also developed. RadLib uses dependency injection heavily, and so I've set up all the required wiring in my consuming MVC project. RadLib has what I'm calling a "Session", but it shouldn't be confused with the MVC Session. It's just a basic object that holds the logged in user, some information about their permissions and a session ID, and a few other bits and pieces. The intention is that the session object gets instantiated on every request, and a base controller takes care of checking whether the user is currently logged into an Identity and uses a SessionId Claim to resume the session with RadLib. Any future commands are run though a "SessionValidatorDecorator" to ensure there is a session active and that it's well-formed in various ways. The way I've done this is to pass around an instance of this session object to the login/resume commands, so that once they've confirmed login or resumption, they populate the session with all the information it needs and then any future uses of that session object for the duration of the web request should have access to that same instance. The problem I'm having is that the logging in and resuming is working fine, but when I send another command the session validation decorator is receiving a new instance of the session object even though it's still the same web request. I know the above is probably difficult for someone else to understand, but hopefully someone can help me here? The crux of the issue is: I have an object that should be registered PER WEB REQUEST, but for some reason at a seemingly arbitrary point a new instance is created DURING a single web request, so I lose the existing details. Have I misunderstood how per web request works? putin is a cunt fucked around with this message at 01:25 on Sep 1, 2015 |
# ? Sep 1, 2015 01:23 |
|
This is a particularly hard thing to diagnose without looking at code. From an IoC container perspective, implementing per-request lifetime is dead simple so I wouldn't expect it to be a bug in Simple Injector or anything. Can you post some code from your SessionValidatorDecorator and your IoC wire-up?
|
# ? Sep 1, 2015 02:16 |
Trying to transition to visual studio 2015 and it's breaking on exceptions even if it's in a try/catch and even if I have all the exception types unchecked in the exception handler. What gives?
|
|
# ? Sep 1, 2015 02:16 |
|
Bognar posted:This is a particularly hard thing to diagnose without looking at code. From an IoC container perspective, implementing per-request lifetime is dead simple so I wouldn't expect it to be a bug in Simple Injector or anything. Can you post some code from your SessionValidatorDecorator and your IoC wire-up? I think the problem is how I was using the resolver, I've managed to fix it now (always the way: struggle with something for days, ask a question about, and the answer arrives immediately!)
|
# ? Sep 1, 2015 02:51 |
|
Manslaughter posted:Trying to transition to visual studio 2015 and it's breaking on exceptions even if it's in a try/catch and even if I have all the exception types unchecked in the exception handler. What gives? I wonder if turning on "just my code" under tools > options > debugger will help?
|
# ? Sep 1, 2015 03:35 |
Already on, unfortunately.
|
|
# ? Sep 1, 2015 04:01 |
|
I got it fixes thanks for all the help
|
# ? Sep 1, 2015 04:59 |
|
How do you guys handle sharing common data to your views in an MVC project? For example, I want a boolean flag that can be accessed in any view that controls whether a particular <div> is shown - how would I do this in a tidy way? I can obviously use ViewBag but I'd like for the data to be strongly typed if at all possible.
|
# ? Sep 1, 2015 05:21 |
|
A base ViewModel with an ActionFilter could do it in a nice transparent way, everything would need to extend from it though. An interface could do the same job also.
|
# ? Sep 1, 2015 09:44 |
|
e: nm, I'm not understanding the question.
Kekekela fucked around with this message at 12:42 on Sep 1, 2015 |
# ? Sep 1, 2015 12:12 |
|
Kekekela posted:Use an @model directive. I think what Funking Giblet wants is some way of having a 'global' boolean variable that any view can have access to, regardless of its actual model type. Personally I'd probably just add the bool to allrelevant ViewModels. e: Or use a static class that views can 'ask' but that seems like it might violate some principle or other. chippy fucked around with this message at 12:33 on Sep 1, 2015 |
# ? Sep 1, 2015 12:31 |
|
chippy posted:I think what Funking Giblet wants is some way of having a 'global' boolean variable that any view can have access to, regardless of its actual model type. If its just that he wants to access a piece of data that a lot of models need, but doesn't want to put it on the models (or a base class), then he could store it in session and access it from within the view. I think that would be a bad idea on several levels as well as going around your rear end to get to your elbow though, so I'm guessing I just don't understand the issue. Kekekela fucked around with this message at 13:23 on Sep 1, 2015 |
# ? Sep 1, 2015 12:39 |
|
Manslaughter posted:Trying to transition to visual studio 2015 and it's breaking on exceptions even if it's in a try/catch and even if I have all the exception types unchecked in the exception handler. What gives? Turn off the option to break on first chance exceptions.
|
# ? Sep 2, 2015 06:18 |
|
So I have an F# question: I have an HttpListener that receives a connection and I want this to work with a MailboxProcessor. Logically I want to receive connection --> kick off to a new MailboxProcessor --> be ready for the next request. What I am wondering about is the overhead of creating a new MailboxProcessor for each new Request coming in. Should I do this? Or should I create a couple of them and round-robin the Requests between them? Is this stupid? If so why? This is just something for fun, so I am just wondering. I like the conceptual idea of taking the request --> kicking it off to an Agent --> ready for next request.
|
# ? Sep 2, 2015 10:27 |
|
|
# ? Jun 7, 2024 14:25 |
|
What does your MailboxProcessor do? Does it have any heavyweight dependencies? If it's just an object with a few methods on it and simple dependencies, then that's not gonna be a source of performance problems and pooling them isn't gonna make a significant difference. What I'd worry more about is your concurrency model. How many requests can be executing at one time, and on how many threads? How does asynchronicity fit in? Too much creation/destruction of threads or even just too many threads can cause performance problems.
|
# ? Sep 2, 2015 14:56 |