We have already had little introductions to UML in the preceding lessons. Now we will dive deeper into conceptual data modeling and programming. These technologies are similar to Esri's Model Builder. In Model Builder, you can drop entities such as data, tools, inputs and outputs, parameters, functions, and relationships. When the model is complete, you can run it. By doing this, it compiles the underlying Python code, checks it and, if complete, will run it. This is Computer Aided Programming, also known as Computer Aided Software Engineering (CASE). You do not need to remember that. But to make Esri's zonal statistics you need the following code:
# Name: ZonalStatistics_Ex_02.py
# Description: Calculates statistics on values of a raster # within the zones of another dataset. # Requirements: Spatial Analyst Extension
# Import system modules import arcpy from arcpy import env from arcpy.sa import *
# Set environment settings env.workspace = "C:/sapyexamples/data"
# Set local variables inZoneData = "zone" zoneField = "value" inValueRaster = "valueraster"
# Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial")
# Execute ZonalStatistics outZonalStatistics = ZonalStatistics(inZoneData, zoneField, inValueRaster, "RANGE", "NODATA")
# Save the output outZonalStatistics.save("C:/sapyexamples/output/zonestatout2")
Example code above from Esri Online Help.
Instead of this complex writing, you can just drag an input raster and output raster, the zone data, drag the zonal statistics tool out of the toolbox, set a couple of parameters, and then hit run. The code will be checked and executed. There are no dangers of typos or forgetting the correct format. A simple example of building a model can be found on Esri Online Help.
Along with running tools, Esri Model Builder techniques can also be used to develop conceptual models. These are a lot more like UML problem modeling. Here is another example from Esri Online Help regarding school placement. Many other data models are available. Here is one for a Global Base Map from Esri Data Models, where many more can be found.
UML, being an open standard, has fully understandable drawing conventions. There are many, so do not try to learn them all here. But do take a look at the list of specifications at omg.org. Besides Model Builder in Esri, there are many other companies that have used UML ideas for CASE. One is IBM, which offers their Introduction to UML. Read this through and you will have a good background on UML.
The next step is to think about how development would take place from a design to the implementation process. This, too, can be diagrammed visually much more successfully than it can be described as a narrative. It has the advantage that some tools can import it and turn it into scripts or complete designs. It also has the open standard advantage of not being understood properly (provided that the UML is well done and known). Lastly, humans, being primates, think oftentimes in a more visual way. Connections and relationships are better understood in terms of a diagram than they are as a written description. This is not to say that UML or code does not need to be documented and annotated to make sure that it is clear. This, like metadata, is often left to the end and then just gets left. This can decrease the value of a program and can ruin a design. Teams break up, funding moves on, and participants die and leave. Documenting as you go is the safest policy. Here is another IBM link to a more complex and well designed application of their UML designed Rational Software for WebLink.
Such a complex model should be developed with the best practices in mind. Here is a set of Best Practices from IBM.
Deliverables for this week's Technology Trend:
- Add a comment in the Lesson 7 Technology Trends Discussion in Canvas about the uniqueness of geographic information in relation to visually modeling it graphically using UML.
- Comment on one of your peers' offerings.
- Brownie points for linking to other technology demos, pictures, blog posts, etc., that you've found to enrich your posts so that we may all benefit.
Deliverables for this week's Lesson 7 Writing and UML Drawing Exercise
- Upload a drawing that illustrates a part of your project in a visual design via UML diagramming that illustrates a component or the entirety of your term-long project idea. In addition, compile a written description (200 words max) that describes the different components of your UML diagram and how it relates to your term-long project idea. You can sketch this UML diagram by hand and scan it or photograph it. Or, you can use an online drawing tool like we used before for a mockup. The concepts and interactions are more important than the drawing quality. Be sure to document your drawing and annotate the entities. This exercise counts toward the writing exercises, not the term project, and is worth 15 points (see below for grading criteria).
- I suggest that you consider adding your UML drawing as an appendix to your project. Note that this addition to your paper will not be counted as part of the word total.
For this assignment, I will assign grades with the following rubric. For each of the three main criteria, I will assign points on a scale from 1-5, with 5 being excellent and 1 being very poor.
I define "Impact" as the strength and logic of the arguments and analytical insights you provide with your writing. In other words, present a clear argument to the reader as to why your UML diagram idea or approach is important.
I define "Content" as the level of understanding and knowledge of relevant topics you demonstrate with your writing. Here, demonstrate to the reader that you are knowledgeable about the idea or approach by communicating what you are planning to do and how you will do it.
I define "Clarity" as the readability and organization of your UML drawing and writing (including formatting and appropriate graphic design where applicable). Your writing should be clear, concise, and unambiguous. By all means proofread your drawing and writing so as to avoid errors. As a suggestion, ask someone else to read your UML drawing and writing to make sure that your ideas are being communicated effectively.
|Criteria||Excellent||Very Good||Satisfactory||Poor||Very Poor|