Giter VIP home page Giter VIP logo

smart-home-2020's Introduction

Smart Home

The project implements a "smart home". The house has sensors which are connected to the central server. Sensors send events when lights are turned on/off or doors are opened/closed.

Classes description

  • The system receives events of type SensorEvent
  • SmartHome – the home itself, it contains rooms
  • Room – a room, it contains doors and lights
  • Door – a door (interior or entrance one)
  • Light – a source of light (e.g. light bulb)
  • SensorEvent – physical world event
  • SensorEventType – event type (4 types)
  • SensorCommand – a command which allows programmatically manage the physical world (turn lights on/off, open/close door)
  • CommandType – command type (1 type - turn lights off)

Coding hints

Stick to generally accepted Java style guidelines (e.g. Oracle or Google) when you name methods, classes or variables. Apply same guidelines everywhere in the project.

Inheritance between classes is not particularly useful in this project. Try not to use it each time you think you need one.

Follow Tell-Don't-Ask principle during class interactions design.

There may be many potential reasons to change for a project. Keep in mind that the most probable ones for this project are:

  • New house objects
  • New event types
  • Increasing complexity of events

Separate configuration code (e.g. dependencies setup, changes frequently) from business logic code (e.g. opening door event handling routine, changes not so frequently).

Watch out for introducing leaky abstractions into your code (e.g. an abstraction for reading data must not know if the implementation does it with file IO or through network).

smart-home-2020's People

Contributors

a-ivanov avatar sbt-agoshkov-iv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.