15,891,431 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by SoftwareMonkeys (Top 11 by date)
SoftwareMonkeys
3-Feb-12 1:30am
View
Deleted
Ah that could be a useful little function. Thanks for posting. I would consider modifying it slightly so I'll post the alternative to get feedback.
SoftwareMonkeys
30-Jan-12 16:22pm
View
Deleted
How so?
I just activate debug logging, then run one of the automated tests, then go through the logs to track down the problem.
This approach makes the application more easily unit testable, which IMO makes it far easier to test and debug than any project I worked on without this much automated testing.
SoftwareMonkeys
30-Jan-12 16:18pm
View
Deleted
The performance hit of the code that gets executed (which is just an if statement) should be insignificant compared to the other performance hot spots like accessing databases and files. The approach is geared to allow for unit testing and I'm yet to see a unit testable alternative that doesn't require you to recompile and re-test the application in debug mode (which would make be a pain).
Can someone please post a unit testable alternative that they consider "good design"?
So far I'm happy to sacrifice an unnoticeable amount of performance hit in return for an application that is easy to unit test.
And the logging system that uses this ModeDetector gets unit tested every time I run the automated tests even though I run them in Release mode, so having it unit testable helps to ensure nothing gets broken. I'm not going to sacrifice that unit testability to try and gain a minuscule performance benefit but if someone can show me a better performance alternative I'll be happy to see it.
Having said that. I'm sure there are plenty of cases where you DON'T want to use this method because you really do want to avoid having the code compile into the dll. Use the right tool for the job.
SoftwareMonkeys
30-Jan-12 5:10am
View
Deleted
Can you please explain why? And explain the alternatives for achieving the same results? In particular the ability to unit test without having to recompile in debug mode.
SoftwareMonkeys
30-Jan-12 4:34am
View
Deleted
@Pablo - True but doing it directly like that makes it tricky to unit test.
SoftwareMonkeys
20-Jan-12 4:18am
View
Deleted
Good tip. Now I'm creating a RavenDB provider for the data management system I am using that approach. I wasn't too familiar with linq back when I wrote the original approach. Actually I may have even written it originally before linq was available :p
SoftwareMonkeys
20-Jan-12 4:13am
View
Deleted
Hmmm good question. I'll have to look into that.
SoftwareMonkeys
10-Jan-12 5:52am
View
Deleted
My mistake I figured it was all fairly self explanatory so I skimped on the details.
The goal is to be able to hold all the paging related info on a single object and, while it's at it, provide a helper function for you to use if you want to.
Before this I was passing multiple paging properties into my data layer (index, size) and then had to figure out how to return the absolute total as required by the ASP.NET grid controls.
Putting the paging info into an object prevents the order of the parameters from being mixed up and provides a useful way to return the absolute total back to the UI layer from the data layer.
I use db4o and I can loop through the IObjectSet and load only items those within the current page, rather than loading all of them. This saves the performance hit of loading all items, even the ones not on the desired page.
As with most for loops what I have to work with is the position in the list/loop, which is the integer passed to the IsInPage function. The return value tells you when to load the record and include it in the output.
The PagingLocation class and this approach can be used with any kind of record set, or from any collection of objects. Just look at the GetPage function to see how that's done. Swap the IObjectSet for an array, or a collection, or something.
If you can suggest ways to simplify the paging in the SiteStarter project I'm all ears.
I totally agree there are plenty of other ways to store data, access data, etc. and depending on how you do it you may do paging in a way that's completely incompatible with this. There's always different ways to do things. But there are plenty of cases when the PagingLocation can make it simple to extract just a page of items out of a larger list of items.
SoftwareMonkeys
4-Jan-12 2:47am
View
Deleted
Anyone got a link to an example of how to do it in jquery? I'm curious to compare.
SoftwareMonkeys
4-Jan-12 2:45am
View
Deleted
Do you mean the build order? I build contracts first, then entities, then business, then others that use them such as web/presentation tier.
Does that answer your question?
SoftwareMonkeys
3-Jan-12 17:33pm
View
Deleted
Thanks for the tip. Now I have this solution it's just a matter of copy and paste into any project I want to use it so no typing required really. But I should look into jquery anyway just to see the difference in the approach and the amount of code.
Cheers
Show More