« first day (2026 days earlier)      last day (2123 days later) » 

7:46 AM
hello
 
morning
 
 
3 hours later…
11:00 AM
Hi all
 
Hi guys
Is anybody active here?
I am trying to design code for this below requirement and schema :
SecurityQuestion
Id
Question


User
Id
Name
City
QuestionId
Answer

Room
RoomId
Name

BookIt
Id
UserID
RoomId
BookDate
From
- First i want to check user is valid or not based on question and answer submitted by user
- If user is valid then i want to check whether there is room available for user for a given date and time
- If room is available then save data in BookIt table
Check User Validity => Check room Availability => Book room(save in BookIt table)
So does chain of responsibility make sense in this scenario?
 
hi alex
 
Hi Daniele
 
I don't understand what you are asking exactly. The order of the operation seems correct to me
@Learning-Overthinker-Confused
 
so chain of responsiblty make sense here?
 
11:16 AM
honestly, i have no clue abouthow exactly chain of responsability pattern works in depths. I wouldn't torn my mind on applying patterns where they are not necessary
 
i checking wikipedia. Honestly you have a precise order of operation. You don't need chain here
at least in my opinion.
 
can you explain me why chain of responsibility doesnt make sense here?
 
because you know who handle what. You don't have multiple request to handle
 
but if my first step is successfull then only i would like to execute next step
 
11:20 AM
you have one request and a sequence of strict operation to do
 
ok.Can you help me design code for this
 
yes and you don't need to check if for instance the BookTable method can handle the user validity check
 
like what class interface will come?
 
in short, because i need to have my lunch: One class that store the above parameters. One public method called BookTable that will be called when your app catch the request. Inside this method you call 3 private method one by one only if the previous return a positive result
it's just a simple program, nothing more
at least, in my opinion
 
but having 3 methods inside 1 class will break SRP right
like 1 class is handling everything
 
11:26 AM
the responsability of your class is to book a table
the check are part of this responsability
 
I am thinking to create 2 interface :
IRoomBookingManager
IUserManager
IRoomBookingManager will contain 2 methods:
CheckAvailability
BookRoom
IUserManager :
Authenticate()
 
 
1 hour later…
12:41 PM
Good morning!
 
12:54 PM
hello lynn
 
mornin all
 
'Morning! How's it going?
 
peachy
 
1:13 PM
morning both
 
1:39 PM
morning
 
you guys are all way too cheery for monday morning
 
Meh. I had an excellent weekend
 
for me it's already monday afternoon. So i am closer to the weekend.
 
1:55 PM
I have coffee. That's good enough.
 
@Julien did you not catch the sarcasm in my "peachy" comment?
 
In my experience chain of responsibility just results in crazy hard to understand code
 
2:19 PM
Maaan, I need to read GoF. Yeah, (having just read up on it), it seems like a really powerful pattern, that you shouldn't use if the problem doesn't fit it. Also seems like you'd implement it with a linked list.
If you made it recomposable... it seems like you'd never really know what happens in what order? I don't know how L-O-Cs problem fits chain of responsibility... It seems too direct and interdependant.
 
i don't know. I feel that sometimes people try to squeeze design pattern where are not really needed
i mean, the guy above had really only 3 operation to be executed in a precise order
with a condition that if the previous operation fail then the whole process stop
 
Yeah... A lot of their questions are from some schoolwork or something, and they're often toy problems typical from schoolwork.. but the problems also often seem poorly conceived
 
seems more like a state machine than anything
or at least you could do a similar concept
 
I mean, with boolean state, if you're not later vaeifying the login
*varifying
nope. Can't spell or type today. got it.
 
it was surely something related to school. The guy was talking also about single responsability principle
 
 
1 hour later…
3:46 PM
posted on May 07, 2018 by Rich Lander [MSFT]

Today, we’re announcing .NET Core 2.1 Release Candidate 1 (RC 1). The .NET Core 2.1 RC 1 is now ready for broad testing and for production use. Our quality, reliability, and performance testing give us confidence that the release is ready for the first set of production users. On the metrics that we can measure,... Read more

posted on May 07, 2018 by Rich Lander [MSFT]

At Microsoft Build Live today, we are sharing a first look at our plans for .NET Core 3. The highlight of .NET Core 3 is support for Windows desktop applications, specifically Windows Forms, Windows Presentation Framework (WPF), and UWP XAML. You will be able to run new and existing Windows desktop applications on .NET Core... Read more

 
3:57 PM
ooh... shiny
aw. not going to be cross platform
 
Ah. Just addind WF and WPF on .NetCore for windows? Still Xam-only on other platforms?
 
