Programming User Interface(UI), best solutions in c#? [closed] - c#

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I was wondering if there are best well-known methods, architectures, 3rd party libraries, etc to help developers program UI?
I am thinking about something which would help in the following areas:
When looking into the code written by someone else,
I would like to know instantly, what UI serves, what are the states of the UI,
From which does the state depend on?
Something which could clearly separate logic for each state
State for me would be the state of all components when:
user run winform
user makes a decision and executes some action, The result of his action
is another state of UI Form
user leaves the form
etc.
For me as a developer, programming in mvc, which is a good, because allow to seperate logic(view, manipulating and data access) it is still confusing when I see events doing something, which to be honest I have to re-think in which situation that may occur, what and when it is doing...
Do you know what I mean?
Any suggestions greatly appreciated..

In WinForms this is hard, since the GUI and code behind is very tightly coupled.
I would recommend using WPF instead, and a MVVM (Model-View-ViewModel) framework as Caliburn.Micro to better separate the GUI from the logic. It's a much better model for development than WinForms ever was.

I was wondering if there are best well-known methods, architectures, 3rd party libraries, etc to
help developers program UI?
Why do you wonder? You have a 100% chance that, because there are more than one of them, the answer will never be no.
When looking into the code written by someone else, I would like to know instantly, what UI
serves, what are the states of the UI, From which does the state depend on?
Delusional. This will never happen even when standardizing the code base unless the cases are trivial.
At the end, regardless of how many patterns you follow, a complex UI is a complex UI and you won't get this down to the level of "how many types of burgers are at McDonald's". If you don't want to think, then work at McDonald's.
Patterns may help, but forms vary widely and, outside of simple showcase patterns, etc., they won't get you "instant, don't think" access to other people's code.

Related

Correct .NET way to implement a single instance application [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have seen at least three distinct methods on StackOverflow for achieving this.
Using a MUTEX: Accepted answer to this SO question
Using the Microsoft.VisualBasic library's WindowsFormsApplicationBase: Second highest voted answer to this SO question
Using Process.GetProcessNames to check if your application is running: Method here was posted as an answer to this SO question
I'm sure there are more ways to do this as well.
I'm simply wondering if one of these is preferred and what the consequences might be if I pick the "wrong" one.
When in doubt, always prefer an implementation that's included in the .NET framework. You can have high expectations that such an implementation is tested by hundreds of thousands of programmers, has been carefully reviewed for security and usability and will be maintained for years to come.
The mutex approach is an easy one to get going. It however suffers from a pretty severe security problem. A denial of service attack is very simple to get going, you cannot keep the name of your mutex a secret and anybody can trivially create a mutex with the same name and prevent your program from ever starting up.
The process name approach is deeply flawed for the same reason. There is no guarantee that a process name is unique. Not just easy to exploit but easily triggered by accident.
WindowsFormsApplicationBase has an image problem in the eyes of C# programmers. They choke at the namespace name and assume that their program will somehow be infected with vb-isms. That's nonsense, it is just a plain .NET class that's useable in any language.
Why nobody mentioned ticking this checkbox?
It's really a matter of taste, but I favor the Mutex approach, simply due to it not requiring a dependency on the VisualBasic libaries, and using Process.GetProcessNames is a non-ideal solution (as mentioned, process names aren't always going to map to what you think they might)

