Is encapsulation possible without OOP?

Adnan Butt

I was asked a question in an interview: if encapsulation is possible without OOP, e.g. in a procedural language?

jaco0646

Bob Martin has stated that encapsulation is not only possible without OOP, it was better before OOP came along.

Here is an excerpt from a talk he gave in 2014 at Yale School of Management.

We had perfect encapsulation. In C, all you had to do was forward declare your functions and your data structures. You didn't have to implement them. You would forward declare them in a header file, and then you would implement them in a C file. Your users would #include your header file. They could see nothing of your implementation. Perfect encapaulation. There was no way any of your users could see any of your data values. All they could see was your function signatures. They could see the names of your data structures but none of the members inside your data structures. Absolutely perfect encapsulation.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Javascript - simple OOP encapsulation

分類Dev

Can we not use the term object while defining encapsulation in OOP?

分類Dev

react - accessing DOM without breaking encapsulation

分類Dev

PHP - Insert to database without refresh page ( OOP )

分類Dev

ReplaceDocumentAsync without Document is that possible?

分類Dev

Possible to dispatch an action without connect?

分類Dev

Encapsulation and Getters

分類Dev

Is it possible to restart the unity panel without restarting compiz?

分類Dev

Is it possible to change ownership of a file without root access?

分類Dev

Is it possible to work without tmux on current Debian?

分類Dev

Is it possible to use ActiveStorage without a file input?

分類Dev

Is it possible to read a file without loading it into memory?

分類Dev

Bottle - Is it possible to retrieve URL without parameters?

分類Dev

Is it possible to define the height of a row in a UITableView without an UITableViewController?

分類Dev

Is it possible to put root in LVM without using initrd?

分類Dev

Is it possible to enable NTFS compression without formatting?

分類Dev

All possible N choose K WITHOUT recusion

分類Dev

Possible to save OpenXML Spreadsheet without calling Close()?

分類Dev

Is it possible to show/hide an element in a parent without rerendering?

分類Dev

OOP PythonWebSocket

分類Dev

Is it possible to open an Access 2010 database file without using Wine or VirtualBox?

分類Dev

Is it possible to implement the "virtual constructor" pattern in C# without casts?

分類Dev

Laravel DI: call controller method without passing injected variable, is it possible?

分類Dev

Get all possible combination of items in array without duplicate groups in Swift

分類Dev

Is it possible to have the enum ordinal in kotlin without explicitly calling ordinal?

分類Dev

Is it possible to change few files in submodule without creating fork?

分類Dev

Is it possible to link to a shared library without access to the library itself?

分類Dev

Is it possible to read tweet-text of a tweet URL without twitter API?

分類Dev

Is it possible to allow for offline playback without using the "persistent-license" type?

Related 関連記事

  1. 1

    Javascript - simple OOP encapsulation

  2. 2

    Can we not use the term object while defining encapsulation in OOP?

  3. 3

    react - accessing DOM without breaking encapsulation

  4. 4

    PHP - Insert to database without refresh page ( OOP )

  5. 5

    ReplaceDocumentAsync without Document is that possible?

  6. 6

    Possible to dispatch an action without connect?

  7. 7

    Encapsulation and Getters

  8. 8

    Is it possible to restart the unity panel without restarting compiz?

  9. 9

    Is it possible to change ownership of a file without root access?

  10. 10

    Is it possible to work without tmux on current Debian?

  11. 11

    Is it possible to use ActiveStorage without a file input?

  12. 12

    Is it possible to read a file without loading it into memory?

  13. 13

    Bottle - Is it possible to retrieve URL without parameters?

  14. 14

    Is it possible to define the height of a row in a UITableView without an UITableViewController?

  15. 15

    Is it possible to put root in LVM without using initrd?

  16. 16

    Is it possible to enable NTFS compression without formatting?

  17. 17

    All possible N choose K WITHOUT recusion

  18. 18

    Possible to save OpenXML Spreadsheet without calling Close()?

  19. 19

    Is it possible to show/hide an element in a parent without rerendering?

  20. 20

    OOP PythonWebSocket

  21. 21

    Is it possible to open an Access 2010 database file without using Wine or VirtualBox?

  22. 22

    Is it possible to implement the "virtual constructor" pattern in C# without casts?

  23. 23

    Laravel DI: call controller method without passing injected variable, is it possible?

  24. 24

    Get all possible combination of items in array without duplicate groups in Swift

  25. 25

    Is it possible to have the enum ordinal in kotlin without explicitly calling ordinal?

  26. 26

    Is it possible to change few files in submodule without creating fork?

  27. 27

    Is it possible to link to a shared library without access to the library itself?

  28. 28

    Is it possible to read tweet-text of a tweet URL without twitter API?

  29. 29

    Is it possible to allow for offline playback without using the "persistent-license" type?

ホットタグ

アーカイブ