|
Cee Ann wrote: What if StudentId is a foreign key to other table Then you could name it after the table it comes from, but it'd be better to come up with a descriptive name. Take "Employee" and "Person" as a fictive example with multiple references to itself;
Employee
Id
Name
FK_Manager
FK_DedicatedDriver
Person
Id
FK_Mother
FK_Father
As you can see, there's no mention of the fact in the fieldname to the table. That's because we can assume that people will recognize "mother" as a person, and "manager" as an employee. If it weren't, "FK_MotherPerson" might be needed.
Cee Ann wrote: Write 'StudentId' as fieldname in the other tables It's not an id, but a foreign key; it's something that points to the id of a record in a different table
That information is also obvious from the above naming; anything with a "FK" points to the Id-field of another table.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Got it,
Thanks a lot Eddy for everything.
|
|
|
|
|
You're welcome
|
|
|
|
|
Howdy,
I've a program that receives GPS through a serial port. The GPS class is child to the main form. When the user calls to open the port, the GPS class creates a thread and runs it, firing off a dataReceived event to the main form, the eventArgs class contains the location data and can be read by main form. This program runs constantly for up to a week at a time and interacts with user input the whole time. Usually, once or twice in a week, the program coughs up an error that can freeze the laptop, but at the very least requires a program restart. Because it happens so seldom, I cannot track this sneaky jerk down.
The enventArg data is stored writ to a listArray, which can be polled by the user to get locations at appropriate times for their task. When requested, the form posts a median location, empties the listArray and waits until the array is full again before the user can make their next request.
If the event fires at the same time as a user request, would this cause a problem? If so, how should I approach a fix?
Should I run the GPS class on a thread from the main form?
When a connection to the GPS is closed, should I kill the thread that the dataStream came in on? The stream is disposed of, but I never put closed parenthesis on the thread itself.
public void GpsOpen()
{
if (_gpsStatus.Equals(GpsStatus.Disconnected) || _gpsStatus.Equals(GpsStatus.NoGpsDetected))
{
_gpsStatus = GpsStatus.Connecting;
FireStatusChangedEvent(_gpsStatus);
ThreadStart ts = new ThreadStart(openGps);
gpsThread = new Thread(ts);
gpsThread.Start();
}
}
Suggestions are definitely appreciated!
TnM
If you're not sure you're in a cult, you are.
-- Stephen Colbert
|
|
|
|
|
Random thoughts.
If a thread throws an exception which isn't caught then the entire C# application terminates.
If you are not in fact creating one thread but are creating many then I would suspect the entire OS to fail.
Get a logging library and use it.
|
|
|
|
|
Does the event viewer show any information for that application hang? Well, it hardly ever useful, but might be better than no information at all.
A tight logging of all program calls is preferred.
By the way, are some kind of system events happening at that moment, e.g. hibernate, USB power off, ...
|
|
|
|
|
Unfortunately, this happens in the middle of the ocean and we're on the clock and have to keep going, so it's restart with some random cursing and get back at it. I brought my development machine out once and ran the program through the VS debugger, but the break was not helpful at all. Definitely not a power off or hibernate, that stuff is all turned off, it might be USB, but there are three other peripherals running through the application on their own threads and have never had a problem. Of course, the other three are also not constantly streaming.
Back at sea in a few weeks, I'll definitely check the event log...as you said, w/out much hope! Not sure I've ever gotten any help there.
Don't have much time to spend on this, thought I'd throw this out there and see what came back.
Thanks for your feedback,
TnM
If you're not sure you're in a cult, you are.
-- Stephen Colbert
|
|
|
|
|
I'm looking to build a desktop application which primarily is used for data entry. However, the application needs to have a few features that assist the user in selecting the appropriate data. If you have experience designing applications and have good models/ frameworks that you think would be best after reading this, please let me know. Here are many of the details.
The application idea is to create a UI with one page that has a host of listboxes, comboboxes, textboxes, and tabcontrols. The user will select the data from the combination of controls, then press CREATE RECORDS somewhere in the application. The data that is entered is either going to be entered directly into a database ( postgresql) or will begin in a datagrid and then after review of the records ( perhaps a separate tabitem) , will be placed into the database. The best part about this application would be the speed at which it is able to build records based on looping through the controls. Many of the records that are currently being created have data that is easily created by looping through controls such as listboxes as the data on the records is only different by a slight change in the value that can be shown in a listbox and selected with a multiselect.
I would like to separate the application into its parts as this seems to be common practice for application design and efficiency gains when coding. ( MVVM is just one I have read about recently.) I am going to be using NPGSQL as a data adapter and the rest is simply up for design grabs. If you have any recommendations, please let me know. I would really like to know if there is a better framework to design such an application and have so far been working looking into WPF. All knowledge and recommendations are welcomed. Thank you so much.
|
|
|
|
|
|
Hi Peter, and thank you for the reference material that microsoft wrote. It appears that the article has some relevent information for me, specifically approaches to creating a n-tier application. However, do you feel that this document is slightly outdated considering it was written 12 years ago??
|
|
|
|
|
|
Member 10420054 wrote: The best part about this application would be the speed at which it is able to build records based on looping through the controls That simply means that you should not be doing a blocking database-insert from the UI-thread.
Get the data, when the user presses "enter" create a new thread and have it insert the data. Reset the UI at the same time so that the user can continue inserting data. That way they can type without having to wait for the server.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Get the data, when the user presses "enter" create a new thread and have it insert the data. Reset the UI at the same time so that the user can continue inserting data. That way they can type without having to wait for the server.
That can be done also by using MQ (Message Queueing). Put your output record on the OUT queue and get on with life without bothering about creating a new thread.
|
|
|
|
|
Member 10420054 wrote: ...which primarily is used for data entry.... that assist the user in selecting the appropriate data
People who actually do data entry where speed matters typically don't need 'help'. Attempts to make it faster for them tends to slow it down because they type based on patterns. Thus it doesn't matter to them if they must type values into 10 fields but if they must learn that sometimes the only type values in 7 fields, or 4 fields, then they must learn not only what to type but must also learn the rules that is trying to help them in the first place.
If on the other hand you are not dealing with real data entry people or perhaps in terms of training new data entry people then finding a solution there depends on the application. But a knowledge based tutorial which one can use while learning (and can be turned off) might be suitable.
Member 10420054 wrote: I would like to separate the application into its parts ...
No, no, no.
As this forum suggests there is a reason someone starts with "Design and Architecture". You don't look at technology UNTIL you know what your application needs to do. And you don't know that yet.
|
|
|
|
|
Please I need guide on how to design webserver using Linux operating system
|
|
|
|
|
|
You forgot to say the magic words: "Plz send codz. Urgenz."
|
|
|
|
|
Would anyone be willing to give me some constructive feedback on my most recent article?
ITAdvisor Blog
All constructive feedback is genuinely appreciated.
Thanks
JD
http://www.seitmc.com/seitmcWP
|
|
|
|
|
Actually articles are expected to be posted here on CP, not simply advertised here...
|
|
|
|
|
Why not you link your CP account to your blog - it will give you a larger publicity and us something to read...
Also you will get all the feedback you ever wanted (I don't know about constructive )
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
The truth? Lots of words (with rather poor grammar) but very little useful meaning in them. Your title is "ARCHITECTING BIG DATA SOLUTIONS", but I did not see anything that would actually help to do that, as it is such a high level overview. Sorry to be so negative but I think you would do well to go back and review it from a reader's perspective.
|
|
|
|
|
He asked for constructive feedback, yours much like destructive ...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
There was nothing constructive that could be said about it.
|
|
|
|
|
Thank you all for your comments. I am working on becoming a better writer so your comments, as long as they help me do that, are welcome. "The harsh words of a friend are better than the kisses of an enemy."
I am starting to think that this may not be the place for this type of article. My audience was the 'C' level suite to provide some general thinking guidelines. They don't want the same level of details that we as developers need. Should have probably put that in the initial request.
Again thank you for taking your time to help me. I appreciate it.
JD
Thanks
JD
http://www.seitmc.com/seitmcWP
|
|
|
|
|
You should also appreciate that this forum is not the place for this. If you wish to write articles then you can submit them by following the Article Submission Guidelines[^]. They will then go into the general review queue where CP members can review and provide feedback, without further prompting from you.
|
|
|
|