looks like it
 
Hm....
 
4:16 PM
Any of you guys ever attend build?
 
Ignite; but not build
would love to go to either again
 
Why? (not being belligerent -- curious about motivations)
 
Technically all the sessions are online but finding the time to actually go through and watch them is nigh-on impossible. Actually being there lets you focus on each session; you get the opportunity to ask questions and talk to the presenters, etc.
 
Ah, I was curious whether you would say "networking opportunities"
 
There's networking opportunities and you can see various vendors at the showcase as well; but I got a ton of value going to the various sessions at ignite
I'm really bad at networking
I mean; Ignite is where I learned about .NET Core and Angular
more or less launched my current position
 
4:30 PM
Nice!
I'd like to get out to Build at some point.
What is the difference between Build and Ignite?
 
I think Build is more oriented towards public-facing application development; Ignite is a mix of Enterprise development and IT
 
Ah... ok
 
Obviously code is code so you can lean a lot going to either
 
 
1 hour later…
5:36 PM
Wait... you're saying code is code? All of this time... I thought the code that I was writing was special.
sobs uncontrollably
 
6:11 PM
lol
 
posted on May 07, 2018 by Diego B Vega [MSFT]

Today, we are excited to announce that the first release candidate of EF Core 2.1 is available, alongside .NET Core 2.1 RC 1 and ASP.NET Core 2.1 RC 1, for broad testing, and now also for production use! Go live support EF Core 2.1 RC1 is a “go live” release, which means once you test... Read more

 
6:57 PM
I think UK has a holiday today
@RudiVisser Is that right?
 
does DI always involve interfaces?
because what if you only have one type ever of a class, why bother making an interface for it? for example
private readonly IEngine _engine;
public void Car(IEngine engine)
{
    _engine = engine;
}
VS
private readonly Engine _engine;
public void Car(Engine engine)
{
    _engine = engine;
}
 
@erotavlas Typically, the answer to that is testing
hard to test with concrete instances
you don't technically need the interface, but having it allows you to mock it for testing
 
why? your still passing a concrete instance into it
 
during testing, you typically pass a mocked instance instead
so the instance isn't the same one that you use in production (frequently)
more obvious if you think ISomethingHittingTheWeb or ISomethingDBRelated instead of IEngine ;)
you don't want your tests to go out and mess with data in the DB
or take forever and be unreliable because they're waiting on a web service
 
ok so more web/DB related stuff..
 
7:07 PM
well, that same concept extends elsewhere, too
 
I don't know I'm not seeing it in my desktop app
 
though, tbh, I'm not the best person to be answering this :)
well, even your engine example - if you test with the engine, your test is no longer isolated to the car portions - it's also reliant on changes to the engine itself
 
I mean I 'can' do it...I just don't see the point of making an interface for a class that I know there will only be one of
 
if you're not going to mock it for testing, etc, then there isn't a reason
but that's the reason it's done, normally
 
ooooooohhhhhh
 
7:08 PM
(and that's a valid reason, even in desktop apps :) )
 
I think I get it now....because in the unit test I can create my own instance of the class based off that interface without actually reaching into the library or whatever 'm testing to instantiate that particular object
is that right?
 
Right. You can have some class implement the interface without relying on the library (and all of whatever it's actual functionality is)
For a car, this would be putting in something that can't move the car, but makes sure everything is hooked up right to power the electronics and hydraulics, so you can verify that steering and brakes work without wasting gas and before you hit the road. (Though that's a pretty strained analogy)
 
I get it, thanks :)
I haven't done this in my unit testing....I usually just instantiated the actual objects I need.
 
7:30 PM
Yeah, Imagine not having to actually spin up that DB connection
 
8:02 PM
value is obvious for anything IO related - db, web, etc
but it exists for other stuff, too
just because it decouples your test from the "other thing"
so a bug introduced in engine won't break your "car" tests
 
You (almost) always want to use mocks
 
That's a great point Reed.
 
so you can assert call counts; ensure returned data, etc.
 
8:28 PM
if you are testing the gas pedal you probably dont want the engine actually driving your car away :)
 
where is a good place to initialize and place viewmodel classes so they are accessible to other objects, like mainWindow, commands etc
I used to make static instances of them in the App.cs so they are global to everything
 
there is no one way that is always correct
it depends on your app
 
aw
 
singletons, DI, statics, passing references can all be valid
a lot of the time the structure of the data of your app will determine which approach is best
 
I can do a singleton, but I read that was bad, I can do static but I was told not to
 
8:33 PM
i would avoid statics if possible
some people have issues with singletons, i dont as long as they make sense
for example your main window vm can easily be a singleton
for me that usually gives me a starting point and i work from there
 
