CS2 Data Structures Activity

From Foss2Serve
(Difference between revisions)
Jump to: navigation, search
m (Added category)
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
{| border="1"
+
 
|-
+
{{Learning Activity Overview
|'''Title''' || CS2 Data Structures Activity
+
|title=
|-
+
CS2 Data Structures Activity
|'''Overview''' || Using the HFOSS OpenMRS project to illustrate the use of data structures in a complex system
+
|overview=
|-
+
Using the HFOSS OpenMRS project to illustrate the use of data structures in a complex system.
|'''Prerequisite Knowledge''' || CS1 and Java
+
|prerequisites=
|-
+
CS1 and Java
|'''Learning Objectives''' ||
+
|objectives=
 
#Describe the difference between a data structure and the implementation thereof.
 
#Describe the difference between a data structure and the implementation thereof.
#Explain the application of a data structure in a specific large complex software system  
+
#Explain the application of a data structure in a specific large complex software system.
 
#Evaluate tradeoffs in selection of data structures.
 
#Evaluate tradeoffs in selection of data structures.
 
#Analyze the time complexity of an algorithm that uses the data structure.
 
#Analyze the time complexity of an algorithm that uses the data structure.
|}
+
|process skills=
 +
''What process skills will the student practice while completing this activity?''
 +
}}
  
=== Background: ===
+
=== Background ===
Is there background reading material?
+
  
Are there other activities the student should have done first?
+
Data structures are widely used in the development of large complex software systems. The decision to use a particular data structure is made by the programmer or in many cases a development team. Several factors must be considered including storage requirements, time requirements of the various operations that will be performed on the data, and usage patterns (i.e. the number and order of deletions, insertions, updates, etc.).
  
What is the rational for this activity?
+
This activity will explore a class within the OpenMRS code base where a number of data structures are utilized. As such, it is expected that the students will have some general knowledge about the OpenMRS project.
  
Include helpful hints to faculty here.
+
=== Directions ===
  
=== Directions: Working Ideas Stage 2 activity (2.3) from POSSE 201405 ===
+
# Go to the [https://github.com/openmrs/openmrs-module-reportingcompatibility/blob/master/api/src/main/java/org/openmrs/module/reportingcompatibility/reporting/export/DataExportFunctions.java DataExportFunctions] class and examine the import statements found at the beginning of the file. Provide the class names of four data structures that are used in DataExportFunctions.java. Note: You may need to refer to the Java APIs and should recall that an interface is not a class.
#Identify the course(s) the activity would be appropriate for.
+
# Go to the following link and then answer the questions below: 
##CS2 Data Structures Project based on the work of Darci's student [https://github.com/marvinyan/openfe/blob/master/Examples%20of%20Data%20Structures.md Data Structure Example]
+
#: http://stackoverflow.com/questions/8315116/what-is-a-key-object-use-in-hashmap
# Briefly describe the activity.
+
## What is meant by the term ''key''? The term ''value''?
##Find use of a specified data structure in the OpenMRS code base using a tool like [http://geoff.greer.fm/2011/12/27/the-silver-searcher-better-than-ack/ Ag], explain the task that the data structure is used to accomplish, and explain why the data structure is a good or poor choice for accomplishing this task.
+
## Given,
# How much time do you expect the HFOSS activity to take (# classes, # homework assignments, # lab activities, etc.)? Will the activity be completed in class or out of class?
+
##:'''Map<String, int> populations = new HashMap<String, int> ();'''
##One homework assignment or lab activity.
+
##:'''populations.put(“11530”, 27273);'''
# How does this activity relate to course goals/objectives?
+
##:'''populations.put(“28601”, 50026);'''
##Describe the difference between a data structure and the implementation thereof.
+
##:'''populations.put(“38111”, 41742);'''
##Explain the application of a data structure in a specific large complex software system
+
##:What would the following call to the get method return?
##Evaluate tradeoffs in selection of data structures.
+
##:'''System.out.println(“The population for Memphis, TN is “ + populations.get(“38111”);'''
##Analyze the time complexity of an algorithm that uses the data structure.
+
## If you wanted to store student information such as a student id, name, major, and gpa, which one of these would you choose as a key? Given that choice of a key, which of the remaining ones could be used as the associated value?
# What will students submit upon completion of the activity?
+
# The data structures within the DataExportFunctions class are used in a multitude of ways and it is likely that you are unfamiliar with some of the syntax. Go to the [https://github.com/openmrs/openmrs-module-reportingcompatibility/blob/master/api/src/main/java/org/openmrs/module/reportingcompatibility/reporting/export/DataExportFunctions.java#L754 clearMap method]. You will find that it uses wildcard characters (‘?’).
##A link to a place where the code is found in the codebase [1]
+
#: Briefly explain what each of the following means and explain the benefit of using them.
##A written description of the data structure used within the code and how the code works.
+
## ‘?’ (hint: wildcards)
# How will you assess the submission?  
+
## ‘? Extends Map’
##Students will get into groups of three and assess each other's work based on rubric provided by professor.  
+
## Determine whether each of the following calls to '''clearMap''' is valid or invalid. If a call is invalid, explain why.  
##Each group will provide a group response
+
### Map =
##Each student will turn in the original response.
+
### Call 2
# List any question or concerns you have about implementing your activity.
+
### Call 3
##N/A
+
### Call 4
# What type of support will you need to implement your activity?
+
## Write a Javadoc comment for the clearMap method.
##Darci will provide all support.
+
# Go to the [https://github.com/openmrs/openmrs-module-reportingcompatibility/blob/master/api/src/main/java/org/openmrs/module/reportingcompatibility/reporting/export/DataExportFunctions.java#L352-L387 getLastEncounterAttr method]. There are two reference variables declared, ''types'' and ''encounterTypes''.
 +
