Hi there
everytime i design an application at the first of the project i feel well and writting code and solving the problems very easy. but after i completed the project. i start to debug my application. its make me angry to do it. now in my collage project i faced with this problem again. i dont know how to start to writing an application. what should i have to learn at first. UML, RUB, Design Pattern, 3 tier Application, N tier Application... .
I am searching too much but im still knowing nothing. i couldnt relating the above Technic togeather. assum that i want to write an application for manageing an high school. that it has a lot of major. :D
23 replies to this topic
#1
Posted 01 July 2011 - 12:34 AM
|
|
|
#2
Posted 01 July 2011 - 04:25 AM
It sounds like you have a different problem that isn't a design issue, it's a development issue. If you look into Agile methods (or Extreme programming, or Test-Driven Development, or any of a number of other buzz terms around the concept), you'll start running into concepts about writing a tester for every function you create. The idea is that you design a function with well-defined inputs/outputs, then you write test cases to exercise that design, then you write the actual function.
I've learned the hard way that just because I think I've covered everything doesn't mean I have. Writing very small pieces of functionality and then testing them heavily before moving on works much better for me than writing a lot of code and then trying to figure out why the entire mess isn't working right.
I've learned the hard way that just because I think I've covered everything doesn't mean I have. Writing very small pieces of functionality and then testing them heavily before moving on works much better for me than writing a lot of code and then trying to figure out why the entire mess isn't working right.
#3
Posted 01 July 2011 - 07:45 AM
See my friend, in different project you have to be a designer, Analyzer, Developer, ...
. so you have to cover all the information you need to deploy your software.
this is one of my program:
School_Project1.rar - 4shared.com - online file sharing and storage - download
download it and tell me your opinion.
I dont know exactly what documentation means in programming. for example i program a project and gave it to the customer then after afew days your customer says that i want the program has this function...
i need something like documentation for my project.
. so you have to cover all the information you need to deploy your software.
this is one of my program:
School_Project1.rar - 4shared.com - online file sharing and storage - download
download it and tell me your opinion.
I dont know exactly what documentation means in programming. for example i program a project and gave it to the customer then after afew days your customer says that i want the program has this function...
i need something like documentation for my project.
#4
Posted 01 July 2011 - 10:25 AM
Documentation is a completely separate issue. You can do that in anything from Word to advanced tools. Further, there are at least four different versions of documentation possible: there is End-User documentation (describing HOW to use the software), Functional specifications (that describe what various elements of the software do), Technical specifications (that described how the software does what it does), and comments within code (that describes details of algorithms within code, etc).
Your planning documents are Functional specs and/or Technical specs. However, I can describe in detail what happens when you press a button, and fail to communicate why a user would want to press it.
I can browser through your code tonight.
Your planning documents are Functional specs and/or Technical specs. However, I can describe in detail what happens when you press a button, and fail to communicate why a user would want to press it.
I can browser through your code tonight.
#5
Posted 01 July 2011 - 11:54 PM
Thank you my friend I am waiting for your Result
#6
Posted 02 July 2011 - 06:00 AM
I've glanced over it briefly (I'm new to C# myself, and don't have SQL Server set up on my VM). Overall, it doesn't look bad.
On a style note, in Class.cs, you may want to consider having textBox1 and textBox2 send their KeyDown events directly to Handel_KeyDown, instead of having the extra layer of indirection. On the other hand, you might not if you anticipate having their key-handling routines diverge in the future. In either case, having a common function instead of code duplication is definitely a good idea.
On the issue of code presentation, I'd keep a close eye on indentation and formating. Course.Filter() has a line that's less indented than the function name, which looks fairly strange. When you go back to maintain the code, even a week later, you're apt to wonder what you were thinking and why it's a special line, even if there's nothing special about it.
I'd say you have made good use of regions to help identify categories of functions.
One other thing to consider: your Handel_KeyDown function is somewhat long (I know, it's only 52 lines), but you may want to consider moving some of the logic to separate functions. Also, using an else if structure will be slightly more efficient.
I realize that it seems kind of silly to do this to a function that's only 52 lines, but my experience has been that this things generally grow. Every time you add a form element, you also have to locate every place you clear your form and update those functions. I've worked on a project where the "Finish" function has grown to be over 3000 lines of code as more features were added. Trying to keep track of what's going on becomes nightmarish, but it's easy to have happen.
A simple way to tell if you need to make this type of change: how many things does Handel_Keydown do? Currently, it does 5 things: it checks for for the 4 special keys, and if one of those special keys is pressed, it does the logic for them (4 pieces of logic plus the check itself). What happens if you add special logic for the tab key? What about right/left arrows? Handel_Keydown will start acquiring more responsibilities. Instead, have it check for the special key press, and hand off the responsibility to the appropriate function when that logic is required. Then Handel_Keydown does only 1 thing: check for special keys and hand off logic.
On a style note, in Class.cs, you may want to consider having textBox1 and textBox2 send their KeyDown events directly to Handel_KeyDown, instead of having the extra layer of indirection. On the other hand, you might not if you anticipate having their key-handling routines diverge in the future. In either case, having a common function instead of code duplication is definitely a good idea.
On the issue of code presentation, I'd keep a close eye on indentation and formating. Course.Filter() has a line that's less indented than the function name, which looks fairly strange. When you go back to maintain the code, even a week later, you're apt to wonder what you were thinking and why it's a special line, even if there's nothing special about it.
I'd say you have made good use of regions to help identify categories of functions.
One other thing to consider: your Handel_KeyDown function is somewhat long (I know, it's only 52 lines), but you may want to consider moving some of the logic to separate functions. Also, using an else if structure will be slightly more efficient.
void Handel_Keydown(object sender, KeyEventArgs keydown)
{
if (keydown.KeyCode == Keys.Up)
{
MoveUp();
}
else if (keydown.KeyCode == Keys.Down)
{
MoveDown();
}
else if (keydown.KeyCode == Keys.Enter)
{
Commit();
}
else if (keydown.KeyCode == Keys.Escapte)
{
ClearForm();
}
Class1.Change_Lan();
}
The big thing this lets you do, aside from start looking at options for code reuse, is separate the decision of what to do (the if block) from the implementation of how to do it (the called functions). It also implicitly increases the level of self-documentation of code. Instead of looking at a bunch of .Text fields being set to empty strings, you have a call to a function, ClearForm(), that is clearing the text fields.I realize that it seems kind of silly to do this to a function that's only 52 lines, but my experience has been that this things generally grow. Every time you add a form element, you also have to locate every place you clear your form and update those functions. I've worked on a project where the "Finish" function has grown to be over 3000 lines of code as more features were added. Trying to keep track of what's going on becomes nightmarish, but it's easy to have happen.
A simple way to tell if you need to make this type of change: how many things does Handel_Keydown do? Currently, it does 5 things: it checks for for the 4 special keys, and if one of those special keys is pressed, it does the logic for them (4 pieces of logic plus the check itself). What happens if you add special logic for the tab key? What about right/left arrows? Handel_Keydown will start acquiring more responsibilities. Instead, have it check for the special key press, and hand off the responsibility to the appropriate function when that logic is required. Then Handel_Keydown does only 1 thing: check for special keys and hand off logic.
#7
Posted 02 July 2011 - 06:56 AM
WingedPanther said:
....
I've learned the hard way that just because I think I've covered everything doesn't mean I have. Writing very small pieces of functionality and then testing them heavily before moving on works much better for me than writing a lot of code and then trying to figure out why the entire mess isn't working right.
I've learned the hard way that just because I think I've covered everything doesn't mean I have. Writing very small pieces of functionality and then testing them heavily before moving on works much better for me than writing a lot of code and then trying to figure out why the entire mess isn't working right.
And in case you wrote a lot of code, which has some issue that appears for e.g. only after running the software for say a few hours - days etc. or only after you throw x amount of traffic to it, it is far less likely to be found and really hard to debug. So there is a huge weight age in the above argument. Pay it enough attention.
Today is the first day of the rest of my life
#8
Posted 02 July 2011 - 12:44 PM
Thanks a million to see my code and give me the idea. i haven't been into programmer group. but i heard that when a group want to do a project they have somebody named Analyzer that analyze the project and then he's making a notebook. Then he give it to the Supervisor. the supervisor break it into small project and give it to the other programmer Next gather the all code together and making a master project and test it.
Finally making a setup for software. the project is finish.
I want to have a large scale of my project. like what the UML do. In fact i want to write 3 , 4, n tier application. where to start. I mean what should i have to know to writing code in n tier application. should i need to know the Special thing like UML, RUB,Design pattern?
Finally could you tell me what's different between Design Pattern and N tier Application?
Finally making a setup for software. the project is finish.
I want to have a large scale of my project. like what the UML do. In fact i want to write 3 , 4, n tier application. where to start. I mean what should i have to know to writing code in n tier application. should i need to know the Special thing like UML, RUB,Design pattern?
Finally could you tell me what's different between Design Pattern and N tier Application?
#9
Posted 02 July 2011 - 12:59 PM
Slow down!
When you write an N-tier application, you create the number of tiers that are appropriate for what you're doing. You don't do it for the sake of having 7 tiers, or 25 tiers, or whatever. The MVC Design Pattern is an example of a 2 or 3 tier application, depending on how it's implemented. Ultimately, Design Patterns are simply ways of organizing classes in a robust and reusable way. How you'll do that will depend on language features, the goals of your product, and design decisions.
UML is just a way to document your application design and communicate it with other people. It's not all that complicated to start using. Depending on who you talk to, UML is either an essential tool or a sign of poor design strategies. Think of it as the OOP equivalent of flowcharts.
Odds are you will have classes that explain many of these concepts. Getting your code structured well and becoming comfortable with a few languages is enough for now.
When you write an N-tier application, you create the number of tiers that are appropriate for what you're doing. You don't do it for the sake of having 7 tiers, or 25 tiers, or whatever. The MVC Design Pattern is an example of a 2 or 3 tier application, depending on how it's implemented. Ultimately, Design Patterns are simply ways of organizing classes in a robust and reusable way. How you'll do that will depend on language features, the goals of your product, and design decisions.
UML is just a way to document your application design and communicate it with other people. It's not all that complicated to start using. Depending on who you talk to, UML is either an essential tool or a sign of poor design strategies. Think of it as the OOP equivalent of flowcharts.
Odds are you will have classes that explain many of these concepts. Getting your code structured well and becoming comfortable with a few languages is enough for now.
#10
Posted 03 July 2011 - 02:00 AM
Thank you my friend for your advise. your right its better to work on code structure.
Could you do me a favor and making a Setup for my application. because i'm worked to learn how to deploy the software. But when i making the setup i got the error that is about database log in i searched too much but nobody answer me. for this I shared my setup project. this is a setup of that project that you downloaded and told me its problems.Setup2.rar - 4shared.com - online file sharing and storage - download
you will help me too much if you build once for me that don't have any error. Its hard to deploy this software because i used a lot of component like Stimulsoft Report and Cock WPF and Skin Engin and ...
.:love:
Could you do me a favor and making a Setup for my application. because i'm worked to learn how to deploy the software. But when i making the setup i got the error that is about database log in i searched too much but nobody answer me. for this I shared my setup project. this is a setup of that project that you downloaded and told me its problems.Setup2.rar - 4shared.com - online file sharing and storage - download
you will help me too much if you build once for me that don't have any error. Its hard to deploy this software because i used a lot of component like Stimulsoft Report and Cock WPF and Skin Engin and ...
.:love:
#11
Posted 03 July 2011 - 05:37 AM
It looks like you've configured a static link to the database, but i simply don't have it. Are you using static linking or dynamic linking?
#12
Posted 03 July 2011 - 05:53 AM
Sorry I didn't get what's your meaning? what is Static Or dynamic Link? did you download my setup App?
Do you means the database ConnectionString?
Do you means the database ConnectionString?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