maybe what I'm doing doesn't belong in the viewmodel? I'm writing an open command to show a file dialog.....inside the execute I need to send the file path to a class for processing
 
sounds like a vm method to me
 
I guess
 
i think your question should be more like "which vm do i place this method into"
not "should this be in a vm"
WPF becomes easier to manage the more you break your app down into pieces, and give each piece its own vm
 
I'm trying, but I don't have a good example to model after
 
8:37 PM
i imagine your file dialog is part of some other UI component. that component should probably get its own VM
 
there seems to be a lack of good architecture articles online
 
does that component sit in your main window? then the vm should probably live in your main window vm
 
not really...the file dialog is really just the Win32 dialog...not part of anything really
 
but it is initiated from a button click ?
 
well I understand each window, and UI component needs its own separate vm
the open is instantiated from a menuitem in the main window
I have the menu item bound to a command
 
8:39 PM
if the menu item lives in the main window, put the command in the main window vm
 
I wrote my own command by implementing ICommand interface
then I put all my commands in a special view model class for commands
 
i wouldnt do that
 
    public class Commands_VM
    {
        public ICommand highlightTextCommand { get; set; }
        public ICommand exitCommand { get; set; }
        public ICommand openCommand { get; set; }

        public Commands_VM()
        {
            this.highlightTextCommand = new HighlightTextCommand();
            this.exitCommand = new ExitCommand();
            this.openCommand = new OpenCommand();

        }
    }
 
the commands should live in the view model they are associated with
if you had an Edit User page, and there was a button to delete the user, i would want a DeleteUser command inside the EditUserPageVm
 
I just wanted to keep it seprate because then this gets more complicated
<Controls:MetroWindow.Resources>
    <viewModel:Commands_VM x:Key="commands"></viewModel:Commands_VM>
</Controls:MetroWindow.Resources>
 
8:41 PM
if you have one global command vm, you'll have to instantiate it in all your vms even though they only use a fraction of it
plus i would imagine you lose access to the properties of the vm you might want to manipulate
 
well I would make different command_vm's to go with different UI compnents...
 
can't say i recommend that pattern but i've never ran into it before
sure, i could see that i guess? dont really see the benefit
 
I mean I know what your saying and I started out that way combining the commands with the other properties in the viewmodel....But I didn't like it
 
if i have a page/component, it probably has its own vm, and if that page/component needs commands, they would live in there
say you have a command to change a users name
that is a property of the UserVm
you need access to that instance of it to change the property
putting the command in that vm makes that a no-brainer
 
true
maybe I was breaking it apart too much
 
8:45 PM
commands generally should only expose { get; }
minor thing but it helps to think in wpf terms
if you set a command, your UI would still be bound to the original instance
 
so you mean this

public ICommand exitCommand { get; set; }
should really be
public ICommand exitCommand { get;}
or maybe

public ICommand exitCommand { get; private set; }
 
just get
if you assign them in constructor you dont need a set
private or otherwise
 
ok
 
same goes for ObservableCollections
 
so commands mixed in with properties in the VM, yay or nay?
 
9:08 PM
Generally, that's the pattern I use - each VM has the commands for manipulating itself, whatever that means - saving, loading, editing, whatever.
 
yes; mixing is fine
also; I smite thee for use of static
 
I found another way...to sort of seprate the commands away from the regular viewmodel
    public class MainViewModel : BindableBase
    {

        public ICommand exitCommand { get; set; }
        public ICommand analyzeCommand { get; set; }
        public ICommand saveCommand { get; set; }
        public ICommand openCommand { get; set; }
        private CommandMethods _commandMethods;

        public MainViewModel()
        {
            _commandMethods = new CommandMethods();

            this.exitCommand = new DelegatingCommand(_commandMethods.exitCommand_execute, _commandMethods.exitCommand_canExecute);
 
If CommandMethods is a model that's ok
but otherwise seems excessive
 
its a class that defined the execute and canexecture methods of all the commands
 
I get that
over-abstraction if you ask me
 
9:12 PM
yeah I suppose....I mean it does help a little to isolate the code...a bit easier to find
 
If you are going to bother with that just make each command its own class
how big is your VM?
 
all the commands are in one location
 
they are all in the same location regardless
 
it has 26 properties in it
 
Unless you are using that object for multiple VMs in which case no, that's bad
 
9:13 PM
excluding the commands
 
ok; so why is it hard to find your method exactly?
that's what; 100 lines you could #region to collapse
 
its not...I was just over architecting :)
 

« first day (2026 days earlier)      last day (2123 days later) »