## Can you determine what type of object each refers to? If yes, then specify the type of object. If not, then in your opinion what type of object is it most likely to refer to. Explain your answer.
 +
## Why do you think these data structures were selected by the developers?
 +
# Analysis question…I’m not sure this method is a good choice for analysis. Thoughts? Would some other code segment within this class be better suited for this type of question?
  
 +
=== Deliverables ===
  
=== Deliverables: ===
 
 
Written artifact to Instructor  
 
Written artifact to Instructor  
  
  
=== Assessment: ===
+
=== Assessment ===
 +
 
 
How will the activity be graded?
 
How will the activity be graded?
 
   
 
   
Line 83: Line 88:
  
 
=== Comments: ===
 
=== Comments: ===
What should the instructor know before using this activity?
+
# You may choose to leave out analysis.
 +
# Depending on how many data structures you have covered, you may choose to reduce the number of data structures you are asking your students to identify.
 +
# This activity may be useful even for students who are not learning Java. For example, students who know C++ can, with reasonable effort, can learn enough about Java to complete the activity. The added benefit is that they can learn that concepts transcend the language.
  
What are some likely difficulties that an instructor may encounter using this activity?
+
=== Additional Information ===
  
 
+
{{Learning Activity Info
=== Additional Information: ===
+
|acm unit=
{| border="1"
+
Programming Languages / Object-Oriented Programming
|-
+
|acm topic=
|'''ACM Knowledge Area/Knowledge Unit''' || What ACM Computing Curricula 2013 knowledge area and units does this activity cover? [[ACM_Body_of_Knowledge]]
+
Using collection classes
|-
+
|difficulty=
|'''ACM Topic''' || What specific topics are addressed? The Computing Curriucula 2013 provides a list of topics - https://www.acm.org/education/CS2013-final-report.pdf
+
medium
|-
+
|time=
|'''Level of Difficulty''' || Is this activity easy, medium or challenging?
+
Varies, designed as one assignment or laboratory activity  
|-
+
|environment=
|'''Estimated Time to Completion''' || Varies, designed as one assignment or laboratory activity  
+
Access to OpenMRS codebase  
|-
+
|author=
|'''Materials/Environment''' || Access to OpenMRS codebase  
+
Darci Burdge, Patricia Ordóñez, Jeff Ward, Mezei Razvan, Stewart Weiss, Joanna Klukowska
|-
+
|source=
|'''Author''' || Who wrote this activity?
+
POSSE 201405 Workshop Activity  
|-
+
|license=
|'''Source''' || POSSE 201405 Workshop Activity  
+
{{License CC BY SA}}
|-
+
}}
|'''License''' || Licensed CC BY-SA  
+
|}
+
  
 
=== Suggestions for Open Source Community: ===
 
=== Suggestions for Open Source Community: ===
 
Suggestions for an open source community member who is working in conjunction with the instructor.
 
Suggestions for an open source community member who is working in conjunction with the instructor.
  
 
+
[[Category:Learning_Activity]]
--------------------
+
[[Category:CS2]]
This work is licensed under a
+
[[Category:Good Draft]]
[http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License]
+
 
+
[[File:CC_license.png]]
+
 
