Domain Modelling Patterns

Image
There are two main patterns for organizing business logic: the procedural Transaction script pattern, and the object-oriented Domain model pattern. 1. Transaction script pattern: An important characteristic of this approach is that the classes that implement behavior are separate from those that store state. When using the Transaction script pattern, the scripts are usually located in serviceclasses, which in this example is the OrderService class. A service class has one method for each request/system operation. The method implements the business logic for that request. It accesses the database using data access objects (DAOs), such as the OrderDao. The data objects, which in this example is the Order class, are pure data with little or no behavior. This style of design is highly procedural and relies on few of the capabilities of objectorientedprogramming (OOP) languages. This what you would create if you were writing the application in C or another non-OOP language. Neverthe

Kafka terminal commands cheat sheet

Cheat sheet for commonly Used Kafka Commands:

1.Start the Zookeeper server by executing the command:

bin/zookeeper-server-start.sh config/zookeeper.properties

2.Start the Kafka server by executing:

bin/kafka-server-start.sh config/server.properties

3.Create a topic

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic_name

4.Start a simple console consumer that can consume messages published to a given topic

kafka/bin/kafka-console-consumer.sh  --bootstrap-server localhost:9092  --topic topic_name --from-beginning

5.Start up a simple producer console that can publish messages to the topic_name topic:

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topic_name


Please suggest in comments to add any other kafka terminal command that you use frequently.


Comments

  1. zookeeper argument in Kafka-console-consumer was deprecated and removed in latest version, instead use the bootstrap-server argument passing the Kafka server address.

    ReplyDelete

Post a Comment

Popular posts from this blog

Guice Tutorial

Introduction to Kafka

Ruby Syntax Cheat Sheet