Coder Social home page Coder Social logo

phonebook's Introduction

The PhoneBook Example

Let us imagine that we want to build a simple PhoneBook application, capable of storing a set of contacts for each registered person. A person has a name and each contact is represented by a name and a phone number.

Describing the Domain

The domain model of the PhoneBook application consists only of three entities: PhoneBook, Person and Contact. The PhoneBook entity represents the class that knows all registered people. Each person maintains his/her own set of contacts.

Describing entities using the DML

Using the DML, we could textually describe the domain model of our PhoneBook application through the following DML code:

1. class PhoneBook;
2.
3. class Person	{
4. 		String	name;
5. }
6.
7. class Contact {
8. String name;
9. String phoneNumber;
10. }

There are other business rules that should be implemented. For instance, consider that it should be possible to remove a Contact given its name, and getting all Contact instances whose name contains a given substring. These would correspond to the implementation of methods in the Person class with the desired functionality.

phonebook's People

Contributors

dependabot[bot] avatar fmcalisto avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mhcrnl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.