This is an old revision of the document!
Table of Contents
Study Questions - Audio Creation
CDEx Settings
Bitrate = 80 kbps
Mono
Quality = Very high (q = 0)
Questions To Be Recorded
C8L3Q1: How do you debug a service?
Answer: Install it, start it and then attach a debugger to the service's process.
C8L3Q2: When creating a service, which methods should you override and which are optional?
Follow up question: What should you also do if you override any optional method?
Answer: The methods OnStart and OnStop should be overridden. The methods OnPause, OnContinue and OnShutdown are optional.
Follow up answer: If OnPause and/or OnContinue are overriden, set ServiceBase.CanPauseAndContinue to true. If OnShutdown is overriden set ServiceBase.CanShutdown to true.
C8L3Q3: What four things does the ServiceInstaller class define?
Answer: The service description, display name, service name and start type.
C8L3Q4: What does the ServiceProcessInstaller class define?
Answer: The service account settings.
C8L3Q5: What are the three start types for a service and which is the default?
Answer: Automatic, manual (default) and disabled.
C8L3Q6: What are the four types of accounts that can be used a security context for a Windows service?
Follow up question: Which is the default, which is the most secure and which is the most privileged?
Answer:
- Local service (most secure)
- Network service
- Local system (most privileged)
- User (default)
C8L3Q7: What tool is used to manually install a service?
Answer: InstallUtil.exe.
Lesson 1: Configuration Settings
C9L1Q1: What are two most important classes used to deal with application settings and what namespace are they in?
Answer: Configuration and ConfigurationManager, which are in the System.Configuration namespace.
C9L1Q2: What are the four ConfigurationManager methods that open various configurations?
Answer:
- OpenExeConfiguration
- OpenMachineConfiguration
- OpenMappedExeConfiguration
- OpenMappedMachineConfiguration
C9L1Q3: What should you always do before opening a mapped configuration file and why?
Answer: Check for the existence of the file, because if it is missing no error will be generated - instead all the configuration settings will be null.
C9L1Q4: How can you specify which version of the .NET Framework an application should be run with?
Answer: Add a supportedRuntime entry in the startup section of the configuration file.
C9L1Q5: Which is obsolete, ConfigurationSettings or ConfigurationManager?
Answer: ConfigurationSettings
Chapter 2
PragC2Q1: When does software maintenance begin and why?
Answer: Software maintenance begins as soon as coding starts, because things keep changing (requirements and our understanding of them, environments, knowledge etc.)
PragC2Q2: What is the DRY principle?
Answer: Don't Repeat Yourself.
“Every piece of knowledge must be a single unambiguous, authoritative representation with in a system.”
PragC2Q3: What are the four categories of duplication?
Hint: The four i's of duplication.
Answer:
- Imposed - Developers feel they have no choice - the environment appears to require duplication.
- Inadvertent - Developers don't realise they are duplicating information.
- Impatient - Developers get lazy and duplicate because it seems easier.
- Interdeveloper - Multiple people on a team (or different teams) duplicate information.