rxue / dictionary

Practice in Java EE
0 stars 0 forks source link

Requirement

How to start through Terminal

  1. cd to docker directory
  2. run . web/start_mariadb.sh and then wait till database is ready
  3. run . web/deploy_2_wildfly.sh

Test REST API endpoint:

http://localhost/dictionary/rest/lexicalitems/1

Ubiquitous Language

lexical item

reference: https://en.wikipedia.org/wiki/Lexical_item

Critical question on definition of lexical item :

Based on Gemini, lexical entry has the detail information of lexical item, including the definition, part of speech etc`.

According to Crystal (1980: 274), polysemy is a term used in semantic analysis to refer to a lexical item which has a range of different meanings.

Reference: https://www.iasj.net/iasj/download/5784a6a9435b5c81

lexical entry

reference: https://www.vocabulary.com/dictionary/lexical%20entry

Design Analysis

Critical things to consider

New entity Explanation is introduced to aggregate defintion , part of speech , pronunciation etc. along with LexicalItem as foreign key. There is an invariant relationship from lexical item to explanation, i.e. one-to-many. However, when implementing it with JPA/Hibernate, there are at least three ways

Interface design: LexicalItemRepository and ExplanationRepository

Think first from the frontend point of view:

CREATE

READ

UPDATE

DELETE

Unidirectional @ManyToOne Association (Explanation > LexicalItem)

CREATE

READ

UPDATE

DELETE

This design strategy cannot simply meet the repositories.