Siddhpura Amitkumar
1 min readJun 16, 2020

--

Hi first of all thank you so much for your blog about Singleton, it helps me to understand that why it is bad for unit test. One thing I don’t understand is that “Only access Singletons from top-level control structures.”, How it can help us? Suppose I have two activity, in that I am using this singleton. If from one activity I book an appointment then it still remains in booked in next activity also right!,

Second thing,

// Mock a calendar
PatientCalendar bookedCal = createAlwaysBookedCalendar();

What will be the createAlwaysBookedCalendar()? How it will generate bookCal object?

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Siddhpura Amitkumar
Siddhpura Amitkumar

Written by Siddhpura Amitkumar

📱 Android Engineer, 📝 Writer, 💻 Open Source Contributor, Techie, IoT, Interactive Projects, ☁ AWS, Google Cloud, Firebase, Python, React.

Responses (1)

Write a response