├── .gitattributes ├── 1.1-motivation.odp ├── 1.2-scala_basics.odp ├── 1.3-tools_and_repl.odp ├── 1.4-first_class_functions.odp ├── 1.5-pattern_matching.odp ├── 1.6-oo_traits.odp ├── 1.7-functional_programming.odp ├── 2.1-recap_from_day_one.odp ├── 2.2-higher_order_functions.odp ├── 2.3-implicits.odp ├── 2.4-xml_support.odp ├── 2.5-the_quiz_game.odp ├── 2.6-summary_day_2.odp ├── LICENSE.txt └── README.textile /.gitattributes: -------------------------------------------------------------------------------- 1 | *.ods diff=odf 2 | *.odt diff=odf 3 | *.odp diff=odf 4 | -------------------------------------------------------------------------------- /1.1-motivation.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/1.1-motivation.odp -------------------------------------------------------------------------------- /1.2-scala_basics.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/1.2-scala_basics.odp -------------------------------------------------------------------------------- /1.3-tools_and_repl.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/1.3-tools_and_repl.odp -------------------------------------------------------------------------------- /1.4-first_class_functions.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/1.4-first_class_functions.odp -------------------------------------------------------------------------------- /1.5-pattern_matching.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/1.5-pattern_matching.odp -------------------------------------------------------------------------------- /1.6-oo_traits.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/1.6-oo_traits.odp -------------------------------------------------------------------------------- /1.7-functional_programming.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/1.7-functional_programming.odp -------------------------------------------------------------------------------- /2.1-recap_from_day_one.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/2.1-recap_from_day_one.odp -------------------------------------------------------------------------------- /2.2-higher_order_functions.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/2.2-higher_order_functions.odp -------------------------------------------------------------------------------- /2.3-implicits.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/2.3-implicits.odp -------------------------------------------------------------------------------- /2.4-xml_support.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/2.4-xml_support.odp -------------------------------------------------------------------------------- /2.5-the_quiz_game.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/2.5-the_quiz_game.odp -------------------------------------------------------------------------------- /2.6-summary_day_2.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaBin/scala-training-slides/da2be4660afbce175a52cb609f7c03a13270ab60/2.6-summary_day_2.odp -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Creative Commons 2 | Creative Commons Legal Code 3 | Attribution 3.0 Unported 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT 6 | PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT 7 | CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES 8 | THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO 9 | WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS 10 | LIABILITY FOR DAMAGES RESULTING FROM ITS USE. 11 | 12 | License 13 | 14 | THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS 15 | CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS 16 | PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE 17 | WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS 18 | PROHIBITED. 19 | 20 | BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND 21 | AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS 22 | LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU 23 | THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH 24 | TERMS AND CONDITIONS. 25 | 26 | 1. Definitions 27 | 28 | a. "Adaptation" means a work based upon the Work, or upon the Work 29 | and other pre-existing works, such as a translation, adaptation, 30 | derivative work, arrangement of music or other alterations of a 31 | literary or artistic work, or phonogram or performance and 32 | includes cinematographic adaptations or any other form in which 33 | the Work may be recast, transformed, or adapted including in any 34 | form recognizably derived from the original, except that a work 35 | that constitutes a Collection will not be considered an 36 | Adaptation for the purpose of this License. For the avoidance of 37 | doubt, where the Work is a musical work, performance or 38 | phonogram, the synchronization of the Work in timed-relation 39 | with a moving image ("synching") will be considered an 40 | Adaptation for the purpose of this License. 41 | 42 | b. "Collection" means a collection of literary or artistic works, 43 | such as encyclopedias and anthologies, or performances, 44 | phonograms or broadcasts, or other works or subject matter other 45 | than works listed in Section 1(f) below, which, by reason of the 46 | selection and arrangement of their contents, constitute 47 | intellectual creations, in which the Work is included in its 48 | entirety in unmodified form along with one or more other 49 | contributions, each constituting separate and independent works 50 | in themselves, which together are assembled into a collective 51 | whole. A work that constitutes a Collection will not be 52 | considered an Adaptation (as defined above) for the purposes of 53 | this License. 54 | 55 | c. "Distribute" means to make available to the public the original 56 | and copies of the Work or Adaptation, as appropriate, through 57 | sale or other transfer of ownership. 58 | 59 | d. "Licensor" means the individual, individuals, entity or entities 60 | that offer(s) the Work under the terms of this License. 61 | 62 | e. "Original Author" means, in the case of a literary or artistic 63 | work, the individual, individuals, entity or entities who 64 | created the Work or if no individual or entity can be 65 | identified, the publisher; and in addition (i) in the case of a 66 | performance the actors, singers, musicians, dancers, and other 67 | persons who act, sing, deliver, declaim, play in, interpret or 68 | otherwise perform literary or artistic works or expressions of 69 | folklore; (ii) in the case of a phonogram the producer being the 70 | person or legal entity who first fixes the sounds of a 71 | performance or other sounds; and, (iii) in the case of 72 | broadcasts, the organization that transmits the broadcast. 73 | 74 | f. "Work" means the literary and/or artistic work offered under the 75 | terms of this License including without limitation any 76 | production in the literary, scientific and artistic domain, 77 | whatever may be the mode or form of its expression including 78 | digital form, such as a book, pamphlet and other writing; a 79 | lecture, address, sermon or other work of the same nature; a 80 | dramatic or dramatico-musical work; a choreographic work or 81 | entertainment in dumb show; a musical composition with or 82 | without words; a cinematographic work to which are assimilated 83 | works expressed by a process analogous to cinematography; a work 84 | of drawing, painting, architecture, sculpture, engraving or 85 | lithography; a photographic work to which are assimilated works 86 | expressed by a process analogous to photography; a work of 87 | applied art; an illustration, map, plan, sketch or 88 | three-dimensional work relative to geography, topography, 89 | architecture or science; a performance; a broadcast; a 90 | phonogram; a compilation of data to the extent it is protected 91 | as a copyrightable work; or a work performed by a variety or 92 | circus performer to the extent it is not otherwise considered a 93 | literary or artistic work. 94 | 95 | g. "You" means an individual or entity exercising rights under this 96 | License who has not previously violated the terms of this 97 | License with respect to the Work, or who has received express 98 | permission from the Licensor to exercise rights under this 99 | License despite a previous violation. 100 | 101 | h. "Publicly Perform" means to perform public recitations of the 102 | Work and to communicate to the public those public recitations, 103 | by any means or process, including by wire or wireless means or 104 | public digital performances; to make available to the public 105 | Works in such a way that members of the public may access these 106 | Works from a place and at a place individually chosen by them; 107 | to perform the Work to the public by any means or process and 108 | the communication to the public of the performances of the Work, 109 | including by public digital performance; to broadcast and 110 | rebroadcast the Work by any means including signs, sounds or 111 | images. 112 | 113 | i. "Reproduce" means to make copies of the Work by any means 114 | including without limitation by sound or visual recordings and 115 | the right of fixation and reproducing fixations of the Work, 116 | including storage of a protected performance or phonogram in 117 | digital form or other electronic medium. 118 | 119 | 2. Fair Dealing Rights. Nothing in this License is intended to reduce, 120 | limit, or restrict any uses free from copyright or rights arising 121 | from limitations or exceptions that are provided for in connection 122 | with the copyright protection under copyright law or other 123 | applicable laws. 124 | 125 | 3. License Grant. Subject to the terms and conditions of this License, 126 | Licensor hereby grants You a worldwide, royalty-free, 127 | non-exclusive, perpetual (for the duration of the applicable 128 | copyright) license to exercise the rights in the Work as stated 129 | below: 130 | 131 | a. to Reproduce the Work, to incorporate the Work into one or more 132 | Collections, and to Reproduce the Work as incorporated in the 133 | Collections; 134 | 135 | b. to create and Reproduce Adaptations provided that any such 136 | Adaptation, including any translation in any medium, takes 137 | reasonable steps to clearly label, demarcate or otherwise 138 | identify that changes were made to the original Work. For 139 | example, a translation could be marked "The original work was 140 | translated from English to Spanish," or a modification could 141 | indicate "The original work has been modified."; 142 | 143 | c. to Distribute and Publicly Perform the Work including as 144 | incorporated in Collections; and, 145 | 146 | d. to Distribute and Publicly Perform Adaptations. 147 | 148 | e. For the avoidance of doubt: 149 | 150 | i. Non-waivable Compulsory License Schemes. In those 151 | jurisdictions in which the right to collect royalties 152 | through any statutory or compulsory licensing scheme 153 | cannot be waived, the Licensor reserves the exclusive 154 | right to collect such royalties for any exercise by You of 155 | the rights granted under this License; 156 | 157 | ii. Waivable Compulsory License Schemes. In those 158 | jurisdictions in which the right to collect royalties 159 | through any statutory or compulsory licensing scheme can 160 | be waived, the Licensor waives the exclusive right to 161 | collect such royalties for any exercise by You of the 162 | rights granted under this License; and, 163 | 164 | iii. Voluntary License Schemes. The Licensor waives the right 165 | to collect royalties, whether individually or, in the 166 | event that the Licensor is a member of a collecting 167 | society that administers voluntary licensing schemes, via 168 | that society, from any exercise by You of the rights 169 | granted under this License. 170 | 171 | The above rights may be exercised in all media and formats whether now 172 | known or hereafter devised. The above rights include the right to make 173 | such modifications as are technically necessary to exercise the rights 174 | in other media and formats. Subject to Section 8(f), all rights not 175 | expressly granted by Licensor are hereby reserved. 176 | 177 | 4. Restrictions. The license granted in Section 3 above is expressly 178 | made subject to and limited by the following restrictions: 179 | 180 | a. You may Distribute or Publicly Perform the Work only under the 181 | terms of this License. You must include a copy of, or the 182 | Uniform Resource Identifier (URI) for, this License with every 183 | copy of the Work You Distribute or Publicly Perform. You may not 184 | offer or impose any terms on the Work that restrict the terms of 185 | this License or the ability of the recipient of the Work to 186 | exercise the rights granted to that recipient under the terms of 187 | the License. You may not sublicense the Work. You must keep 188 | intact all notices that refer to this License and to the 189 | disclaimer of warranties with every copy of the Work You 190 | Distribute or Publicly Perform. When You Distribute or Publicly 191 | Perform the Work, You may not impose any effective technological 192 | measures on the Work that restrict the ability of a recipient of 193 | the Work from You to exercise the rights granted to that 194 | recipient under the terms of the License. This Section 4(a) 195 | applies to the Work as incorporated in a Collection, but this 196 | does not require the Collection apart from the Work itself to be 197 | made subject to the terms of this License. If You create a 198 | Collection, upon notice from any Licensor You must, to the 199 | extent practicable, remove from the Collection any credit as 200 | required by Section 4(b), as requested. If You create an 201 | Adaptation, upon notice from any Licensor You must, to the 202 | extent practicable, remove from the Adaptation any credit as 203 | required by Section 4(b), as requested. 204 | 205 | b. If You Distribute, or Publicly Perform the Work or any 206 | Adaptations or Collections, You must, unless a request has been 207 | made pursuant to Section 4(a), keep intact all copyright notices 208 | for the Work and provide, reasonable to the medium or means You 209 | are utilizing: (i) the name of the Original Author (or 210 | pseudonym, if applicable) if supplied, and/or if the Original 211 | Author and/or Licensor designate another party or parties (e.g., 212 | a sponsor institute, publishing entity, journal) for attribution 213 | ("Attribution Parties") in Licensor's copyright notice, terms of 214 | service or by other reasonable means, the name of such party or 215 | parties; (ii) the title of the Work if supplied; (iii) to the 216 | extent reasonably practicable, the URI, if any, that Licensor 217 | specifies to be associated with the Work, unless such URI does 218 | not refer to the copyright notice or licensing information for 219 | the Work; and (iv) , consistent with Section 3(b), in the case 220 | of an Adaptation, a credit identifying the use of the Work in 221 | the Adaptation (e.g., "French translation of the Work by 222 | Original Author," or "Screenplay based on original Work by 223 | Original Author"). The credit required by this Section 4 (b) may 224 | be implemented in any reasonable manner; provided, however, that 225 | in the case of a Adaptation or Collection, at a minimum such 226 | credit will appear, if a credit for all contributing authors of 227 | the Adaptation or Collection appears, then as part of these 228 | credits and in a manner at least as prominent as the credits for 229 | the other contributing authors. For the avoidance of doubt, You 230 | may only use the credit required by this Section for the purpose 231 | of attribution in the manner set out above and, by exercising 232 | Your rights under this License, You may not implicitly or 233 | explicitly assert or imply any connection with, sponsorship or 234 | endorsement by the Original Author, Licensor and/or Attribution 235 | Parties, as appropriate, of You or Your use of the Work, without 236 | the separate, express prior written permission of the Original 237 | Author, Licensor and/or Attribution Parties. 238 | 239 | c. Except as otherwise agreed in writing by the Licensor or as may 240 | be otherwise permitted by applicable law, if You Reproduce, 241 | Distribute or Publicly Perform the Work either by itself or as 242 | part of any Adaptations or Collections, You must not distort, 243 | mutilate, modify or take other derogatory action in relation to 244 | the Work which would be prejudicial to the Original Author's 245 | honor or reputation. Licensor agrees that in those jurisdictions 246 | (e.g. Japan), in which any exercise of the right granted in 247 | Section 3(b) of this License (the right to make Adaptations) 248 | would be deemed to be a distortion, mutilation, modification or 249 | other derogatory action prejudicial to the Original Author's 250 | honor and reputation, the Licensor will waive or not assert, as 251 | appropriate, this Section, to the fullest extent permitted by 252 | the applicable national law, to enable You to reasonably 253 | exercise Your right under Section 3(b) of this License (right to 254 | make Adaptations) but not otherwise. 255 | 256 | 5. Representations, Warranties and Disclaimer 257 | 258 | UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, 259 | LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR 260 | WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, 261 | STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES 262 | OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, 263 | NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, 264 | ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT 265 | DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF 266 | IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 267 | 268 | 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY 269 | APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY 270 | LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE 271 | OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE 272 | WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 273 | DAMAGES. 274 | 275 | 7. Termination 276 | 277 | a. This License and the rights granted hereunder will terminate 278 | automatically upon any breach by You of the terms of this 279 | License. Individuals or entities who have received Adaptations 280 | or Collections from You under this License, however, will not 281 | have their licenses terminated provided such individuals or 282 | entities remain in full compliance with those licenses. Sections 283 | 1, 2, 5, 6, 7, and 8 will survive any termination of this 284 | License. 285 | 286 | b. Subject to the above terms and conditions, the license granted 287 | here is perpetual (for the duration of the applicable copyright 288 | in the Work). Notwithstanding the above, Licensor reserves the 289 | right to release the Work under different license terms or to 290 | stop distributing the Work at any time; provided, however that 291 | any such election will not serve to withdraw this License (or 292 | any other license that has been, or is required to be, granted 293 | under the terms of this License), and this License will continue 294 | in full force and effect unless terminated as stated above. 295 | 296 | 8. Miscellaneous 297 | 298 | a. Each time You Distribute or Publicly Perform the Work or a 299 | Collection, the Licensor offers to the recipient a license to 300 | the Work on the same terms and conditions as the license granted 301 | to You under this License. 302 | 303 | b. Each time You Distribute or Publicly Perform an Adaptation, 304 | Licensor offers to the recipient a license to the original Work 305 | on the same terms and conditions as the license granted to You 306 | under this License. 307 | 308 | c. If any provision of this License is invalid or unenforceable 309 | under applicable law, it shall not affect the validity or 310 | enforceability of the remainder of the terms of this License, 311 | and without further action by the parties to this agreement, 312 | such provision shall be reformed to the minimum extent necessary 313 | to make such provision valid and enforceable. 314 | 315 | d. No term or provision of this License shall be deemed waived and 316 | no breach consented to unless such waiver or consent shall be in 317 | writing and signed by the party to be charged with such waiver 318 | or consent. 319 | 320 | e. This License constitutes the entire agreement between the 321 | parties with respect to the Work licensed here. There are no 322 | understandings, agreements or representations with respect to 323 | the Work not specified here. Licensor shall not be bound by any 324 | additional provisions that may appear in any communication from 325 | You. This License may not be modified without the mutual written 326 | agreement of the Licensor and You. 327 | 328 | f. The rights granted under, and the subject matter referenced, in 329 | this License were drafted utilizing the terminology of the Berne 330 | Convention for the Protection of Literary and Artistic Works (as 331 | amended on September 28, 1979), the Rome Convention of 1961, the 332 | WIPO Copyright Treaty of 1996, the WIPO Performances and 333 | Phonograms Treaty of 1996 and the Universal Copyright Convention 334 | (as revised on July 24, 1971). These rights and subject matter 335 | take effect in the relevant jurisdiction in which the License 336 | terms are sought to be enforced according to the corresponding 337 | provisions of the implementation of those treaty provisions in 338 | the applicable national law. If the standard suite of rights 339 | granted under applicable copyright law includes additional 340 | rights not granted under this License, such additional rights 341 | are deemed to be included in the License; this License is not 342 | intended to restrict the license of any rights under applicable 343 | law. 344 | 345 | Creative Commons Notice 346 | 347 | Creative Commons is not a party to this License, and makes no 348 | warranty whatsoever in connection with the Work. Creative Commons 349 | will not be liable to You or any party on any legal theory for any 350 | damages whatsoever, including without limitation any general, 351 | special, incidental or consequential damages arising in connection 352 | to this license. Notwithstanding the foregoing two (2) sentences, 353 | if Creative Commons has expressly identified itself as the 354 | Licensor hereunder, it shall have all rights and obligations of 355 | Licensor. 356 | 357 | Except for the limited purpose of indicating to the public that 358 | the Work is licensed under the CCPL, Creative Commons does not 359 | authorize the use by either party of the trademark "Creative 360 | Commons" or any related trademark or logo of Creative Commons 361 | without the prior written consent of Creative Commons. Any 362 | permitted use will be in compliance with Creative Commons' 363 | then-current trademark usage guidelines, as may be published on 364 | its website or otherwise made available upon request from time to 365 | time. For the avoidance of doubt, this trademark restriction does 366 | not form part of this License. 367 | 368 | Creative Commons may be contacted at http://creativecommons.org/. -------------------------------------------------------------------------------- /README.textile: -------------------------------------------------------------------------------- 1 | h2. Scala training - slides 2 | 3 | This github project contains slides used for the Scala training course. The code which goes along with the slides is located at "Scala training code":http://github.com/javaBin/scala-training-code. 4 | 5 | When doing the training course, we created a "VirtualBox":http://www.virtualbox.org/ image containing all the code and working versions of Java, Maven, Scala, Eclipse and IDEA. We used a trimmed down version of Debian Linux and we distrubuted it through "DropBox":https://www.dropbox.com/. If you would like a copy of the image we created, please contact us directly. 6 | 7 | Each day of the course is meant to be approximately 4 hours. 8 | 9 | 10 | h3. Day one 11 | 12 | The first day is very controlled. We start off by giving a motivation talk, then go through basic Scala syntax and an intro to tools. After this the participants get a little hands on programming. 13 | 14 | The course then proceeds with short intros to topics (15-20 minutes) followed by programming exercises (about 30 minutes). The programming exercises are JUnit tests which give immediate feedback on correctness. It is important the participants are made aware that they may skip exercises if they get stuck, there are plenty of exercises for each topic. 15 | 16 | The day ends with a motivational talk on pure functional programming. 17 | 18 | Day one is divided into the following slide set/topic: 19 | 20 | 21 | h4. 1.1 - start.odp 22 | 23 | This is 10 minute motivational talk for learning Scala. Starts off with a few quotes on Scala from prominent figures in the community, then shows quite a few code examples to show the power of Scala. We do not try to explain how these examples work, just the benefit. However it is a goal of the training class that everyone should be able to understand all the examples shown here at the end of the training course. 24 | 25 | h4. 1.2 - scala basics.odp 26 | 27 | Covers a lot of the basic syntax in Scala compared with Java. We aimed here not to show how similar concepts map between Scala and Java. On purpose we avoided the more advanced constructs and concepts. This is meant as a quick intro to the language syntax, to make the participants feel right at home. 28 | 29 | h4. 1.3 - tools_and_repl.odp 30 | 31 | Short discussion on available tools and IDE support. The first hands on exercise is followed by these slides. The aim of the exercises is to see that everyone has a working development environment. There are also very simple tasks to perform, to make the participants feel a little at ease. 32 | 33 | 1.1 - 1.3 is meant to be about and hour. We spent about 15 minutes doing the practical part of 1.3, including a short summary. 34 | 35 | h4. 1.4 - firstclassfunctions.odp 36 | 37 | Defines first class functions and closures and how to use them. Also how this differs fundamentally from Java's iteration approach. 38 | 39 | We tried to make it a point about deferred execution, through a constructed example of a Swing action listener. Participants need to understand that even though it looks like first class functions are executed right then and there, they are actually executed later, whenever appropriate. In the Swing action listener example, whenever the button is pressed. 40 | 41 | Closures is explained in detail. 42 | 43 | The presentation section should be no longer than 15 minutes. 30 minutes are spent on the programming tasks and 5 minutes on summary and questions. 44 | 45 | h4. 1.5 - PatternMatching.odp 46 | 47 | Shows the power of pattern matching. Starts off by showing how matching can be done on existing types. Also shows iteration with lists on pattern matching. We are perfectly aware that the iteration example is not tail recursive, however we tried not to make the concepts too difficult to understand. 48 | 49 | We then show how pattern matching can be done on your own types, with case classes. We believe that introducing extractors would be a little too advanced for the first day. 50 | 51 | We felt that at this point it would be natural to introduce the Option type. 52 | 53 | The presentation section should be no longer than 15 minutes. 30 minutes are spent on the programming tasks and 5 minutes on summary and questions. 54 | 55 | h4. 1.6 - OO-traits.odp 56 | 57 | This part is meant to cover all of the OO stuff which we felt was too advanced for the "basic syntax" sections. It covers quite a few different topics 58 | 59 | * Annotations - supports annotations just as well as Java. Does not use marker interfaces. 60 | * Object - in stead of statics. A lot more powerful, and can inherit classes/traits, and can be passed around as normal references. 61 | * Companion object - Special use of object. Can create some really nice syntax around types. 62 | * Primary constructors - Only one, and every constructor must call it. Class body is primary constructor body. 63 | * Auxiliary constructors - Easy to define, but must chain up to primary constructor 64 | * Inheritance - works similar as in Java 65 | * Traits - Multiple inheritance done right. Can do almost the same as with classes, except has not constructors. Possible to mix in traits on instance creations. 66 | * Composition vs inheritance - traits makes it easy not to inherit but to 'mix in', which is almost always what you want. 67 | 68 | The presentation section should be no longer than 20 minutes. 30 minutes are spent on the programming tasks and 5 minutes on summary and questions. 69 | 70 | h4. 1.7 - functional_programming.odp 71 | 72 | This part is meant as a motivational ending of day one. Functional concepts have been introduced, however pure functional programming has not. Try to explain why to strive for functional purity, how Scala helps in this way, and how Scala lets you choose. 73 | 74 | This section should not be more than 10 minutes. 75 | 76 | 77 | h3. Day two 78 | 79 | The second day of the training class is meant to bee more free than day one. This means that the participant are more free to explore the language on their own. 80 | 81 | It starts of we a quick recap of day one. Following is two advanced topics. With "advanced" we mean concepts the participants have to understand in order to use Scala and Scala libraries, but not necessarily be able to write themselves. At least not every day. We then give an intro to Scala's XML support followed by the programming task of the day. We set 3 hours for the task. The day ends with information on where to go next, with pointers to some good resources on learning more Scala. 82 | 83 | h4. 2.1 - recap from day one.odp 84 | 85 | This is a really short wrap up of most of the topics of day one. This is meant to get the participants back into the topic matter quickly. This part should not take more than 10 minutes. 86 | 87 | h4. 2.2 - higherorderfunctions.odp 88 | 89 | Defines higher order functions and how they are used. Also discusses 'call by name' vs 'call by value'. We chose to show the 'using' example for closing resources, shown by Martin Odersky several times, for instance at "Fosdem":http://www.slideshare.net/Odersky/fosdem-2009-1013261. This also introduced structural types. We also felt it was important to explain that structural types are not thread safe and use reflection, which may lead to unexpected behavior. However they can be extremely powerful when used appropriately. 90 | 91 | This section should not take more than 15 minutes. 92 | 93 | h4. 2.3 - implicits.odp 94 | 95 | Shows how implicit conversions work and how to define them. This is mainly to explain of the "built in" library implicit conversions. In particular all rich types and implicits which are always available through the scala.Predef object. 96 | 97 | We also explained all the rules regarding implicit conversions. It is important to understand that there are strict rules regarding the use of them. We also made the point that they should be used with care. 98 | 99 | h4. 2.4 - XML.odp 100 | 101 | A short introduction to the XML support in Scala. This is mainly meant to help along the participant for the programming task of the evening. 102 | 103 | h4. 2.5 - The quiz game.odp 104 | 105 | A short intro to the exercise and demo of what the participant should create. Both shows the console game and the Swing game in action. Show part of the code, for instance the model classes. Also show that the provided Mock quiz which participants may use if they are stuck on XML parsing. 106 | 107 | This part should be about 3 hours. When participants start to finish up, it might be an idea to wrap up. 108 | 109 | h4. 2.6 - summary day 2.odp 110 | 111 | Basically tries to point the participants in directions for learning more Scala. 112 | 113 | h3. License 114 | 115 | The training course is licensed under "Creative Commons Attribution 3.0 Unported":http://creativecommons.org/licenses/by/3.0/. 116 | 117 | All this means, is that you need to credit Fredrik Vraalsen (fredrik@vraalsen.no) and Alf Kristian Støyle (alf.kristian@gmail.com) of scalaBin for the original work. Apart from that you may do whatever you please with the work. 118 | 119 | We hope you find it useful. 120 | --------------------------------------------------------------------------------