+
[[Category: Learning_Activity]]
+
[[Category: LEARNING_ACTIVITY_SUBCATEGORY]]
+
 
+
[[Category: CS2]]
+

Latest revision as of 21:55, 7 September 2018


Title

CS2 Data Structures Activity

Overview

Using the HFOSS OpenMRS project to illustrate the use of data structures in a complex system.

Prerequisites

CS1 and Java

Learning
Objectives
After successfully completing this activity, the learner should be able to:
  1. Describe the difference between a data structure and the implementation thereof.
  2. Explain the application of a data structure in a specific large complex software system.
  3. Evaluate tradeoffs in selection of data structures.
  4. Analyze the time complexity of an algorithm that uses the data structure.
Process Skills
Practiced

What process skills will the student practice while completing this activity?


Background

Data structures are widely used in the development of large complex software systems. The decision to use a particular data structure is made by the programmer or in many cases a development team. Several factors must be considered including storage requirements, time requirements of the various operations that will be performed on the data, and usage patterns (i.e. the number and order of deletions, insertions, updates, etc.).

This activity will explore a class within the OpenMRS code base where a number of data structures are utilized. As such, it is expected that the students will have some general knowledge about the OpenMRS project.

Directions

  1. Go to the DataExportFunctions class and examine the import statements found at the beginning of the file. Provide the class names of four data structures that are used in DataExportFunctions.java. Note: You may need to refer to the Java APIs and should recall that an interface is not a class.
  2. Go to the following link and then answer the questions below:
    http://stackoverflow.com/questions/8315116/what-is-a-key-object-use-in-hashmap
    1. What is meant by the term key? The term value?
    2. Given,
      Map<String, int> populations = new HashMap<String, int> ();
      populations.put(“11530”, 27273);
      populations.put(“28601”, 50026);
      populations.put(“38111”, 41742);
      What would the following call to the get method return?
      System.out.println(“The population for Memphis, TN is “ + populations.get(“38111”);
    3. If you wanted to store student information such as a student id, name, major, and gpa, which one of these would you choose as a key? Given that choice of a key, which of the remaining ones could be used as the associated value?
  3. The data structures within the DataExportFunctions class are used in a multitude of ways and it is likely that you are unfamiliar with some of the syntax. Go to the clearMap method. You will find that it uses wildcard characters (‘?’).
    Briefly explain what each of the following means and explain the benefit of using them.
    1. ‘?’ (hint: wildcards)
    2. ‘? Extends Map’
    3. Determine whether each of the following calls to clearMap is valid or invalid. If a call is invalid, explain why.
      1. Map =
      2. Call 2
      3. Call 3
      4. Call 4
    4. Write a Javadoc comment for the clearMap method.
  4. Go to the getLastEncounterAttr method. There are two reference variables declared, types and encounterTypes.
    1. Can you determine what type of object each refers to? If yes, then specify the type of object. If not, then in your opinion what type of object is it most likely to refer to. Explain your answer.
    2. Why do you think these data structures were selected by the developers?
  5. Analysis question…I’m not sure this method is a good choice for analysis. Thoughts? Would some other code segment within this class be better suited for this type of question?

Deliverables

Written artifact to Instructor


Assessment

How will the activity be graded?

How will learning will be measured?

Include sample assessment questions/rubrics.

Criteria Level 1 (fail) Level 2 (pass) Level 3 (good) Level 4 (exceptional)
The purpose of the project
Why the project is open source

Comments:

  1. You may choose to leave out analysis.
  2. Depending on how many data structures you have covered, you may choose to reduce the number of data structures you are asking your students to identify.
  3. This activity may be useful even for students who are not learning Java. For example, students who know C++ can, with reasonable effort, can learn enough about Java to complete the activity. The added benefit is that they can learn that concepts transcend the language.

Additional Information

ACM BoK
Area & Unit(s)

Programming Languages / Object-Oriented Programming

ACM BoK
Topic(s)

Using collection classes

Difficulty

medium

Estimated Time
to Complete

Varies, designed as one assignment or laboratory activity

Environment /
Materials

Access to OpenMRS codebase

Author(s)

Darci Burdge, Patricia Ordóñez, Jeff Ward, Mezei Razvan, Stewart Weiss, Joanna Klukowska

Source

POSSE 201405 Workshop Activity

License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

CC license.png


Suggestions for Open Source Community:

Suggestions for an open source community member who is working in conjunction with the instructor.

Personal tools
Namespaces
Variants
Actions
Events
Learning Resources
HFOSS Projects
Evaluation
Navigation
Toolbox