5-Design - Problem Solving 1 1 2 3 4 Never start coding unless you understand the task Gather requirements first This means identify the problem

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1) Never start coding unless you understand the task! 2) Gather requirements first. This means identify the problem and ask questions about it. Now you kind of know what to do. 3) Analyze requirements to make sure that they are consistent and complete. Now you know that whatever you are going to do is doable . 4) Produce technical specification (i.e. express the requirements in technical terms). Now you know exactly what to do. 5) Think of what steps you need to take solve the problem and express them verbally to obtain a high- level process description. Now you have a process that you can code! 6) Start coding. Problem Solving Problem Solving
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
* Split complex task in a series of simple steps. * Identify entities the problem deals with. These will be your classes . * Identify what data characterizes your entities. These will be your class properties . * Identify what actions your entities can perform. These will be your class methods . * Find repeated actions and generalize them. These will be your utility functions or utility classes . You will reuse them. * Don’t make any assumptions: check user input and make provisions for worst cases. Process Analysis Process Analysis
Background image of page 2
Problem: Determine if the email address is valid. Requirement analysis: What rules can we define to check email address against? What is email address comprised of? [email protected] Local Part @ domain subdomain1.subdomain2.tld Email Validation Task Email Validation Task
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Core Rules Single ‘@’ character Non-empty Local Part Non-empty domain Non-empty subdomain(s) Non-empty TLD Local Part must not end with ‘.’ Additional Rules 7) 1 < TLD length < 7 8) Local Part length < 65 9) Domain Length < 256 11) Subdomain(s) must not begin with ‘-’ or end with ‘-’ 12) Check for invalid characters: ‘\\’, ‘”’, ‘<‘, ‘>’, ‘)’, ‘(‘, ‘]’, ’[‘, ’;’, ‘,’, ‘:’, ‘|’ 13) Domain cannot contain two ‘-’ in a row 14) Check TLD against the list of ICANN domains Email Validation Rules Email Validation Rules
Background image of page 4
There has to be LocalPart and Domain separated by ‘@’ Must not contain general illegal characters (‘\\’, ‘”’, ‘<‘, ‘>’, ‘)’, ‘(‘, ‘]’, ’[‘, ’;’, ‘,’, ‘:’, ‘|’) LocalPart 0 < Length < 65 Must not end with ‘.’ Domain 0 < Length < 256 There has to be at least one subdomain and a TLD separated by ‘.’ Must not contain ‘@’ All subdomains must be valid TLD must be valid Subdomain 0 < Length < 64 Must not begin or end with ‘-’ TLD 0 < Length < 7 Must not contain ‘-’ OR limit TLD choices to domains from ICANN list. Optimized Rules / Technical Spec
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/18/2010 for the course CSE 122 taught by Professor Yoxheimer,ericch during the Spring '07 term at Pennsylvania State University, University Park.

Page1 / 30

5-Design - Problem Solving 1 1 2 3 4 Never start coding unless you understand the task Gather requirements first This means identify the problem

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online