Jump to content
Xtreme .Net Talk

rjonas

Members
  • Posts

    19
  • Joined

  • Last visited

About rjonas

  • Birthday 04/02/1973

Personal Information

  • Occupation
    Technical consultant
  • Visual Studio .NET Version
    Enterprise Architect
  • .NET Preferred Language
    C#

rjonas's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I agree that it's important to refactor. I'd also recommend this book. If you have to comment code to make it readable, it's probably not written in the best way. Comments have problems in that they are difficult to maintain. If you need to fix a problem urgently at a later stage, you're unlikely to find the time to update the comments as well. If you're using NUnit or similar, as PlausiblyDamp suggests, the unit tests are the best place for comments, and can act as comments themselves as they explain what the code should do. They will break if they are not kept up to date.
  2. This article describes .net scalability in a favourable light to J2EE, but with any article of this type, you have to ask questions as to why the author wrote it. www.object watch.com/FinalJ2EEandDotNet.doc I'd suggest looking at your application and think about what might cause problems as your application scales. If your application does a lot of mathematical calculations, perhaps a language such as C++ that offers more control at a lower level will be better for you. If database access is likely to be the issue, then the critical decision is whether to go Oracle or SQL Server or something else, not .net/j2ee. (edited - you'll have to remove a space from the link, as the original falls foul of a profanity checker)
  3. The Eyetrack study explains how people's eyes move over a web page and how to improve its usability by putting the most important parts of your page in certain areas. Regards Richard
  4. I open and close the connection each time, wrapping it in a c# using block, using exactly the same connection string each time. Connection pooling works behind the scenes to optimise performance, and if opening and closing connections is kept close to where the data is being used, any problems with connections are easier to find and debug.
  5. Hi George, Do you know whether your email recipients can receive emails in HTML format, and whether they are likely to have images enabled in their email client? If so, you could send your email in HTML format, and include your image using an <img> tag that references a file on your web server? Regards Richard
  6. I try and use parameters, to avoid the possibility of SQL injection attacks. It's good practice as well to assume your client will be compromised (it's easy to reverse engineer a .net application) and someone will write an application to connect to your database, bypassing your client completely. To reduce the damage that could be done if a malicious application called your stored procedures with their own parameters, it might be worth validating things on the SQL side of things as well as the client and rejecting anything that looks suspicious. Regards Richard
  7. Does the web service attempt to perform any user authentication, and could this be failing due to it running under the system user account rather than as a normal user? Can you easily test the part of the windows service that calls the web service as a standalone application running as the current user, and does this work? Regards Richard
  8. Hi, You can convert this to a type of Money, and then to a Varchar using a style of 1. select convert(varchar(50),convert(money,fieldname),1) from... The style of 1 gives 2 digits after the decimal point and inserts a comma between every 3 digits before the decimal point. There is a more detailed description of all the different styles here. Regards Richard
  9. I'd suggest your decision to do this should depend on the following 1) Are you likely to want to change your database, or the structure of the tables in it? If so, putting the logic into a class will make it easier to do this and mean you only need to change code in one place when you make database changes. 2) Do you do processing in the application, rather than the database. E.g. if you wanted to add an address to your DB that isn't formatted correctly, would you process this in the DB or in code before it gets that far. If you want to process this in code, you might want a separate class. 3) Are the "business concepts" the application understands different from the underlying database tables. If they are, having a separate class would make writing other parts of your application easier. I'd recommend the book "Patterns of Enterprise Application Architecture" by Martin Fowler if you want to read more about different ways of structuring your classes and the arguments for each. Richard Jonas http://www.btinternet.com/~rjonas
  10. Are you ever going to have to understand how many customers have used certain features of your application? If there's a feature that's only being used by a few customers it might not be worth developing in the next version of your application, whereas if a feature is being used by everyone it might be worth spending a lot more time on. It will be easier to find this sort of information out if you have one database and a field in each table describing which customer it relates to. Regards Richard Jonas Hertford, Herts, UK. http://www.btinternet.com/~rjonas
  11. What user are you running as from the scheduler? Is it possible this could this be a user that does not have access permission to write to your log file? Richard
  12. rjonas

    sms

    We use a service from a company called sms2email (http://www.sms2email.com) to send SMS messages. (I've no connection with this company otherwise, and I'm sure others offer a similar service). We buy SMS credits from them, and our application loads a web page using 2 lines of code like the following: System.Net.WebClient client = new System.Net.WebClient(); client.DownloadFile("http://www.sms2email.com/sms/postmsg.php?username=myusername&password=mypassword&orig=Name to appear on SMS message&to_num=<phone number>&message="+message,"c:\\temp.txt"); Regards Richard
  13. I haven't used this myself, so can't be certain if this would work, but would this be of any use -it's under the GPL so doesn't cost $3500. http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx
  14. rjonas

    QueryString

    Could your page work as follows: When the page loads (in the page_load event handler), check if there is a querysting. 1. If there is a query string, record a session variable containing the entire querystring, and carry on displaying the page. 2. If there is no query string, load the contents of the session variable (if it's present), and redirect back to the page (with the querystring appended). This should make the QueryString visible in the Address bar on the browser.
  15. I'd have thought that it would be easier to write Tetris using an event-driven model rather than a main loop. Could you set up a timer event, say every 1/2 a second and have an event handler that moves the block down the screen. You could also have keyboard event handlers. When a key to move the block left or right is pressed, these would be triggered and it would store the key pressed, and when the timer event is next triggered the block would move left or right as well as down. As the game progressed and got faster, all you would need to do is to reduce the interval of the timer events.
×
×
  • Create New...