3

I'm a Master Student in Computing Science and currently investigating the Bitcoin source code on the Software Patterns that are used. Part of the assignment is to ask the community to guide us.

I would like to ask you if you know any Software Pattern in the source code. In order to give you a view of our scope, below is a list of Patterns covered (Design Patterns and Architectural Patterns).

Thanks in advance,

Patrick

Object Oriented Design Patterns:

  • Factory Pattern
  • Adapter Pattern
  • Composite Pattern
  • Facade Pattern
  • Proxy Pattern
  • Observer Pattern

Architectural Patterns:

  • Layered Decomposition Pattern
  • Pipes And Filters Pattern
  • Data Repository Pattern
  • Model View Controller Pattern
  • Client Server Pattern
  • Peer to Peer Pattern
  • Publish Subscribe Pattern
  • Broker Pattern
  • Message Queue Pattern
  • Software patterns apply to software. Bitcoin is a protocol. Is your question about a specific implementation? – Pieter Wuille Dec 22 '17 at 16:18
  • This question is specifically about the Bitcoin-core repository – Patrick Dec 22 '17 at 19:05
  • Cool, please clarify your question accordingly. – Pieter Wuille Dec 22 '17 at 21:18
2

i don't think you can find many Object Oriented Design Patterns in the btc-source-code. but there is one example i know:

the blockchain itself is like a composite pattern: you have a general type called Block. two types inherits Block: MinedBlock inherits from Block and GenesisBlock inherits from Block. A MinedBlock has one attribute of the type Block called PreviousBlock. (here you can also find the singleton pattern: you need exactly one GenesisBlock-object.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.