PlantUML: Add notes to the messages in a sequence diagram
Programming for beginners
by
1w ago
Using ‘note left’, ‘note right’ keywords we can add notes the messages in a sequence diagram.   notes.txt @startumlClient -> LoginServer: Enter user nameClient -> LoginServer: Enter passwordnote left: Input from the user \n should be taken by clientClient -> LoginServer: Submit the form note right: User details are validated \n against login serverLoginServer -> ADServer: Check the credentialsADServer -> LoginServer: Login SuccessfulLoginServer -> Client: Login Successful@enduml Above snippet generates below diagram.     Previous    &n ..read more
Visit website
Micronaut: Publish and listen on custom events
Programming for beginners
by
1w ago
In this post, I am going to explain how to publish and listen on custom events in Micronaut.   Define an event class. public class ConnectionCreateEvent {private String message;public ConnectionCreateEvent(String message) {this.message = message; }public String getMessage() {return message; }public void setMessage(String message) {this.message = message; }}   Define a publisher bean that emit the ConnectionCreateEvent messages. @Singletonpublic class ConnectionCreateEventPublisher {@Inject ApplicationEventPublisher<ConnectionCreateEvent> eventPublisher;pu ..read more
Visit website
Micronaut: replace default implementation of an interface
Programming for beginners
by
1w ago
@DefaultImplementation annotation is applied on an interface to indicate which implementation is the default implementation.   But there are cases, where you might need to replace the default implementation of the interface due to visibility restrictions of the class. @DefaultImplementation(FileDataSource.class)public interface DataSource {}@Singletonclass FileDataSource implements DataSource {public String toString() {return "MySQLDataSource"; }}@Singleton@Replaces(DataSource.class)public class MySQLDataSource implements DataSource {@Overridepublic String toString() {return "MySQLDat ..read more
Visit website
PlantUML: Add secondary group label
Programming for beginners
by
1w ago
You can specify a secondary label to the group by placing the text between [].   Syntax group label [secondaryLabel]   secondaryGroupLabel.txt @startumltitle "User login flow"header "User login"footer %page% of %lastpage%Client -> LoginServer: Enter user nameClient -> LoginServer: Enter passwordClient -> LoginServer: Submit the form LoginServer -> ADServer: Check the credentialsalt#green #lightblue login successful ADServer -> LoginServer: Login Successful LoginServer -> Client: Login Successfulelse Server not accessible group#silver "Retry to connec ..read more
Visit website
PlantUML: Group the statements
Programming for beginners
by
1w ago
‘group’ keyword is used to group the statements.   group.txt @startumltitle "User login flow"header "User login"footer %page% of %lastpage%Client -> LoginServer: Enter user nameClient -> LoginServer: Enter passwordClient -> LoginServer: Submit the form LoginServer -> ADServer: Check the credentialsalt#green #lightblue login successful ADServer -> LoginServer: Login Successful LoginServer -> Client: Login Successfulelse Server not accessible group#silver "Retry to connect the server" loop #00FFF8 "three times" LoginServer -> ADSe ..read more
Visit website
PlantUML: loop: Specify the recurring instructions
Programming for beginners
by
1w ago
‘loop’ keyword specify the recurring instructions.   loop.txt @startumltitle "User login flow"header "User login"footer %page% of %lastpage%Client -> LoginServer: Enter user nameClient -> LoginServer: Enter passwordClient -> LoginServer: Submit the form LoginServer -> ADServer: Check the credentialsalt#green #lightblue login successful ADServer -> LoginServer: Login Successful LoginServer -> Client: Login Successfulelse Server not accessible group "Retry to connect the server" loop "three times" LoginServer -> ADServer: Check the ..read more
Visit website
Quick guide to format code snippets in Javadoc
Programming for beginners
by
1w ago
In this post, I am going to explain how to format various code snippets in Javadoc.   a.   Using <pre> tag b.   Using <code> tag c.    Using {@code} d.   Using <pre> + {@code}   Using <pre> tag <pre> tag defines the preformatted text, the content in <pre> tag preserves both spaces and line break.   Example /** * Resource module provides a method to get a Resource instance. * * <pre> * Resource resource = Resource.create(); * resource.text(); * resource.close(); * </pre> * * @a ..read more
Visit website
Micronaut : replace one or more factory methods but retain the rest?
Programming for beginners
by
1w ago
By applying the @Replaces annotation on the method(s) and denote the factory to apply to, we can replace one or more factory methods and retain the rest. @Factorypublic class BooksBeanFactoryV2 {@Singleton@Named("java_tutorial_1")@Replaces(value = Book.class, factory = BooksBeanFactoryV1.class, named = "java_tutorial_1")public Book javaBook() { Book book1 = new Book("Programming for beginners (https://self-learning-java-tutorial.blogspot.com)");return book1; }} Find the below working application.   Step 1: Create new maven project ‘micronaut-replace-factory-methods ..read more
Visit website
PlantUML: alt, else: specify if-else clause in sequence diagram
Programming for beginners
by
1w ago
‘alt/else’ keyword can be used to address multiple cases in a sequence diagram. This is one of the grouping construct, a grouping construct is closed by end keyword.   altElse.txt @startumltitle "Login successful flow"header "User login"footer %page% of %lastpage%Client -> LoginServer: Enter user nameClient -> LoginServer: Enter passwordClient -> LoginServer: Submit the form LoginServer -> ADServer: Check the credentialsalt#green #lightblue login successful ADServer -> LoginServer: Login Successful LoginServer -> Client: Login Successfulelse #gold username i ..read more
Visit website
PlantUML: Grouping messages
Programming for beginners
by
1w ago
  Following keywords are used to group the messages a.   alt/else b.   opt c.    loop d.   par e.   break f.     critical g.   group, foll   Previous                                                    Next       &nb ..read more
Visit website

Follow Programming for beginners on Feedspot

Continue with Google
OR