Separation of Concearns
-
So this week I was tasked with updating an old asp.net webforms application. It was a basic change to a page that lets a user search a db and make updates to the line items returned in the grid. I just needed to add a few drop down lists to search on and couple more columns to be displayed / modified in the grid. As it turns out all of the code was in the code behind of the search.aspx page and it was great! When I opened the class each section of code for page was in its own region with an explanation of what it did. Anyway, I made all the changes and had it done in about two hours and my user was thrilled. Currently I have been learning MVVM and separating the concerns like a good soldier. Now, I'm wondering if in the future I am asked to make some changes to a MVVM application, will it be so easy when all the code is all over the place because everything has been seperated? My simple changes that took two hours would have required me to change the model, view, viewmodel, data layer, validation and commands. Just wondering, is SOC really any value to me a developer who works on small projects by himself, rather than on large projects in a team...
I didn't get any requirements for the signature
ToddHileHoffer wrote:
Just wondering, is SOC really any value to me a developer who works on small projects by himself, rather than on large projects in a team...
Well, you were blessed by having well segmented code that was documented. In effect, the previous developer had done SOC, to the degree necessary for the task. I imagine how, if the code was not so nicely organized and documented, you would be writing a post about how nice MVVM would have been, as it would have at least provided some clarity as to where each concern of the code was! So, I don't really think it would have taken you that much longer if the code had been written in a more formal MVVM approach. Marc
-
I couldn't care less about your problems. I have separate concerns of my own. ;P
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus!
Funny.
I didn't get any requirements for the signature
-
So this week I was tasked with updating an old asp.net webforms application. It was a basic change to a page that lets a user search a db and make updates to the line items returned in the grid. I just needed to add a few drop down lists to search on and couple more columns to be displayed / modified in the grid. As it turns out all of the code was in the code behind of the search.aspx page and it was great! When I opened the class each section of code for page was in its own region with an explanation of what it did. Anyway, I made all the changes and had it done in about two hours and my user was thrilled. Currently I have been learning MVVM and separating the concerns like a good soldier. Now, I'm wondering if in the future I am asked to make some changes to a MVVM application, will it be so easy when all the code is all over the place because everything has been seperated? My simple changes that took two hours would have required me to change the model, view, viewmodel, data layer, validation and commands. Just wondering, is SOC really any value to me a developer who works on small projects by himself, rather than on large projects in a team...
I didn't get any requirements for the signature
I view MVVM, and things of that ilk as merely guidelines. I've been kinda sorta doing it that way for years (object-oriented design kinda forces you to do it at least part of the way. Strictly adhering to techniques like that is IMHO a bad idea, but using it where it's practcal to the point that it doesn't hinder devlopment is okay.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997 -
The problem in comparison is that when a well written asp.net page is compared to a MVVM page there isn't a lot of improvement. The solution is that most ASP.NET pages are not well-written. MVVM makes it slightly harder to right total crap without violating MVVM (in which case it is no longer MVVM)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Ennis Ray Lynch, Jr. wrote:
The solution is that most ASP.NET pages are not well-written. MVVM makes it slightly harder to right total crap without violating MVVM (in which case it is no longer MVVM)
Well, now that is a good point.
I didn't get any requirements for the signature
-
ToddHileHoffer wrote:
Just wondering, is SOC really any value to me a developer who works on small projects by himself, rather than on large projects in a team...
Well, you were blessed by having well segmented code that was documented. In effect, the previous developer had done SOC, to the degree necessary for the task. I imagine how, if the code was not so nicely organized and documented, you would be writing a post about how nice MVVM would have been, as it would have at least provided some clarity as to where each concern of the code was! So, I don't really think it would have taken you that much longer if the code had been written in a more formal MVVM approach. Marc
Marc Clifton wrote:
Well, you were blessed by having well segmented code that was documented. In effect, the previous developer had done SOC, to the degree necessary for the task. I imagine how, if the code was not so nicely organized and documented, you would be writing a post about how nice MVVM would have been, as it would have at least provided some clarity as to where each concern of the code was!
I agree. Messy ASP.Net is awful and messy MVVM is not very likely since by nature the code is clean if you adhere to the approach.
I didn't get any requirements for the signature
-
I view MVVM, and things of that ilk as merely guidelines. I've been kinda sorta doing it that way for years (object-oriented design kinda forces you to do it at least part of the way. Strictly adhering to techniques like that is IMHO a bad idea, but using it where it's practcal to the point that it doesn't hinder devlopment is okay.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997John Simmons / outlaw programmer wrote:
I view MVVM, and things of that ilk as merely guidelines. I've been kinda sorta doing it that way for years (object-oriented design kinda forces you to do it at least part of the way. Strictly adhering to techniques like that is IMHO a bad idea, but using it where it's practcal to the point that it doesn't hinder devlopment is okay.
I agree.
I didn't get any requirements for the signature
-
I view MVVM, and things of that ilk as merely guidelines. I've been kinda sorta doing it that way for years (object-oriented design kinda forces you to do it at least part of the way. Strictly adhering to techniques like that is IMHO a bad idea, but using it where it's practcal to the point that it doesn't hinder devlopment is okay.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997Blindly following rules without knowing why is called cargo cult programming :)
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
-
So this week I was tasked with updating an old asp.net webforms application. It was a basic change to a page that lets a user search a db and make updates to the line items returned in the grid. I just needed to add a few drop down lists to search on and couple more columns to be displayed / modified in the grid. As it turns out all of the code was in the code behind of the search.aspx page and it was great! When I opened the class each section of code for page was in its own region with an explanation of what it did. Anyway, I made all the changes and had it done in about two hours and my user was thrilled. Currently I have been learning MVVM and separating the concerns like a good soldier. Now, I'm wondering if in the future I am asked to make some changes to a MVVM application, will it be so easy when all the code is all over the place because everything has been seperated? My simple changes that took two hours would have required me to change the model, view, viewmodel, data layer, validation and commands. Just wondering, is SOC really any value to me a developer who works on small projects by himself, rather than on large projects in a team...
I didn't get any requirements for the signature
-
I view MVVM, and things of that ilk as merely guidelines. I've been kinda sorta doing it that way for years (object-oriented design kinda forces you to do it at least part of the way. Strictly adhering to techniques like that is IMHO a bad idea, but using it where it's practcal to the point that it doesn't hinder devlopment is okay.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997Same here I can write an complex UI application (silverlight wpf) without the aid of MVVM.
-
ToddHileHoffer wrote:
old asp.net webforms application
It's amazing how old technologies become :)
Norm .net wrote:
It's amazing how old technologies become
I know! I still want to code asp.net webforms. I have released my first Silverlight 4 app and while the UI is quicker / suppierior, it is more work and more challenging to code.
I didn't get any requirements for the signature
-
I couldn't care less about your problems. I have separate concerns of my own. ;P
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus!
Bah...not quick enough. You stole my joke. :-P
-
Norm .net wrote:
It's amazing how old technologies become
I know! I still want to code asp.net webforms. I have released my first Silverlight 4 app and while the UI is quicker / suppierior, it is more work and more challenging to code.
I didn't get any requirements for the signature
Tell me, I completed a Silverlight 4 to access our company database via WCF. It was a thrill and challanging project from a coding pointing of view if not design.
-
Tell me, I completed a Silverlight 4 to access our company database via WCF. It was a thrill and challanging project from a coding pointing of view if not design.
Agreed. It was actually challenging and fun. I used MVVM as much as I could, but I ended up with a few lines of code in the .xaml code behind. I gave up on RIA Services... I couldn't get it deployed on my server and it was just too much magic behind the scenes for me to feel comfortable with it. I ended up writing a few of my own WCF Service methods to call some LINQ to SQL classes. It took a bit more code but at least I felt like I knew how to secure it properly and could debug it if there was a problem.
I didn't get any requirements for the signature
-
Agreed. It was actually challenging and fun. I used MVVM as much as I could, but I ended up with a few lines of code in the .xaml code behind. I gave up on RIA Services... I couldn't get it deployed on my server and it was just too much magic behind the scenes for me to feel comfortable with it. I ended up writing a few of my own WCF Service methods to call some LINQ to SQL classes. It took a bit more code but at least I felt like I knew how to secure it properly and could debug it if there was a problem.
I didn't get any requirements for the signature
I went for the self hosted service option for WCF and abstracted the interfaces in an assembly so I could easy implement to a Windows service once the code was debugged. I love this kind of stuff, cutting edge with no help from the internet just research and a lot of headaches :)
-
So this week I was tasked with updating an old asp.net webforms application. It was a basic change to a page that lets a user search a db and make updates to the line items returned in the grid. I just needed to add a few drop down lists to search on and couple more columns to be displayed / modified in the grid. As it turns out all of the code was in the code behind of the search.aspx page and it was great! When I opened the class each section of code for page was in its own region with an explanation of what it did. Anyway, I made all the changes and had it done in about two hours and my user was thrilled. Currently I have been learning MVVM and separating the concerns like a good soldier. Now, I'm wondering if in the future I am asked to make some changes to a MVVM application, will it be so easy when all the code is all over the place because everything has been seperated? My simple changes that took two hours would have required me to change the model, view, viewmodel, data layer, validation and commands. Just wondering, is SOC really any value to me a developer who works on small projects by himself, rather than on large projects in a team...
I didn't get any requirements for the signature
So, been earning a lot of Concs lately? :rolleyes: It's a tough topic indeed. My experience is similar to your doubts: 1. Separation of Concerns is important for making software maintainable. 2. Any attempt to formalize / enforce SoC for UI I have worked with creates a painful separation of functionality. I think this is specific to UI (at least, SoC is much easier for other topics), because a good UI is never passive enough to not need intricate deep coupling with the data model.
FILETIME to time_t
| FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy