Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah but that suffers from the problems already mentioned - an employee doesn't fire themselves.


an employee isn't firing themselves, they are being sent the message they are being immediately fired


Sure - then what happens? They notice that they have been fired, but they don't remove themselves from the payroll, or anything like that. So what does the message do?


What do you do when you're fired? You collect all your belongings, wipe your machine, and leave.

Sure, someone could do this for you, but how would they know that you've left a tracksuit in a locker in the hallway or some cookies in the fridge? Unless the company manages a lot of bureaucracy that keeps track of every single object or resource belonging to the employee.


> What do you do when you're fired? You collect all your belongings, wipe your machine, and leave.

I'm sure you meant to say, the you tell all your belongings to collect themselves together, the machine that it better wipe itself and then you tell yourself to go through the door...


Haha, smart one. The point is, you can perform actions on what you own, and in turn you can ask what you own (for example a laptop) to perform an action on itself or its belongings.

You don't need to know how to handle a filesystem and a specific brand of hard drive to ask your laptop to wipe itself; the laptop in turn doesn't need to know all the internals of the hard drive to ask it to perform that action.


I agree with that. But my answer was for https://news.ycombinator.com/item?id=25118437

> So a method call fire() on an object Employee is more "object oriented" than having HREmployeeService.fireEmployee(employeeId)

Which doesn't make sense - ignoring the "to set field employedTo directly on EmployeeDAO" because that is unrelated.


> What do you do when you're fired

Oh, that's another point. You wouldn't send the message "fire [yourself]" but rather "[you are] fired". Do you agree?


I do. But the message you replied to was specifying that already:

"they are being sent the message they are being immediately fired"

To which you were asking "So what does the message do?"


Fair enough. I probably interpreted this response wrongly.

In the real world (in our program code I mean), such a message would probably rarely being sent, because there is no action to be done on our model of an employee - I guess that's why I got the answer wrong. My bad.


the message sender can then send the remove payroll message to the PayrollDepartment

Employee fired: "immediately" PayrollDepartment remove: "billy"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: