php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Software Engineering-1 (CS504) Assignment 2 fall 2010 solution
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#3
First question solution can be found in attachment.
Code:
1) Write down any custom built C++ Class which you think is not cohesive (or low cohesive). Public I Enumerable<Employee> GetEmployeesFromDb_LowCohesion() { // instantiate the links using(SqlConnection connection = newSqlConnection(ConfigurationManager.ConnectionStrings[CONNECTION_STRING_KEY].ConnectionString)) using(SqlCommand command = new SqlCommand("spGetEmployee", connection)) // instantiate the command { command.CommandType = CommandType.StoredProcedure; // try to open the links try { connection.Open(); } catch (InvalidOperationException ex) { // log exemption throw; } catch (SqlException ex) { // log exemption throw; } catch (Exception ex) { // log exception throw; } // perform the reader & read the results using(SqlDataReader reader = command.ExecuteReader()) { Int32 m_NameOrdinal, m_DeptOrdinal; // obtain the ordinals try { m_NameOrdinal = reader.GetOrdinal(NAME); m_DeptOrdinal = reader.GetOrdinal(DEPARTMENT); } catch(System.IndexOutOfRangeException ex) { // log exemption throw; } Collection<Employee> result = new Collection<Employee>(); // interpret the results while(reader.Read()) { try { Employee emp = new Employee(); emp.Name = reader.IsDBNull(m_NameOrdinal) ? String.Empty: reader.GetString (m_NameOrdinal); emp.Department = reader.IsDBNull (m_NameOrdinal) ? String.Empty : reader.GetString(m_DeptOrdinal); result.Add(emp); } catch (IndexOutOfRangeException ex) { // Log the exemption throw; // rethrow or handle gracefully here } catch (Exception ex) { // Log the universal exemption throw; // rethrow or handle gracefully here } } return result; } } }


Attached Files
.doc   CS504 second solutuion.doc (Size: 49 KB / Downloads: 172)
Reply


Messages In This Thread
Software Engineering-1 (CS504) Assignment 2 fall 2010 solution - by Alice - 11-24-2010, 05:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,391 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,986 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 2,021 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,266 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,315 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 2,045 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,740 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,878 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,772 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,878 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support