when choosing a project methodology such as xp, scrum, crystal which questions should be taken into consideration [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Basically I have to choose a project methodology.
The components are not big (we develop components mainly for SAP connecting), however the team is rather big , dislocated and and very unorganized.
Besides how big is the team
which other questions should be taken into consideration?
Thank you
I've made very good experiences with answering these questions first:
How does the team prioritize work?
(I would recommend putting todos into a sequence building a backlog)
How does the team track what needs to be done?
(I would recommend breaking things down step-by-step into User Stories and track them using a tool like PivotalTracker)
How can you make sure the team is self-organizing?
(Let the team pull work from the backlog, run daily status meetings and a retrospective every couple of weeks)
How can you optimize how fast features get delivered in optimal quality? (This way of thinking should replace the idea of maximizing capacity utilization)
How can you make the work visible? (Visibility builds trust and momentum - you can start collecting metrics and putting up a screen showing all kinds of graphs)
One very useful question to assist in choosing any sort of method is "What projects can this not help me with?" It can be very difficult to obtain an answer; the usual way that supporters of a particular method respond is "of course method X can help you with any project." Thus they are saying either that all projects are the same, which is obviously not the case; or that they don't know what are the limitations of their method, and so will not be able to recognise when their method is not appropriate.
You say your teams are fairly unorganised. One of the best ways of introducing any new method is to provide tools - even very basic tools - that make it easier to follow the standards than not. An example of this was trying to improve the quality of development reports in a very large organisation - we provided a number of word processing templates, that made it easier to write a report using the templates (and hence the standards) than to write the report from scratch.
Personal note on my choice of language: I have worked with software development methods for many years, and to me "methodology" is the study and comparison of different methods. A particular way of, for example, managing a project, is a method, not a methodology.
I guess this really depends on a number of factors, for instance some contracts require you to use PRINCE project management which is rather complex.
If you dont have any external factors regarding the methodology you choose I would just do a bit of research and see which you think fits your team best.
I havent had chance to use Agile yet although I took a course on it and I liked what I heard, it seemed fairly straightforward which is a bonus.
One thing to remember though is you dont have to stick to one methodology if you find something isnt working for you then make changes.
Questions I would consider though would be the length of the project, Size of the team, Are the team each working on individual parts of the project or are there multiple people working on the same area, Time it will take to implement a methodology, Any costs involved?, Any training involved?

Exercise suggestions to help learn multi threading in C# [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to get a good grasp of multi-threading in C#. I've read some articles like Joseph Albahari's tutorials that explain the concepts, but as you know, no matter how much you read, most of it becomes rubbish if you don't practice. I need something that has instructive and pragmatic code examples related to real life practices, not some examples that print some lines. Do you have any suggestions?
guys guys I think I found a good site: planet-source-code.com. Searching in .Net codes with "thread" keyword seems to return some good examples, like
multi threaded folder synchronization
multi threaded TCP server
background file downloader
async. socket
P2P file sharing
simple POP3 console mail checker and lots of others!
yay!
Some kind of random number-crunching is a good test for this. I taught myself threading by writing a prime number finder, then breaking my "search" numbers into blocks and using a thread to work through each one.
This let me set some variables on block size, number of threads to use, wait time between firing threads etc. to test how each of these affects performance.
If you're doing any winforms or wpf development, you'll quickly run across issues when you try to do "stuff" in the UI thread.
Let's say that you need to read and parse the contents of a large (2GB) XML file. If the work were performed in the UI thread, the interface would hang until the work had been completed. Conversely, if you were to do the work correctly in a worker thread, then you could keep the UI responsive via messaging and let the user know what you're currently doing (status bar (ugh,) or display in text what you're doing "Reading XML.", etc.)
A good simple example would be to make a sample application and have it fire off a BackgroundWorker to handle some arbitrary work in the background (it could even be Thread.Sleep(10000), or something trivial like that.)
I'd say this is one of the many good starting points out there on the subject.
http://msdn.microsoft.com/en-us/library/cc221403%28VS.95%29.aspx
This site has a few sample applications that I think would be decent practice applications to implement. However, it seems like the links to the source code are broken. Nonetheless, I believe the applications presented represent very practical examples. A few include:
Desktop Search
Download Manager
FTP Client
File Compression
Multiple RSS Feeds

What are some best practices for making sure your .NET code will scale well? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Last week I interviewed for a position at a TripleA MMORPG game company here in NE. I didn't get the job but one of the areas that came up during the interview was the about the scalability of the code that you write and how it should be considered early on in the design of your architecture and classes.
Sadly to say I've never thought very much about the scalability of the .NET code that I've written (I work with single user desktop and mobile applications and our major concerns are usually with device memory and rates of data transmission). I'm interested in learning more about writing code that scales up well so it can handle a wide range of remote users in a client server environment, specifically MMORPGs.
Are there any books, web sites, best practices, etc. that could get me started researching this topic?
Here are some places to start:
http://highscalability.com/blog/2010/2/8/how-farmville-scales-to-harvest-75-million-players-a-month.html
http://www.cs.cornell.edu/people/~wmwhite/papers/2009-ICDE-Virtual-Worlds.pdf
In particular, http://highscalability.com is full or articles about huge websites that scale and how they do it (Digg, flickr, facebook, YouTube, ...)
Just one point I'd like to highlight here. Just cache your reads. Work out a proper caching policy where you determine which objects can be cached and for what periods. Having a distributed caching farm will take load off your DB servers, which will greatly benefit performance.
Even just caching some pieces of data for a few seconds - in a very high load multi-user scenario - will provide you with substantial benefit.
If you are looking for physical validation, what I usually find that helps is doing some prototyping. This gives you a good idea usually of any unforeseen problems that might be in your design and just how easy it is to add onto it. I would try to apply any design patterns possible to allow future scalability. Elements of Reusable Object-Oriented Software is a great reference for that. Here are some good examples that show before and after code using design patterns. This can help you visualize how design patterns could make your code more scalable as well. Here is an SO post about specific design patterns for software scalability.

Starting Intermediate Level C# Class, with heavy focus on UML... Your best tips or experinced advice? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm starting my 2nd class in C# programming through Kaplan online school. I have some limited interaction with the professor and the class online, but nothing like in an actual school. I'm about to go through "Modern Software Development Using C#.NET" by Richard Wiener. It seems the book as a extremely heavy focus on UML (which I don't even really know what that is right now!)
You experinced Csharpers.... any tips to keep in mind as I go through this to keep in perspective how the modern software engineer works outside the classroom?
Any perspectives to share as I start understanding UML and intermediate C# programming?
Some companies will use UML everywhere. Some use it nowhere. I'm not a big fan myself - I prefer ad-hoc diagrams and plenty of other communication (notes on the diagram, actual talking etc).
The good thing about an ad-hoc approach is that you can leave it as vague as you like or make it really detailed. The bad thing about it is you can't generate any code from it - but I've never really liked generating code from UML. (Others swear by it, mind.)
You certainly don't need to know UML to learn C#.
UML would come very close to the end of the list of things that gave me insight into the complex world of programming. I find it very distracting when trying to design something, and too time consuming for real system descriptions. I have always thought it is important and tried to start my project with UML diagram, but it wasn't ever worth it.
The bigger the projects you are working in the more you need a language to speak with, known by all members of the project team - a common language like UML! But you need not to start learning C# with UML.

Categories