CodeClan Week 12

CodeClan Week 12

Week 12 of 16 complete.... this week has been really conceptual but really helpful to me as it helped me grow my understanding of why we do things a certain way, This week has also helped me with planning my projects out in a very clear and specific way before I even start coding. sorry this may get a bit 'whaatttt....?" but im going to basically write exactly what my class notes say... just to help me soz...!

Inheritance

in its most basic term.. one class inherits from another.. child classes inherit something in common from the parent class and to use this we add the word 'extends' to the end of the class name and name the class that is the parent class. Methods created in the parent class can also be overridden in the child class. We can also create an inheritance chain, where a class inherits from more than one layer of parent classes.

Polymorphism

The term polymorphism comes from two Greek words: 'poly' meaning 'many' and "morph" meaning 'change'. When we talk of something being 'polymorphic' we mean that it can have 'many forms'. Polymorphism can be implemented using both abstract classes and interfaces. All classes which inherit from a class can take the type of the superclass. To use an abstract class we create a superclass which all the classes we want to treat as being the same can inherit from. Inheritance is fraught with problems and we can quickly get into a mess. We can also just have one superclass. Interfaces also allow us to treat a class as being of another type. When a class implements an interface it gains the type of the interface without having a horrible inheritance chain. We can have as many interfaces as we like, too. Rather than just one super class.

Composition

One important thing to know about composition is that it is also about ownership. When we assign an object to be part of the composition of another object. Inheritance can be useful, but it needs to be used with caution. We can very easily get into a nightmare of tangled classes and override methods. We also can only inherit from ONE thing and one thing only. An object can't be both a Car and a Motorcycle. It can be one or the other.

In programming we have the saying favour composition over inheritance. We should compose our classes from other classes that implement the behaviours we need.


Solid Principles

S- Single Responsibility Principle -

O- Open Close Principle - Open for extension but closed for modification.

L - Liskov Substitution principle. This principle states that if you substitute a parent class with a child class then it shouldn't break your application. Building code that is maintainable and reusable.

I - Interface Integration Principle - Instead of one fat interface many small interfaces are preferred based on groups of methods, each one serving one submodule.

D - Dependancy Inversion - High-level modules should not depend on low-level modules.


Temple of OO

Inheritance

Polymorphism

Abstraction

Encapsulation

Coder Dojo

this week Coder Dojo was held at Code Clan which introduces young people to code. We used a microbit to create a game of Rock Paper Scissors and display different things dependant on the input so when button A was pressed, it would display a name, when B was pressed, it would show the string "Hello Dad" and on tilt it showed a smiley face! it was really cool to see young people getting involved in this kind of thing! I loved it and also really want a microbit.... Its something i'll do again definitely.


Day 4- All Day Lab

this lab was so much fun... it was to model a fantasy adventure. The game will have players, who will have a number of health points and weapons/spells. It took a lot of thinking and 3 Minds to make but it's been one of my favourite days! Game logic and I tend not to be friends but getting involved with this and having two really wonderfully talented team members helped!


we planned best we could but theres always changes as there is always an error something you don't think about but its such a good place to start! I can get a bit overwhelmed sometimes when I initially look at a task but then when you plan things out it breaks it down into really small manageable pieces!

Weekend homework

Rays Music Exchange - Basically was just recapping the whole week. It's been a heavy week on the brain, although I enjoyed the homework and It solidified everything from this week. The part I most enjoyed was planning the work and how everything is connected through interfaces or abstract classes and using TDD. Ive finally come to enjoy TDD... who knew.

Job Hunt

Job Hunt Continues... ! possible employers Hello! if anyone is looking for a super keen graduate developer get in touch, id love to her from you!

on to week 13...

要查看或添加评论,请登录

Chloe A.的更多文章

  • Beyond CodeClan - Pt 2

    Beyond CodeClan - Pt 2

    Well..

    7 条评论
  • Code Clan Final Project and Beyond

    Code Clan Final Project and Beyond

    Well, here I am..

    4 条评论
  • Code Clan Week 13

    Code Clan Week 13

    week 13 of 16 here I am..

    1 条评论
  • Code Clan Week 11

    Code Clan Week 11

    Im going to say this every week now, sorry(not sorry). I CANT BELIEVE I'M ON WEEK 11!!! It feels like i've went from…

    7 条评论
  • CodeClan Week 10

    CodeClan Week 10

    I cant believe how quickly that the whole course has flown in. seriously.

    3 条评论
  • Code Clan Week 8/9 - Java Script Project

    Code Clan Week 8/9 - Java Script Project

    Ok..

    1 条评论
  • Code Clan Week 7

    Code Clan Week 7

    Well i'm running a bit behind on sending this out this week..

  • Code Clan Week 6

    Code Clan Week 6

    Hello world..

    2 条评论
  • Code Clan - Project 1

    Code Clan - Project 1

    Tolo Fitness App First of all. Its still Friday but Im starting this one a bit early as I'll be working on my project…

    7 条评论
  • Code Clan Week 4

    Code Clan Week 4

    Hello week 4!. My my time is flying by at full speed x10.

    3 条评论

社区洞察

其他会员也浏览了